c# - Update/Sync value on all WPF usercontrols -
with 2 booleans (bool 1, bool2) changing between 4 screens
/usercontrols
(over ipageviewmodel
class). every usercontrol
connected viewmodelbasescreens
class. above have 1 main screen in lying 2 booleans can change screen.
every of screen have same boolean synchronized between screens. how update boolean between usercontrols
? or how bind @ same time (when property change)? best solution?
i transfer bool value between screen user set in previous screen.
i pretty beginner in wpf (mvvm
) please gentle me :)
you have not provided full context of problem, here general steps should take in mvvm application:
- use mvvm framework. mvvm light favorite.
- inherit viewmodel
viewmodelbase
(defined in mvvm light). - define both
bool
value public properties , useraisepropertychanged()
tell world change. - bind screens same viewmodel object using standard wpf
binding
.
now whenever values of bool properties change, screens refreshed automatically.
Comments
Post a Comment