/// <summary> /// Standard Konstruktor. Öffnet das SettingsWindow und läd die Daten aus der Instance. /// </summary> public SettingsWindow() { InitializeComponent(); LoadData(); Show(); BindingGroup.BeginEdit(); }
private void treeViewFeeds_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e) { this.ViewModel.CurrentItem = e.NewValue as FeedViewModel; BindingGroup.BeginEdit(); IsEditing = false; }
/// <summary> /// Начало валидации /// </summary> public void BeginValidation(object parameter = null) { if (parameter is BindingGroup) { BindingGroup bindGroup = parameter as BindingGroup; bindGroup.BeginEdit(); } }
/// <summary> /// Сохранить измененные значения в BindingGroup /// </summary> public void SaveValidation(object parameter = null) { if (parameter is BindingGroup) { BindingGroup bindGroup = parameter as BindingGroup; if (bindGroup.CommitEdit()) { bindGroup.BeginEdit(); ReloadInfo(); } } }
/// <summary> /// Начало валидации /// </summary> public void BeginValidation(object parameter = null) { if (parameter is Rekod.Behaviors.CommandEventParameter) { Rekod.Behaviors.CommandEventParameter commEventPar = parameter as Rekod.Behaviors.CommandEventParameter; if (commEventPar.CommandParameter is BindingGroup) { BindingGroup bindGroup = commEventPar.CommandParameter as BindingGroup; bindGroup.BeginEdit(); } } }
//private SettingsWindow settingsWindow; /// <summary> /// Konstruktor für Account hinzufügen. Nimmt ein AccountListViewModel an. /// </summary> /// <param name="accountListViewModel"></param> public AccountWindow(AccountListViewModel accountListViewModel) { InitializeComponent(); Console.WriteLine("Account hinzufügen"); this.accountListViewModel = accountListViewModel; //this.settingsWindow = settingsWindow; Title = "Account hinzufügen"; DataContext = new AccountViewModel(); BindingGroup.BeginEdit(); shownameTextBox.Focus(); ShowDialog(); }
/// <summary> /// Konstruktor zum bearbeiten eines Accounts. Nimmt ein AccountViewModel an. Da er es zum braucht. /// </summary> /// <param name="selectedAccountToEdit"></param> public AccountWindow(AccountViewModel selectedAccountToEdit) { InitializeComponent(); Console.WriteLine("Account bearbeiten"); Title = "Account bearbeiten"; // Account als DataContext setzen DataContext = selectedAccountToEdit; // Passwort aus dem Account holen passwordBox.Password = selectedAccountToEdit.Password; BindingGroup.BeginEdit(); shownameTextBox.Focus(); ShowDialog(); }
private void SettingDialog_Loaded(object sender, RoutedEventArgs e) { // 見やすくするために、変数名を短縮する Settings settings = Settings.Default; // パスワード、プロキシパスワード PasswordBox.Password = settings.Password; ProxyPasswordBox.Password = settings.ProxyPassword; // キーボードショートカット設定 var array = Enum.GetValues(typeof(KeyAction)); keyBindings = new ObservableCollection <KeyBinding>(settings.KeyBindings ?? Enumerable.Empty <KeyBinding>()); foreach (KeyAction item in array) { if (keyBindings.SingleOrDefault(p => p.Action == item) == null) { keyBindings.Add(new KeyBinding { Action = item }); } } keyBindings.BeginEdit(); KeyMappingComboBox.SelectedItem = KeyMapping.KeyMappings.SingleOrDefault(p => p.Key == settings.KeyMapping); CommandComboBox.ItemsSource = keyBindings; // サウンド設定 soundBindings = new ObservableCollection <SoundBinding>(settings.SoundBindings); soundBindings.BeginEdit(); SoundListView.ItemsSource = soundBindings; // キーワード設定 keywordBindings = new ObservableCollection <KeywordBinding>(settings.KeywordBindings ?? Enumerable.Empty <KeywordBinding>()); keywordBindings.BeginEdit(); KeywordListView.ItemsSource = keywordBindings; //// カラー設定 //colorSchemes = new ObservableCollection<ColorScheme>(settings.ColorSchemes ?? Enumerable.Empty<ColorScheme>()); //colorSchemes.BeginEdit(); //ColorListView.ItemsSource = colorSchemes; // メッセージフッタ履歴 TweetFooterComboBox.ItemsSource = settings.TweetFooterHistory; BindingGroup.BeginEdit(); }
/// <summary> /// Отменить введенные значения /// </summary> public void CancelValidation(object parameter = null) { BindingGroup bindGroup = null; if (parameter is BindingGroup) { bindGroup = parameter as BindingGroup; } else if (parameter is CommandEventParameter) { CommandEventParameter commEvtParam = parameter as CommandEventParameter; if (commEvtParam.CommandParameter is BindingGroup) { bindGroup = commEvtParam.CommandParameter as BindingGroup; } } if (bindGroup != null) { bindGroup.CancelEdit(); bindGroup.BeginEdit(); } }
private void TimelineDialog_Loaded(object sender, RoutedEventArgs e) { if (Timeline == null) { Timeline = new Timeline { Type = TimelineType.User }; } filters = new ObservableCollection <Filter>(Timeline.Filters); FilterListView.ItemsSource = filters; filters.BeginEdit(); lists.ItemsSource = Lists; DataContext = Timeline; _title = Timeline.Name; BindingGroup.BeginEdit(); switch (Timeline.Type) { case TimelineType.User: filterRadio.IsChecked = true; break; case TimelineType.Search: searchRadio.IsChecked = true; search.Text = Timeline.Tag; break; case TimelineType.List: listRadio.IsChecked = true; lists.SelectedValue = Timeline.Tag; break; default: break; } }
private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { BindingGroup.BeginEdit(); IsEditing = false; }
private void SettingDialog_Loaded(object sender, RoutedEventArgs e) { BindingGroup.BeginEdit(); }