Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainVM"/> class.
        /// </summary>
        /// <param name="logic">MainLogic itself.</param>
        public MainVM(IMainLogic logic)
        {
            this.logic = logic;

            this.LoadCmd = new RelayCommand(() => this.AllUsers = new ObservableCollection <UserVM>(
                                                this.logic.ApiGetUsers()));
            this.DelCmd  = new RelayCommand(() => this.logic.ApiDelUser(this.selectedUser));
            this.AddCmd  = new RelayCommand(() => this.logic.EditUser(null, this.EditorFunc));
            this.EditCmd = new RelayCommand(() => this.logic.EditUser(this.selectedUser, this.EditorFunc));
        }
Exemple #2
0
 public FormMain(IMainLogic mainLogic)
 {
     InitializeComponent();
     this.mainLogic = mainLogic;
 }