public BarViewModel(BarModel model) { _model = model; _isExpanded = model.IsExpanded; _expand = new RelayCommand(p => this.IsExpanded = true, p => !this.IsExpanded); _collapse = new RelayCommand(p => this.IsExpanded = false, p => this.IsExpanded); }
public MainWindowViewModel() { _barModel = new BarModel(); _showBar = new RelayCommand(p => this.Bar = new BarViewModel(_barModel), p => null == _bar); _hideBar = new RelayCommand(p => this.Bar = null, p => null != _bar); }