public StaffAccountCreator() { ClearCommand = new RelayCommand(Clear); CreateCommand = new RelayAsyncCommand(Create); PrintCommand = new RelayAsyncCommand(Print); Clear(); }
public StaffOverview() { state = State.App.Instance.Linked; ClearFilterCommand = new RelayCommand(clearFilter); DoAccountActionCommand = new RelayAsyncCommand <AccountAction>(doAccountAction); ViewDetailsActionCommand = new RelayAsyncCommand <AccountAction>(viewDetailsAction); updateList(); }
public SmartschoolAccounts() { state = State.App.Instance.Smartschool; state.AddObserver(this); ReloadCommand = new RelayAsyncCommand(ReloadAccounts); SetTargetCommand = new RelayCommand <string>(SetTarget); updateSelection(); }
public WisaAccounts() { state = State.App.Instance.Wisa; state.AddObserver(this); ReloadCommand = new RelayAsyncCommand(ReloadAccounts); ClearFilterCommand = new RelayCommand(ClearFilter); updateSelection(); }
public ADAccounts() { state = State.App.Instance.AD; state.AddObserver(this); ReloadCommand = new RelayAsyncCommand(ReloadAccounts); SetTargetCommand = new RelayCommand <string>(SetTarget); ClearFilterCommand = new RelayCommand(ClearFilter); updateSelection(); }
public StaffAccountEditor(AccountApi.Directory.Account account) { SetAccount(account); DeleteCommand = new RelayAsyncCommand(DeleteAccount); SaveCommand = new RelayAsyncCommand(SaveAccount); CopyCodeCommand = new RelayAsyncCommand(CreateCopyCode); NewNetworkPasswordCommand = new RelayAsyncCommand(NewNetworkPassword); NewSmartschoolPasswordCommand = new RelayAsyncCommand(NewSmartschoolPassword); NewPasswordsCommand = new RelayAsyncCommand(NewPasswords); DeleteEnabled = account != null; }
public ClientManagerVM() { _view = new ClientManagerView(); _view.DataContext = this; Load(); LoadCommand = new RelayAsyncCommand(Load); AddCommand = new RelayCommand(Add); EditCommand = new RelayCommand(Edit); DeleteCommand = new RelayCommand(Delete); IsContactSelected = false; OnPropertyChanged("IsContactSelected"); }
public DashboardPage() { Wisa = State.App.Instance.Wisa; //Google = State.App.Instance.Google; AD = State.App.Instance.AD; Smartschool = State.App.Instance.Smartschool; Azure = State.App.Instance.Azure; Wisa.AddObserver(this); //Google.AddObserver(this); AD.AddObserver(this); Smartschool.AddObserver(this); Azure.AddObserver(this); SyncWisaGroupsCommand = new RelayAsyncCommand(SyncWisaGroups); SyncADGroupsCommand = new RelayAsyncCommand(SyncDirectoryGroups); SyncWisaAccountsCommand = new RelayAsyncCommand(SyncWisaAccounts); SyncADAccountsCommand = new RelayAsyncCommand(SyncDirectoryAccounts); SyncSmartschoolAccountsCommand = new RelayAsyncCommand(SyncSmartschoolAccounts); //SyncGoogleAccountsCommand = new RelayAsyncCommand(SyncGoogleAccounts); SyncAzureAccountsCommand = new RelayAsyncCommand(SyncAzureAccounts); }
//// =========================================================================================================== //// Constructors //// =========================================================================================================== /// <summary> /// Creates a new <see cref="LongRunningProcessProgressViewModel"/>. /// </summary> /// <param name="attachedStartCommand">The command to run when the start button is clicked.</param> /// <param name="timer">The timer to use. This is mainly for unit tests.</param> /// <param name="getNowFunc">A function that returns the current time. This is mainly for unit tests.</param> public LongRunningProcessProgressViewModel( IViewModelAsyncCommand attachedStartCommand, IDispatcherTimer?timer = null, Func <DateTime>?getNowFunc = null) { _timer = timer ?? new WrappedDispatcherTimer(); _timer.Interval = TimeSpan.FromMilliseconds(500); _timer.IsEnabled = false; _timer.Tick += OnTimerTick; _getNowFunc = getNowFunc ?? (() => DateTime.Now); // Create the start command and route events from the wrapped command to the exposed command. StartCommand = new RelayAsyncCommand( CreateStartCommandFunc(attachedStartCommand), attachedStartCommand.IsEnabled); attachedStartCommand.CanExecuteChanged += (sender, args) => StartCommand.IsEnabled = attachedStartCommand.IsEnabled; // Create the cancel command. CancelCommand = new RelayCommand(ExecuteCancelCommand, isEnabled: false); }