Esempio n. 1
0
        public void FindCustomer()
        {
            var findDialogViewModel = FindDialogViewModel.Create();

            findDialogViewModel.SetParentViewModel(this);
            if (SelectedEntity != null)
            {
                findDialogViewModel.SearchID = SelectedEntity.ID;
            }
            var commands = new List <UICommand>
            {
                new UICommand {
                    Id        = "Find",
                    Caption   = "Find",
                    Command   = new DelegateCommand(() => NavigateToCustomerByID(findDialogViewModel)),
                    IsDefault = true,
                    IsCancel  = false,
                    Tag       = DialogResult.OK
                }
            };

            DialogService.ShowDialog(commands, "Find Customer", "FindDialogView", findDialogViewModel);
        }
Esempio n. 2
0
 void NavigateToCustomerByID(FindDialogViewModel findDialogViewModel)
 {
     SelectedEntity = Entities.FirstOrDefault(c => c.ID == findDialogViewModel.SearchID);
 }