Exemplo n.º 1
0
 /// <summary>
 /// Updates the data entry mode for all control view models.
 /// </summary>
 /// <param name="dataEntryMode">New DataEntryMode.</param>
 public void UpdateDataEntryMode(DataEntryMode dataEntryMode)
 {
     foreach (ControlViewModel cvm in Controls)
     {
         cvm.DataEntryMode = dataEntryMode;
     }
 }
Exemplo n.º 2
0
        public JournalDialog(WorkItem workItem, JournalEntry entry, DataEntryMode mode)
        {
            _workItem = workItem;

            if (entry != null)
            {
                Entry = entry;
            }

            DialogMode = mode;
            InitializeComponent();
            DataContext = this;

            // Dodgy implementation; should be binding
            if ((mode == DataEntryMode.EDIT) || (mode == DataEntryMode.DELETE))
            {
                JournalHeaderTextBox.Text = entry.Title;
                JournalEntryTextBox.Text  = entry.Entry;
            }

            if (mode == DataEntryMode.ADD)
            {
                JournalHeaderTextBox.Focus();
            }
            else if (mode == DataEntryMode.EDIT)
            {
                JournalEntryTextBox.Focus();
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new MainViewModel instance.
        /// </summary>
        public MainViewModel()
        {
            _exampleStrategyProvider = new ExampleStrategyProvider();

            // Set Create mode as the default
            _dataEntryMode = DataEntryMode.Create;
        }
Exemplo n.º 4
0
        public UserViewModel(DataEntryMode mode, User user,
                             Window activeWindow, Action exitAction)
        {
            _Mode         = mode;
            _User         = user;
            _ActiveWindow = activeWindow;
            _ExitAction   = exitAction;

            FetchExisting();
        }
Exemplo n.º 5
0
        /// <summary>
        /// Set the mode the Application is in.
        /// </summary>
        /// <param name="newMode"></param>
        public void SetApplicationMode(DataEntryMode newMode)
        {
            DataEntryMode oldMode = _appMode;

            _appMode = newMode;
            OnPropertyChanged("");
            var eventArgs = new AppEventArgs(AppAction.SET_APPLICATION_MODE, oldMode, newMode);

            appEvent?.Invoke(this, eventArgs);
        }
Exemplo n.º 6
0
 public virtual void SetMode(DataEntryMode mode)
 {
     _Mode = mode;
 }