Featured post
WPF/MVVM - should view-models stay constant and just the model change? -
i'm bit in doubt 'the right way'.
i have application concepts visual studio, i'll use explain:
i have 'solution' view model , model behind. view model displayed in 'explorer'.
i can change between situations 'no solution loaded' 'a solution loaded' , back.
and question :-) :
should keep view model object , let reflect have new 'solution object' loaded? or should create new view model object , let view bind new object?
thanks comments!
(and merry christmas all!)
anders, denmark
your viewmodel contains state of data associated ui not further back in model.
one way answer questions such yours considering behaviour want in ui , needs binding state information. or, put different way, time feel writing code cause ui elements shown or hidden, think how maps boolean variable.
so, take large chunks of ui visible when have model loaded. these might have visibility bound boolean property in viewmodel issolutionloaded.
maybe want disable things if processing occurring, have property iscompiling. i've used approach property notrunningthreadedprocessing shown below, let me disable controls when synchronisation object existed in viewmodel.
cntl_whitelevel.setbinding(progressbar.isenabledproperty, new binding("notrunningthreadedprocessing")); // , c++/cli property concerned property bool notrunningthreadedprocessing { bool get() { return mthreadedcommandsyncher == nullptr; } };
- Get link
- X
- Other Apps
Comments
Post a Comment