I have two UserControls ("UserControlParentView" and "UserControlChildView") with the MVVM pattern applied in both controls:
Text after "div class =" itemprop = "text">
Parental control is a container for control of hair and the property of hair control should be updated by binding data with parental control so that some check boxes can be shown / hidden inside the hair control.
Parental Control Details
The property of UserControlParentViewModel is:
private boolShowCheckbox = false; Public bool IsShowCheckbox {get {return isShowCheckbox; } Set {isShowCheckbox = value; NotifyPropertyChanged ("IsShowCheckbox"); }}
UserControlParentViewModel - How do I DataContext set of parental control:
public UserControlParentView () {InitializeComponent (); this. DataContext = New UserControlParentViewModel (); }
UserControlParentView toggle button (XAML), UserControlParentViewModel is bound to IsShowCheckbox property
& lt; ToggleButton Grid.Column = "1" IsChecked = "{Binding IsShowCheckbox, Mode = Dole}" & gt; & Lt; / ToggleButton & gt;
In addition, parental control happens in the child element (somewhere in XAML)
& lt; Local: UserControlChildView IsCheckBoxVisible = "{IsShowCheckbox Binding}" and gt; & Lt; / Local: UserControlChildView & gt;
So the user should update the property in togggle / untoggle button child control to control the boolean property with basic control in hair control, but nothing happened! Breakpoint never removed
The property UserControlChildView should be updated under the control of parents (I behind planned to hide in chechBox appear / code here):
< pre> public bool Aiskekboks view ({return (bool) Getvalu (Aiscokboksvijiproprti);} set {set value (Isacoksbokseepiprti, value);}} // as the backing store for IsCheckBoxVisible using a dependency property It enables the animation, styling, binding, etc ... public static DependencyProperty IsCheckBoxVisibleProperty = DependencyProperty.Register ( "IsCheckBoxVisible", typeof (bool), typeof (TopMenuButton), New PropertyMetadata (false)) read-only;
So the question is - Am I doing wrong? Why child property is never updated? BTW - There is no binding error warning in the output window ...
You do not state you never break the breakpoint! " My guess is that you are putting a break point in the set
mutator method in the IsCheckBoxVisible
property.
You are working under the assumption that the set
method will be called while specifying a value due to the asset at some point binding on it. However, according to Silverlight binding framework, SetValue
is directly call makes it set value
IsCheckBoxVisibleProperty
and the value assigned to the value of the method.
Comments
Post a Comment