Exemplo n.º 1
0
        private async void ExecuteAddNewStaffCommand()
        {
            this.StaffDetailViewModel = new StaffDetailViewModel
            {
                SelectedStaff      = new NHANVIEN(),
                AgenciesCollection = this.allAgencies
            };

            var view = new StaffDetailDialog
            {
                DataContext = this.StaffDetailViewModel
            };

            //show the dialog
            var result = await DialogHost.Show(view, BaseMainWindowViewModel.Instance.Identifier, ExtendedOpenedEventHandler, AddNewStaffClosingEventHandler).ConfigureAwait(false);

            //check the result...
            Console.WriteLine("Dialog was closed, the CommandParameter used to close it was: " + (result ?? "NULL"));
        }
Exemplo n.º 2
0
        private async void ExecuteEditStaffCommand(object key)
        {
            var values = (object[])key;

            this.modifiedStaff = NhanVienDAO.GetInstance().GetStaffById(values);

            this.StaffDetailViewModel = new StaffDetailViewModel
            {
                SelectedStaff      = this.modifiedStaff,
                AgenciesCollection = this.allAgencies
            };

            var view = new StaffDetailDialog
            {
                DataContext = this.StaffDetailViewModel
            };

            //show the dialog
            var result = await DialogHost.Show(view, BaseMainWindowViewModel.Instance.Identifier, ExtendedOpenedEventHandler, EditStaffClosingEventHandler).ConfigureAwait(false);

            //check the result...
            Console.WriteLine("Dialog was closed, the CommandParameter used to close it was: " + (result ?? "NULL"));
        }