This question is locked. New answers and comments are not allowed.
hi Team,
I am using RAd pane control an MVVM pattern but when i am binding IsHidden Property control with a propertys in Viewmodel the control is not visbible even i sent the property to false . please find the sample code i am using below .
Viewmodel :
in the above example i tried to set the ishidden property of pane1 to true on constructor of view model and when we check the checkbox i am making it to false . even then we are not able to see the pane1.
Please let us know if we are doing anything wrong here . if possible can you please share the sample code for this scenario.
Reagrds,
Rajesh
I am using RAd pane control an MVVM pattern but when i am binding IsHidden Property control with a propertys in Viewmodel the control is not visbible even i sent the property to false . please find the sample code i am using below .
<Grid x:Name="LayoutRoot" Background="White"> <Grid.RowDefinitions> <RowDefinition Height="auto" /> <RowDefinition /> </Grid.RowDefinitions> <Grid.DataContext> <local:ViewModel></local:ViewModel> </Grid.DataContext> <CheckBox Content="IsHidden" IsChecked="{Binding Hidden, Mode=TwoWay}" /> <telerik:RadDocking Width="Auto" Height="Auto" BorderThickness="0" Grid.RowSpan="2" Grid.Row="1" > <telerik:RadDocking.Background> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FFECF0F4" Offset="0"/> <GradientStop Color="White" Offset="1"/> </LinearGradientBrush> </telerik:RadDocking.Background> <telerik:RadDocking.DocumentHost> <telerik:RadSplitContainer> <telerik:RadPaneGroup BorderThickness="0" TabStripPlacement="Top"> <telerik:RadPane x:Name="Pane1" IsHidden="{Binding Hidden}" BorderThickness="0" CanUserClose="False" Title="Summary" IsSelected="True" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto"> </telerik:RadPane> <telerik:RadPane x:Name="Pane2" IsHidden="{Binding Hidden1}" BorderThickness="0" CanUserClose="False" Title="Message" > </telerik:RadPane> </telerik:RadPaneGroup> </telerik:RadSplitContainer> </telerik:RadDocking.DocumentHost> </telerik:RadDocking> </Grid>public class ViewModel : INotifyPropertyChanged { private bool hidden; private bool hidden1; public ViewModel() { this.hidden = false; this.hidden1 = (!hidden); } public bool Hidden { get { return this.hidden; } set { if (value != this.hidden) { this.hidden = value; this.hidden1 = (!hidden); this.OnPropertyChanged("Hidden"); } } } public bool Hidden1 { get { return this.hidden1; } set { if (value == this.hidden1) { this.hidden1 = value; this.OnPropertyChanged("Hidden1"); } } } public event PropertyChangedEventHandler PropertyChanged; protected void OnPropertyChanged(string propertyName) { this.OnPropertyChanged(new PropertyChangedEventArgs(propertyName)); } protected virtual void OnPropertyChanged(PropertyChangedEventArgs args) { if (this.PropertyChanged != null) { this.PropertyChanged(this, args); } } }in the above example i tried to set the ishidden property of pane1 to true on constructor of view model and when we check the checkbox i am making it to false . even then we are not able to see the pane1.
Please let us know if we are doing anything wrong here . if possible can you please share the sample code for this scenario.
Reagrds,
Rajesh