예제 #1
0
        private void CreateNew()
        {
            var model = new AlertAndWorkDialogViewModel(null);
            var view  = new AlertAndWorkDialog
            {
                DataContext = model,
                Owner       = Application.Current.MainWindow
            };

            model.SetView(view);
            view.ShowDialog();
            RefreshAlerts();
        }
예제 #2
0
        private void Open(object sender)
        {
            var selectedItem = sender as AlertDto;

            if (selectedItem == null)
            {
                return;
            }

            var model = new AlertAndWorkDialogViewModel(selectedItem);
            var view  = new AlertAndWorkDialog
            {
                DataContext = model,
                Owner       = Application.Current.MainWindow
            };

            model.SetView(view);
            if (view.ShowDialog() == true)
            {
                RefreshAlerts();
            }
        }