Ejemplo n.º 1
0
 private void OnApplicationUnlocked(ApplicationUnlocked obj)
 {
     if (SelectedMenuItem == null)
     {
         SelectedItemChangedCommand.Execute(Notebooks.FirstOrDefault());
     }
 }
Ejemplo n.º 2
0
        public override async Task Initialize()
        {
            await base.Initialize().ConfigureAwait(true);

            SelectedPayment.ChargedAccount = ChargedAccounts.FirstOrDefault();

            if (SelectedPayment.IsTransfer)
            {
                SelectedItemChangedCommand.Execute();
                SelectedPayment.TargetAccount = TargetAccounts.FirstOrDefault();
            }
        }
Ejemplo n.º 3
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;
        }
Ejemplo n.º 5
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());
        }
Ejemplo n.º 6
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);
        }
Ejemplo n.º 7
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);
            }
        }
Ejemplo n.º 8
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;
        }