Exemple #1
0
        public PopupTextInput(ExpenditureAppViewModels.ExpenditureAppInputViewModel viewModel, string title, string tagType, ICommand addCommand)
        {
            InitializeComponent();
            this.viewModel = viewModel;
            DataContext    = viewModel;
            Title          = title;
            instruction    = "Please write your new " + tagType + " and click add or press enter";
            label.Content  = instruction;
            AddBtn.Command = addCommand;

            CancelBtn.Click += (s, e) => Close();
            AddBtn.Click    += (s, e) => CheckIfClose();
            TextBox.KeyUp   += (s, e) => CheckIfEnter(e);
        }
Exemple #2
0
        public ExpenditureApp()
        {
            InitializeComponent();

            Action <string, string>     messageForUser  = ((message, caption) => System.Windows.MessageBox.Show(message, caption));
            Func <string, string, bool> decisionForUser = (message, caption) => System.Windows.MessageBox.Show(message, caption, MessageBoxButton.YesNo) == MessageBoxResult.Yes;
            Func <string> selectFileLocation            = () => SelectFileLocation();

            dataRecorderFactory          = new ExpenditureDataRecorderFactory(selectFileLocation, messageForUser);
            dataProviderFactory          = new ExpenditureDataProviderFactory(selectFileLocation, messageForUser);
            inputViewModel               = new ExpenditureAppViewModels.ExpenditureAppInputViewModel(messageForUser, decisionForUser, dataRecorderFactory, dataProviderFactory);
            inputViewModel               = new ExpenditureAppViewModels.ExpenditureAppInputViewModel(messageForUser, decisionForUser, dataRecorderFactory, dataProviderFactory);
            inputUserControl.DataContext = inputViewModel;
            //DataContext = viewModel;

            SetupInputUserControlDelegates();

            outputModeCombo.MouseEnter += (s, e) => OnOutputModeChanged();

            inputViewModel.exceptionEventHandler += (s, e) => OnViewModelException(e.exception);
        }