Esempio n. 1
0
 private void RegisterCommands()
 {
     CloseCommand = new DelegateCommand(() =>
     {
         MainWindowViewModel.Value.DisplayInformationPane = false;
     });
     DeleteTagEntryCommand = new DelegateCommand(() =>
     {
         var items = TagListBoxSelectedItems;
         foreach (var item in items)
         {
             TagManager.RemoveImageTag(item.Name);
         }
     });
     DropTagCommand = new DelegateCommand <DragEventArgs>(data =>
     {
         var d             = data.Data;
         var imageTagCount = (TagCountViewModel)d.GetData(typeof(TagCountViewModel));
         try
         {
             TagManager.AddImageTagToSelectedObject(imageTagCount.Tag.Name);
         }
         catch (ArgumentException)
         {
             SystemSounds.Beep.Play();
         }
     });
     TagPlusCommand = new DelegateCommand <string>(async text =>
     {
         await TagManager.AddImageTagToSelectedObject(text);
     });
     TagMinusCommand = new DelegateCommand(() =>
     {
         var items = TagListBoxSelectedItems;
         foreach (var item in items)
         {
             TagManager.RemoveImageTag(item.Name);
         }
     });
 }