예제 #1
0
        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();
            }
        }
예제 #2
0
        private void DoNewDepartmentView(object obj)
        {
            DepartmentViewModel dvm = new DepartmentViewModel(null);

            dvm.AddDepartmentEvent += MainModel.AddDepartment;
            DepartmentView dView = new DepartmentView {
                DataContext = dvm
            };

            dView.ShowDialog();
        }
예제 #3
0
        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();
        }