Beispiel #1
0
 protected async override void OnExecute(object parameter)
 {
     if (parameter is UserBrowserViewModel browser && browser.SelectedItem is IUserCategoryDescriptor descriptor)
     {
         await UserCategoryUtility.NewUserAsync(this.authenticator, descriptor);
     }
 }
Beispiel #2
0
 protected override bool OnCanExecute(object parameter)
 {
     if (parameter is UserBrowserViewModel browser && browser.SelectedItem is IUserCategoryDescriptor descriptor)
     {
         return(UserCategoryUtility.CanNewUser(this.authenticator, descriptor));
     }
     return(false);
 }
Beispiel #3
0
 public async Task MoveAsync()
 {
     if (await UserCategoryUtility.MoveAsync(this.authentication, this.descriptor) == true)
     {
         await this.Dispatcher.InvokeAsync(() =>
         {
             this.Parent.IsExpanded = true;
             this.IsSelected        = true;
         });
     }
 }
Beispiel #4
0
 public async Task NewFolderAsync()
 {
     if (await UserCategoryUtility.NewFolderAsync(this.authentication, this.descriptor) is string categoryName)
     {
         await this.Dispatcher.InvokeAsync(() =>
         {
             var viewModel        = this.Items.First(item => item.DisplayName == categoryName);
             this.IsExpanded      = true;
             viewModel.IsSelected = true;
         });
     }
 }
Beispiel #5
0
 public async Task DeleteAsync()
 {
     await UserCategoryUtility.DeleteAsync(this.authentication, this.descriptor);
 }