private void OnApplicationUnlocked(ApplicationUnlocked obj)
 {
     if (SelectedMenuItem == null)
     {
         SelectedItemChangedCommand.Execute(Notebooks.FirstOrDefault());
     }
 }
Exemple #2
0
        public ExceptionViewerViewModel(List <Exception> errors, List <Exception> warnings)
        {
            _errors   = errors;
            _warnings = warnings;

            SelectedItemChangedCommand = new SelectedItemChangedCommand(SelectedItemChanged, CanSelectItem);

            BuildExceptionTree();
        }
Exemple #3
0
        public override async Task Initialize()
        {
            await base.Initialize().ConfigureAwait(true);

            SelectedPayment.ChargedAccount = ChargedAccounts.FirstOrDefault();

            if (SelectedPayment.IsTransfer)
            {
                SelectedItemChangedCommand.Execute();
                SelectedPayment.TargetAccount = TargetAccounts.FirstOrDefault();
            }
        }
Exemple #4
0
        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;
        }
Exemple #6
0
        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());
        }
Exemple #7
0
        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);
        }
Exemple #8
0
        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);
            }
        }
Exemple #9
0
        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;
        }