Beispiel #1
0
 public void ShowMessage(string title, string message)
 {
     Application.Current.Invoke(() =>
     {
         OkCancelDialogViewModel viewModel = new OkCancelDialogViewModel(title, message);
         ShowDialog(viewModel);
     });
 }
        private async void ExecuteDeleteHouseCategoryCommand(int cateId)
        {
            this.modifiedHouseCategory = LoaiNhaDAO.GetInstance().GetHouseCategoryById(cateId);

            var okeCancelDialogViewModel = new OkCancelDialogViewModel
            {
                Message = "Xóa loại nhà này?"
            };

            var view = new OkCancelDialogControl
            {
                DataContext = okeCancelDialogViewModel
            };

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

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

            this.ModifiedCustomer = KhachHangDAO.GetInstance().GetCustomerById(values);

            var okeCancelDialogViewModel = new OkCancelDialogViewModel
            {
                Message = "Xóa khách hàng này?"
            };

            var view = new OkCancelDialogControl
            {
                DataContext = okeCancelDialogViewModel
            };

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

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

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

            var okCancelDialogVm = new OkCancelDialogViewModel()
            {
                Message = "Xóa nhân viên này?"
            };

            var view = new OkCancelDialogControl()
            {
                DataContext = okCancelDialogVm
            };

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

            //check the result...
            Console.WriteLine("Dialog was closed, the CommandParameter used to close it was: " + (result ?? "NULL"));
        }
Beispiel #5
0
 public OkCancelDialogView(OkCancelDialogViewModel okCancelDialogViewModel)
 {
     InitializeComponent();
     DataContext = okCancelDialogViewModel;
 }