Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

wpf - Open new Window from view model -


hi have beginner problem. have shell (it wpf window) , in shell screen (it user control / view model).

i open new window view model, not show user control in shell.

so create new window - chatview

<window x:class="spirit.views.chatview"         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"          xmlns:exttoolkit="clr-namespace:microsoft.windows.controls;assembly=wpftoolkit.extended" title="chatview" height="545" width="763">     <grid margin="4,4,4,4">      </grid> </window> 

export chatviewmodel mef.

 public interface ichatviewmodel     {      }      [export("chatscreen",typeof(ichatviewmodel))]     public class chatviewmodel     {      } 

in view model have method:

with showscreen class me mr.marco amendola. likes this:

public class showscreen : iresult     {         readonly type _screentype;         readonly string _name;          [import]         public ishellviewmodel shell { get; set; }          action<object> _initializationaction = screen => { };          public showscreen initializewith<t>(t argument)          {             _initializationaction = screen =>                                         {                                             var initializable = screen iinitializable<t>;                                             if (initializable != null)                                                 initializable.initialize(argument);                                         };         return this;         }           public showscreen(string name)         {             _name = name;         }          public showscreen(type screentype)         {             _screentype = screentype;         }          public void execute(actionexecutioncontext context)         {             var screen = !string.isnullorempty(_name)                 ? ioc.get<object>(_name)                 : ioc.getinstance(_screentype, null);              _initializationaction(screen);              shell.activateitem(screen);             completed(this, new resultcompletioneventargs());         }          public event eventhandler<resultcompletioneventargs> completed = delegate { };          public static showscreen of<t>()         {             return new showscreen(typeof(t));         }     } 

my problem if try show new window doesn’t works, works if show new user control in shell(window).

i achieve behavior in skype. have main window listbox, double clicked on item , show new chat window.

main window can publish eventaggregator on chat window , chat window can publish on main window. goal.

i know can not use class showscreen on showing new window. know correct way create new window view model , inject event aggregator vie model.

any advice? thank , time.

have looked @ windowmanager.show or windowmanager.showdialog? rob has sample @ http://caliburnmicro.codeplex.com/wikipage?title=the%20window%20manager. can inject dependency view model iwindowmanager.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -