public InstallServiceViewModel(IDialogHelper dialogHelper, IActionHelper actionHelper)
 {
     _actionHelper   = actionHelper;
     _dialogHelper   = dialogHelper;
     _cancelCommand  = new DelegateCommand(CancelExecuted);
     _installCommand = new DelegateCommand(InstallExecuted, InstallCanExecute);
 }
Beispiel #2
0
        public UserProfileDialog(
            IDialogHelper helper,
            ICompanyRegistryManager companyRegistryManager)
            : base(nameof(UserProfileDialog))
        {
            _helper = helper ?? throw new System.ArgumentNullException(nameof(helper));

            AddDialog(new TextPrompt(NAME_VALIDATION, NamePromptValidatorAsync));
            AddDialog(new TextPrompt(EMAIL_VALIDATION, EmailPromptValidatorAsync));
            AddDialog(new NumberPrompt <int>(AGE_VALIDATION, AgePromptValidatorAsync));
            AddDialog(new CustomConfirmPrompt(nameof(CustomConfirmPrompt)));
            AddDialog(new UserCompanyDialog(helper, companyRegistryManager ?? throw new System.ArgumentNullException(nameof(companyRegistryManager))));

            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                AskForAgreementStepAsync,
                AskForNameStepAsync,
                AskForEmailStepAsync,
                AskForAgeStepAsync,
                SkipOrAskForAgeStepAsync,
                StartCompanyDialogStepAsync,
                FinalStepAsync,
            }));

            InitialDialogId = nameof(WaterfallDialog);
        }
Beispiel #3
0
 public DialogBot(
     IDialogHelper dialogHelper,
     T dialog,
     ILogger <DialogBot <T> > logger)
 {
     _helper = dialogHelper ?? throw new System.ArgumentNullException(nameof(dialogHelper));
     _dialog = dialog;
     _logger = logger;
 }
        public LoginPageViewModel(IDialogHelper dialogHelper, INavigationService navigationService)
        {
            LoginCommand = new DelegateCommand(OnLoginClicked);

            RegisterCommand = new DelegateCommand(OnRegisterClicked);

            this.navigationService = navigationService;

            this.dialogHelper = dialogHelper;
        }
Beispiel #5
0
        public MainDialog(
            IDialogHelper helper,
            ICompanyRegistryManager companyRegistryManager)
            : base(nameof(MainDialog))
        {
            this._helper = helper ?? throw new System.ArgumentNullException(nameof(helper));

            AddDialog(new UserProfileDialog(helper, companyRegistryManager ?? throw new System.ArgumentNullException(nameof(companyRegistryManager))));

            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                StartUserProfileDialogStepAsync,
                FinalStepAsync,
            }));

            InitialDialogId = nameof(WaterfallDialog);
        }
Beispiel #6
0
 public BuildClientViewModel(
     IModelContextFactory contextFactory,
     IDialogHelper dialogHelper,
     IActionHelper actionHelper,
     ICodeWriterFactory codeWriterFactory,
     IResourceBuilderFactory resourceBuilderFactory)
 {
     _contextFactory         = contextFactory;
     _dialogHelper           = dialogHelper;
     _actionHelper           = actionHelper;
     _codeWriterFactory      = codeWriterFactory;
     _resourceBuilderFactory = resourceBuilderFactory;
     _buildCommand           = new DelegateCommand(BuildExecuted, BuildCanExecute);
     _cancelCommand          = new DelegateCommand(CancelExecuted);
     _chooseFolderCommand    = new DelegateCommand(ChooseFolderExecuted, ChooseFolderCanExecute);
     LoadFolder();
 }
        /// <summary>
        /// コンストラクター
        /// </summary>
        /// <param name="appModel">アプリケーションModelのインスタンス</param>
        /// <param name="dialogHelper">ダイアログHelperのインスタンス</param>
        public MainWindowViewModel(IAppModel appModel, IDialogHelper dialogHelper)
        {
            AppModel     = appModel;
            DialogHelper = dialogHelper;

            AppModel.LoadSettings();

            FromFolder = ReactiveProperty
                         .FromObject(AppModel, x => x.FromFolder)
                         .AddTo(Disposables);
            ToFolder = ReactiveProperty
                       .FromObject(AppModel, x => x.ToFolder)
                       .AddTo(Disposables);
            CreateFolderIfNotExist = ReactiveProperty
                                     .FromObject(AppModel, x => x.CreateFolderIfNotExist)
                                     .AddTo(Disposables);
            OverwriteIfExist = ReactiveProperty
                               .FromObject(AppModel, x => x.OverwriteIfExist)
                               .AddTo(Disposables);
            ClassifyAsDatas = ReactiveProperty
                              .FromObject(AppModel, x => x.ClassifyAsDatas)
                              .AddTo(Disposables);

            ButtonEnable = new ReactiveProperty <bool>(true);

            SelectFromFolderCommand = ButtonEnable
                                      .ToReactiveCommand()
                                      .WithSubscribe(_ => SelectFromFolderAction())
                                      .AddTo(Disposables);
            SelectToFolderCommand = ButtonEnable
                                    .ToReactiveCommand()
                                    .WithSubscribe(_ => SelectToFolderAction())
                                    .AddTo(Disposables);
            SaveSettingsCommand = ButtonEnable
                                  .ToAsyncReactiveCommand()
                                  .WithSubscribe(_ => SaveSettingsActionAsync())
                                  .AddTo(Disposables);
            ExecuteCommand = ButtonEnable
                             .ToAsyncReactiveCommand()
                             .WithSubscribe(_ => ExecuteActionAsync())
                             .AddTo(Disposables);
        }
Beispiel #8
0
        public FamilyIncomesDialog(IDialogHelper helper)
            : base(nameof(FamilyIncomesDialog))
        {
            this._helper = helper ?? throw new System.ArgumentNullException(nameof(helper));

            AddDialog(new TextPrompt(NAME_VALIDATION, NamePromptValidatorAsync));
            AddDialog(new TextPrompt(SOURCE_VALIDATION, SourcePromptValidatorAsync));
            AddDialog(new NumberPrompt <decimal>(MONTHLY_VALUE_VALIDATION, MonthlyIncomePromptValidatorAsync));
            AddDialog(new CustomConfirmPrompt(nameof(CustomConfirmPrompt)));

            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                AskForPersonsNameStepAsync,
                AskForPersonsSourceOfIncomeStepAsync,
                AskForPersonsMonthlyIncomeStepAsync,
                AskForAnotherIncomesStepAsync,
                FinalStepAsync,
            }));

            InitialDialogId = nameof(WaterfallDialog);
        }
Beispiel #9
0
        public UserSocioEconomicDialog(IDialogHelper helper)
            : base(nameof(UserSocioEconomicDialog))
        {
            this._helper = helper ?? throw new System.ArgumentNullException(nameof(helper));

            AddDialog(new NumberPrompt <decimal>(MONTHLY_INCOME_VALIDATION, MonthlyIncomePromptValidatorAsync));
            AddDialog(new CustomConfirmPrompt(nameof(CustomConfirmPrompt)));
            AddDialog(new FamilyIncomesDialog(helper));
            AddDialog(new CustomAdaptiveCardPrompt(nameof(CustomAdaptiveCardPrompt), FormPromptValidatorAsync));

            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                AskForMonthlyIncomeStepAsync,
                AskForFamilyIncomesStepAsync,
                SkipOrStartFamilyIncomesDialogStepAsync,
                AskForMonthlyExpensesStepAsync,
                StartMonthlyExpensesDialogStepAsync,
                FinalStepAsync,
            }));

            InitialDialogId = nameof(WaterfallDialog);
        }
Beispiel #10
0
        public UserCompanyDialog(
            IDialogHelper helper,
            ICompanyRegistryManager companyRegistryManager)
            : base(nameof(UserCompanyDialog))
        {
            this._helper = helper ?? throw new System.ArgumentNullException(nameof(helper));
            this._companyRegistryManager = companyRegistryManager ?? throw new System.ArgumentNullException(nameof(companyRegistryManager));

            AddDialog(new TextPrompt(CNPJ_VALIDATION, CnpjPromptValidatorAsync));
            AddDialog(new CustomAdaptiveCardPrompt(nameof(CustomAdaptiveCardPrompt), FormPromptValidatorAsync));
            AddDialog(new UserSocioEconomicDialog(helper));

            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                AskForTaxIdentificationNumberStepAsync,
                AskForCheckingCompanyDetailsStepAsync,
                StartUserSocioEconomicDialogStepAsync,
                FinalStepAsync,
            }));

            InitialDialogId = nameof(WaterfallDialog);
        }
        public HomePageViewModel(IDialogHelper dialogHelper, INavigationService navigationService)
        {
            InsertContactCommand = new DelegateCommand(OnInsertContactClicked);

            UpdateContactCommand = new DelegateCommand(OnUpdateContactClicked);

            BrowsePictureCommand = new DelegateCommand(OnBrowsePictureClicked);

            BrowseAudioCommand = new DelegateCommand(OnBrowseAudioClicked);

            AudioBackCommand = new DelegateCommand(() => { });

            AudioForwardCommand = new DelegateCommand(() => { });

            AudioResumePauseCommand = new DelegateCommand(OnResumePauseAudio);

            AudioStopCommand = new DelegateCommand(() => { });

            CloseImageViewerCommand = new DelegateCommand(() => { IsShowImageViewer = false; });

            LeftArrowClickedCommand = new DelegateCommand(() => { OnChangeImage(true); });

            RightArrowClickedCommand = new DelegateCommand(() => { OnChangeImage(false); });

            this.navigationService = navigationService;

            this.dialogHelper = dialogHelper;

            RefreshContacts();

            RefreshPictures();

            RefreshAudios();

            AudioPlayStateIcon = "/Assets/AudioPlay.png";
        }
Beispiel #12
0
 public ExceptionInterceptor(IDialogHelper dialogHelper)
 {
     _dialogHelper = dialogHelper;
 }
Beispiel #13
0
 public MainPresenter(IMainView viewArg, IMainDBHelper mainDBHelper, IDialogHelper dialogHelper)
 {
     view              = viewArg;
     dbHelper          = mainDBHelper;
     this.dialogHelper = dialogHelper;
 }
 /// <summary>
 /// Injection of dialog helper
 /// </summary>
 public PersonContentDialogViewModel(IDialogHelper dialog = null, IRepositoryService <Person> repositoryService = null)
 {
     _dialog            = dialog;
     _repositoryService = repositoryService;
 }
        public RegisterPageViewModel(IDialogHelper dialogHelper)
        {
            RegisterCommand = new DelegateCommand(OnRegisterClicked);

            this.dialogHelper = dialogHelper;
        }
 public static async Task <bool> ShowOkPopup(this IDialogHelper dialog)
 {
     return(await dialog.ShowPopup(() => new OkPopup()));
 }
Beispiel #17
0
 public static void SetDialgHelper(IDialogHelper helper)
 {
     instance = helper;
 }
Beispiel #18
0
 public FavoritePageViewModel(IRepositoryService <Person> repositoryService, IDialogHelper dialog)
 {
     _repositoryService = repositoryService;
     _dialog            = dialog;
 }
Beispiel #19
0
    public MainViewModel()
    {
      m_window = new MainWindow {DataContext = this};
      m_layoutManager = new LayoutManager(this);

      m_tabTrees = Enum.GetValues(typeof(TabTrees)).Cast<TabTrees>().ToList();
      m_closeFileCommand = new GenericManualCommand<IFileViewModel>(CloseFile);
      m_saveFileCommand = new ManualCommand(Save, () => LayoutManager.ActiveLayoutElement != null && LayoutManager.ActiveLayoutElement.SelectedFile != null && LayoutManager.ActiveLayoutElement.SelectedFile.HasUnsavedChanges);
      m_saveAllFilesCommand = new ManualCommand(SaveAll, () => LayoutManager.LayoutElements.Any(layout => layout.OpenFiles.Any(n => n.HasUnsavedChanges)));
      m_openFileViewModelCommand = new GenericManualCommand<IFileViewModel>(file => OpenFile(file));
      m_openFileCommand = new ManualCommand(OpenFile);
      m_openFolderCommand = new ManualCommand(OpenFolder);
      m_exitCommand = new ManualCommand(() => Environment.Exit(0));
      m_newFileCommand = new ManualCommand(CreateNewFile);
      m_changeSettingsPathCommand = new ManualCommand(ChangeSettingsPath);
      m_renameSelectedNodeCommand = new ManualCommand(() => m_selectedNode.IsRenaming = true);
      m_renameSelectedNodeDoneCommand = new ManualCommand(() => m_selectedNode.IsRenaming = false);
      m_renameSelectedNodeCancelCommand = new ManualCommand(() => { m_selectedNode.RenameString = null; m_selectedNode.IsRenaming = false; });
      m_createFileCommand = new GenericManualCommand<string>(s => CreateNewFileAtSelectedNode(s));
      m_reloadFilesDialogViewModel = new ReloadFilesDialogViewModel();
      m_createFolderCommand = new ManualCommand(() => CreateFolder("Newfolder"));
      m_deleteSelectedNodeCommand = new ManualCommand(DeleteSelectedNode);

      m_dialogHelper = new DialogHelper(this);
      ServiceProvider.Registre<IDialogHelper>(DialogHelper);

      if (string.IsNullOrEmpty(Properties.Settings.Default.SettingPath) ||
          !Directory.Exists(Properties.Settings.Default.SettingPath))
      {
        m_folderBrowserDialogViewModel = new FolderBrowserDialogViewModel();
        m_folderBrowserDialogViewModel.PropertyChanged += StartFolderBrowserDialogViewModelOnPropertyChanged;
        m_folderBrowserDialogViewModel.Title = "Select settings path";
        m_folderBrowserDialogViewModel.Path = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\sharpE\\settings";
        DialogHelper.ShowDialog(m_folderBrowserDialogViewModel);
      }
      else
      {
        Init();
      }
    }
Beispiel #20
0
 public DialogAndWelcomeBot(IDialogHelper dialogHelper, T dialog,
                            ILogger <DialogBot <T> > logger)
     : base(dialogHelper, dialog, logger)
 {
 }