private void OpenDepartmentView(OpenWindowMessage msg) { BaseWindow view; if (msg.WindowType == "SyncDepartmentView") { view = new SyncDepartmentView() { DataContext = msg.DataContext }; view.BorderThickness = new Thickness(1); view.GlowBrush = null; view.SetResourceReference(MetroWindow.BorderBrushProperty, "AccentColorBrush"); view.ShowDialog(); } else { view = new DepartmentView { DataContext = msg.DataContext }; view.BorderThickness = new Thickness(1); view.GlowBrush = null; view.SetResourceReference(MetroWindow.BorderBrushProperty, "AccentColorBrush"); view.ShowDialog(); } }
private void DoNewDepartmentView(object obj) { DepartmentViewModel dvm = new DepartmentViewModel(null); dvm.AddDepartmentEvent += MainModel.AddDepartment; DepartmentView dView = new DepartmentView { DataContext = dvm }; dView.ShowDialog(); }
private void DoOpenDepartmentView(object obj) { if (obj == null) { return; } DepartmentViewModel dvm = new DepartmentViewModel((DepartmentModel)obj); dvm.UpdateDepartmentEvent += MainModel.UpdateDepartment; DepartmentView dView = new DepartmentView { DataContext = dvm }; dView.ShowDialog(); }