예제 #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;
     }
 }
예제 #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();
            }
        }
예제 #3
0
        /// <summary>
        /// Initializes a new MainViewModel instance.
        /// </summary>
        public MainViewModel()
        {
            _exampleStrategyProvider = new ExampleStrategyProvider();

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

            FetchExisting();
        }
예제 #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);
        }
예제 #6
0
 public virtual void SetMode(DataEntryMode mode)
 {
     _Mode = mode;
 }