Thank you for the code snippet.
If you are not using the MVVM pattern
in your application I recommend you instead of a property in the code-behind of the MainWindow to change directly the IsActive property of the contextual group using its x:Name.
sender, RoutedEventArgs e)
This way you won't need to create an additional property.
If you are using MVVM you can define the boolean IsFormAgentVisible property in your MainViewModel and bind it to the contextual group's IsActive property. Here is a simple example:
ExampleViewModel : ViewModelBase
.isFormAgentVisible = value;
As a side note, in order for the UI to listen for dynamic changes in its bound properties, those properties should implement the INotifyPropertyChanged
Please let me know if this helps.
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos
and start improving your app based on facts, not hunches.