コード例 #1
0
 public void RemoveChoice(string choice)
 {
     Choices.Remove(choice);
     if (descriptions.ContainsKey(choice))
     {
         descriptions.Remove(choice);
     }
 }
コード例 #2
0
 /// <summary>
 /// Remove choice from list
 /// </summary>
 /// <param name="chcToDelete"></param>
 public void DeleteChoice(Choice chcToDelete)
 {
     if (Choices != null)
     {
         // Remove by instance
         Choices.Remove(chcToDelete);
     }
 }
コード例 #3
0
 private void AddChoice(object obj)
 {
     if (!string.IsNullOrEmpty(ChoiceItem) && !Selected.Contains(ChoiceItem))
     {
         Selected.Add(ChoiceItem);
         Selected = new ObservableCollection <string>(Selected.OrderBy(s => s));
         Choices.Remove(ChoiceItem);
     }
     ToggleActivatation();
 }
コード例 #4
0
        public async void ExecuteDeleteChoiceCommand()
        {
            var vs = (StringViewModel)Choices?.CurrentItem;

            if ((await DialogService.Ask("Delete Choice?", $"Delete choice \"{vs?.Value}?\"", AskButton.OKCancel)) ==
                AskResult.OK)
            {
                Choices?.Remove(Choices.CurrentItem);
                _choicesChanged = true;
                OkCommand.RaiseCanExecuteChanged();
            }
        }
コード例 #5
0
 public UIRadioButtonContainer()
 {
     OnChildAdded += (source, e) =>
     {
         if (e.Target is UIRadioButton radio)
         {
             Choices.Add(radio);
             radio.OnValueChanged += SelectChange;
         }
     };
     OnChildRemoved += (source, e) =>
     {
         if (e.Target is UIRadioButton radio)
         {
             Choices.Remove(radio);
         }
     };
 }
コード例 #6
0
 private void Configuration_PropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName == nameof(Configuration.BrowserList))
     {
         var added = Configuration.BrowserList.Where(b => Choices.All(c => c.Model.Name != b.Name)).ToList();
         if (added.Count > 0)
         {
             foreach (var vm in added.Select(m => new BrowserViewModel(m, this)))
             {
                 Choices.Add(vm);
             }
         }
         var removed = Choices.Where(c => Configuration.BrowserList.All(b => b.Name != c.Model.Name)).ToList();
         if (removed.Count > 0)
         {
             foreach (var m in removed)
             {
                 Choices.Remove(m);
             }
         }
     }
 }
コード例 #7
0
 public void OnPostRemoveChoice(String Value)
 {
     Choices.Remove(Value);
 }
コード例 #8
0
ファイル: Character.cs プロジェクト: 1o0oP/ConsoleLoopSystem
 public void RemoveChoice(Choice choice)
 {
     Choices.Remove(choice);
 }
コード例 #9
0
        public RadioEditorViewModel(IEditorViewModelFactory editorFactory)
        {
            _editorFactory = editorFactory;

            Title = "RadioButton Control";

            AddChoiceCommand    = new DelegateCommand(AddChoice, () => true);
            RemoveChoiceCommand = new DelegateCommand <ChoiceEditorViewModel>(choice => Choices.Remove(choice), choice => Choices.IndexOf(choice) > 0);

            Choices.CollectionChanged += (sender, args) => OnUpdateSnippet();

            AddChoice();
        }
コード例 #10
0
 public void RemoveChoice(Choice choice)
 {
     Choices.Remove(choice);
     OnChoicesUpdated();
 }