private void OnApplicationUnlocked(ApplicationUnlocked obj) { if (SelectedMenuItem == null) { SelectedItemChangedCommand.Execute(Notebooks.FirstOrDefault()); } }
public ExceptionViewerViewModel(List <Exception> errors, List <Exception> warnings) { _errors = errors; _warnings = warnings; SelectedItemChangedCommand = new SelectedItemChangedCommand(SelectedItemChanged, CanSelectItem); BuildExceptionTree(); }
public override async Task Initialize() { await base.Initialize().ConfigureAwait(true); SelectedPayment.ChargedAccount = ChargedAccounts.FirstOrDefault(); if (SelectedPayment.IsTransfer) { SelectedItemChangedCommand.Execute(); SelectedPayment.TargetAccount = TargetAccounts.FirstOrDefault(); } }
protected override async Task Initialize() { Title = PaymentTypeHelper.GetViewTitleForType(PaymentType, false); SelectedPayment.Type = PaymentType; await base.Initialize(); SelectedPayment.ChargedAccount = ChargedAccounts.FirstOrDefault(); if (SelectedPayment.IsTransfer) { SelectedItemChangedCommand.Execute(null); SelectedPayment.TargetAccount = TargetAccounts.FirstOrDefault(); } }
private void OnSelectedItemChangedCommand(object newValue) { if (SelectedItemChangedCommand != null && SelectedItemChangedCommand.CanExecute(newValue)) { SelectedItemChangedCommand.Execute(newValue); } if (_selfSelectedElement) { return; } _selfSelectedElement = true; SelectedElement = newValue; _selfSelectedElement = false; }
void UpdateSelected(object selected, EventArgs e) { foreach (var item in this.Children) { if (item is RadioButton) (item as RadioButton).IsChecked = item == selected; } SetValue(SelectedItemProperty, this.SelectedItem); OnPropertyChanged(nameof(SelectedItem)); SetValue(SelectedIndexProperty, this.SelectedIndex); OnPropertyChanged(nameof(SelectedIndex)); SelectedItemChanged?.Invoke(this, new EventArgs()); if (SelectedItemChangedCommand?.CanExecute(CommandParameter ?? this) ?? false) SelectedItemChangedCommand?.Execute(CommandParameter ?? this); ValidationChanged?.Invoke(this, new EventArgs()); }
private void OnScrolledInternal(bool initial = false) { var index = (int)Math.Round(SlideProperties.Position); if (index != m_lastIndex && SelectedItemChangedCommand != null) { if (!initial) { Vibrate(); } SelectedItemChangedCommand?.Execute(index); m_lastIndex = index; } OnScrolled(SlideProperties.Position); }
private void SelectedItemChangedHandler(object selectedItem) { if (m_autocompleteItemsControl != null) { m_autocompleteItemsControl.ItemsSource = null; } UpdateClearButtonVisibility(); SelectedItemChangedEventArgs eventArgs = new SelectedItemChangedEventArgs(SelectedItemChangedEvent, this, selectedItem); RaiseEvent(eventArgs); if (SelectedItemChangedCommand != null && SelectedItemChangedCommand.CanExecute(selectedItem)) { SelectedItemChangedCommand.Execute(selectedItem); } }
private void LongListSelector_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (SelectedItem == null) { return; } if (SelectedItemChangedCommand == null) { return; } if (!SelectedItemChangedCommand.CanExecute(null)) { return; } SelectedItemChangedCommand.Execute(SelectedItem); SelectedItem = null; }