Ejemplo n.º 1
0
        private async Task <string?> OpenNameEditingWindow(string source)
        {
            var vm = new ConditionGroupsInputViewModel(source);

            if (await windowManager.ShowDialog(vm))
            {
                if (!string.IsNullOrWhiteSpace(vm.Name))
                {
                    return(vm.Name);
                }
                else
                {
                    await messageBoxService.ShowDialog(new MessageBoxFactory <bool>().SetTitle("Error!")
                                                       .SetMainInstruction($"Group name cannot be empty!")
                                                       .SetIcon(MessageBoxIcon.Error)
                                                       .WithOkButton(true)
                                                       .Build());
                }
            }
            return(null);
        }
        private void OpenNameEditingWindow(string source, out string name)
        {
            var vm = new ConditionGroupsInputViewModel(source);

            name = "";
            if (windowManager.ShowDialog(vm))
            {
                if (!string.IsNullOrWhiteSpace(vm.Name))
                {
                    name = vm.Name;
                }
                else
                {
                    messageBoxService.ShowDialog(new MessageBoxFactory <bool>().SetTitle("Error!")
                                                 .SetMainInstruction($"Group name cannot be empty!")
                                                 .SetIcon(MessageBoxIcon.Error)
                                                 .WithOkButton(true)
                                                 .Build());
                }
            }
        }