wpf - What should compose View with ViewModel and show result? -
i have problem of thinking ideal solution creating , showing window in wpf mvvm application. part of application needs show window data. create vm, set properties, create view, assign vm (in constructor), display window. done using class named viewcontroller , class have methods parameters every window in application. think there can better solution this, not overengineered.
the normal solution have class wraps , instantiates view viewmodel pair. called screen. this.
public class screen<tview> tview : window { public screen(tview view, object viewmodel){ //store view , viewmodel props //display view //set viewmodel datacontext of view } } this rough example, there lots of ways can it.
Comments
Post a Comment