コード例 #1
0
        public MainWindow(MessageBoxFacade messageBoxFacade, IKernel kernel,
                          MainViewModel viewModel, DepartmentMoverFactory departmentMoverFactory)
        {
            if (messageBoxFacade == null)
            {
                throw new ArgumentNullException(nameof(messageBoxFacade));
            }
            if (kernel == null)
            {
                throw new ArgumentNullException(nameof(kernel));
            }
            if (viewModel == null)
            {
                throw new ArgumentNullException(nameof(viewModel));
            }
            if (departmentMoverFactory == null)
            {
                throw new ArgumentNullException(nameof(departmentMoverFactory));
            }

            DataContext = viewModel;
            InitializeComponent();
            _messageBoxFacade       = messageBoxFacade;
            _kernel                 = kernel;
            _viewModel              = viewModel;
            _departmentMoverFactory = departmentMoverFactory;
        }
コード例 #2
0
        public InputControl(MessageBoxFacade messageBoxFacade)
        {
            InitializeComponent();
            Background = Brushes.LightGray;

            _messageBoxFacade = messageBoxFacade ?? throw new ArgumentNullException(nameof(messageBoxFacade));
            Loaded           += (sender, args) => { InputTextBox.Focus(); };
        }
コード例 #3
0
        public AdminWindow(AdminViewModel viewModel, MessageBoxFacade messageBoxFacade)
        {
            if (viewModel == null)
            {
                throw new ArgumentNullException(nameof(viewModel));
            }
            if (messageBoxFacade == null)
            {
                throw new ArgumentNullException(nameof(messageBoxFacade));
            }
            InitializeComponent();

            DataContext       = viewModel;
            _viewModel        = viewModel;
            _messageBoxFacade = messageBoxFacade;
        }
コード例 #4
0
        public AddUserWindow(AddUserViewModel viewModel, MessageBoxFacade messageBoxFacade)
        {
            if (viewModel == null)
            {
                throw new ArgumentNullException(nameof(viewModel));
            }
            if (messageBoxFacade == null)
            {
                throw new ArgumentNullException(nameof(messageBoxFacade));
            }
            if (!viewModel.Departments.Any())
            {
                throw new ArgumentNullException(nameof(viewModel.Departments));
            }

            InitializeComponent();
            DataContext       = viewModel;
            _viewModel        = viewModel;
            _messageBoxFacade = messageBoxFacade;
        }