Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MainWindowViewModel : INotifyPropertyChanged
- {
- private bool _isVisible;
- public bool isVisible
- {
- get { return _isVisible; }
- set
- {
- _isVisible = value;
- NotifyOfPropertyChange("isVisible");
- }
- }
- public MainWindowViewModel()
- {
- Window1 X = new Window1();
- isVisible = false;
- X.Show();
- }
- public event PropertyChangedEventHandler PropertyChanged;
- protected void NotifyOfPropertyChange(string name)
- {
- PropertyChangedEventHandler handler = PropertyChanged;
- if (handler != null)
- {
- handler(this, new PropertyChangedEventArgs(name));
- }
- }
- }
- <Window.Resources>
- <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"></BooleanToVisibilityConverter>
- </Window.Resources>
- <Window.Visibility>
- <Binding Path="isVisible" Converter="{StaticResource BooleanToVisibilityConverter}" />
- </Window.Visibility>
Add Comment
Please, Sign In to add comment