private void DockManager_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { if (_oldModel != null) { _oldModel.PropertyChanged -= ViewModel_PropertyChanged; } _oldModel = Model; Model.PropertyChanged += ViewModel_PropertyChanged; }
public Workspace([ImportMany] IEnumerable <Lazy <ILister> > listers, Options options, CommandRepository commandRepository) { _listers = listers; Options = options; CommandRepository = commandRepository; RenamePopupViewModel = new RenamePopupViewModel(this); Docking = new DockViewModel(this); KeyDispatcher = new KeyDispatcher(this); CommanderbarViewModel = new CommanderbarViewModel(this); TaskManager = new TaskManager(this); NotificationHost = new NotificationHost(this); ThemeHandler = new ThemeHandler(this); AddressbarViewModel = new AdressbarViewModel(this); RibbonViewModel = new RibbonViewModel(this); TemporaryFavorites = new TemporaryFavorites <IItem>(); PopupViewModel = new FilterPopupViewModel(this, options, null); }
private void Application_Startup(object sender, StartupEventArgs e) { var service = new DockService(); service.GetDocks((docks, error) => { if (error != null) { throw new Exception("Problem loading docks.", error); } foreach (var dock in docks) { var window = new DockView(); var dockViewModel = new DockViewModel(dock); window.DataContext = dockViewModel; window.Show(); } }); }