Ejemplo n.º 1
0
 private void ValueNumberBox_ValueChanged(Microsoft.UI.Xaml.Controls.NumberBox sender, Microsoft.UI.Xaml.Controls.NumberBoxValueChangedEventArgs args)
 {
     if ((int)args.NewValue >= -1)
     {
         DynamicInfoBadge.Value = (int)args.NewValue;
     }
 }
        private void NumberBox_ValueChanged(Microsoft.UI.Xaml.Controls.NumberBox sender, Microsoft.UI.Xaml.Controls.NumberBoxValueChangedEventArgs args)
        {
            if (StyledGridIWG == null)
            {
                return;
            }

            // Only update either max-row value or margins
            if (sender == WrapItemCount)
            {
                StyledGridIWG.MaximumRowsOrColumns = (int)WrapItemCount.Value;
                return;
            }

            int rowSpace    = (int)RowSpace.Value;
            int columnSpace = (int)ColumnSpace.Value;

            for (int i = 0; i < StyledGrid.Items.Count; i++)
            {
                GridViewItem item = StyledGrid.ContainerFromIndex(i) as GridViewItem;

                Thickness NewMargin = item.Margin;
                NewMargin.Left   = columnSpace;
                NewMargin.Top    = rowSpace;
                NewMargin.Right  = columnSpace;
                NewMargin.Bottom = rowSpace;

                item.Margin = NewMargin;
            }
        }
Ejemplo n.º 3
0
        private void SelectedPitchCount_ValueChanged(Microsoft.UI.Xaml.Controls.NumberBox sender, Microsoft.UI.Xaml.Controls.NumberBoxValueChangedEventArgs args)
        {
            if (args.NewValue == this.Lanes.Children.Count)
            {
                return;
            }

            if (args.NewValue > args.OldValue)
            {
                for (var currentAdd = 0; currentAdd < args.NewValue - args.OldValue; currentAdd++)
                {
#pragma warning disable CA2000 // Dispose objects before losing scope
                    var lane = new LaneSetupControl(this.AvailableSymbols, this.AvailableNotes, this.AvailableKeys);
#pragma warning restore CA2000 // Dispose objects before losing scope
                    lane.PropertyChanged += this.Lane_PropertyChanged;
                    this.Lanes.Children.Add(lane);
                }
            }

            if (args.NewValue < args.OldValue)
            {
                for (var currentAdd = 0; currentAdd < args.OldValue - args.NewValue; currentAdd++)
                {
                    ((LaneSetupControl)this.Lanes.Children[this.Lanes.Children.Count - 1]).Dispose();
                    this.Lanes.Children.RemoveAt(this.Lanes.Children.Count - 1);
                }
            }
        }
Ejemplo n.º 4
0
 private void TB_Valor_ValueChanged(Microsoft.UI.Xaml.Controls.NumberBox sender, Microsoft.UI.Xaml.Controls.NumberBoxValueChangedEventArgs args)
 {
     TransFormDataValidation();
     if (lastpressed == VirtualKey.Enter)
     {
         ProcessTransaction();
     }
 }
Ejemplo n.º 5
0
        private void NumberBoxPageNumber_ValueChanged(Microsoft.UI.Xaml.Controls.NumberBox sender, Microsoft.UI.Xaml.Controls.NumberBoxValueChangedEventArgs args)
        {
            if (ignoreEvent)
            {
                return;
            }

            GoToPage(Convert.ToUInt32(args.NewValue));
        }
 private void Size_ValueChanged(Microsoft.UI.Xaml.Controls.NumberBox sender, Microsoft.UI.Xaml.Controls.NumberBoxValueChangedEventArgs args)
 {
     if (icon == null)
     {
         return;
     }
     CustomIconCode.Code = SampleTemplateProvider.GetXAMLCustomizedFontIconCode(icon.StringGlyph
                                                                                , FontIconColorPicker.Color.ToString()
                                                                                , ((int)CustomIconFontSize.Value).ToString());
 }
 private void ProgressValue_ValueChanged(Microsoft.UI.Xaml.Controls.NumberBox sender, Microsoft.UI.Xaml.Controls.NumberBoxValueChangedEventArgs args)
 {
     if (!sender.Value.IsNaN())
     {
         ProgressRing2.Value = sender.Value;
     }
     else
     {
         sender.Value = 0;
     }
 }
Ejemplo n.º 8
0
 private void maxLimitNumberBox_ValueChanged(Microsoft.UI.Xaml.Controls.NumberBox sender, Microsoft.UI.Xaml.Controls.NumberBoxValueChangedEventArgs args)
 {
     if (Double.IsNaN(sender.Value))
     {
         ViewModel.NewColumnMax = 0;
     }
     else
     {
         ViewModel.NewColumnMax = Convert.ToInt32(sender.Value);
     }
 }
Ejemplo n.º 9
0
 private void MarginLeftNumberBox_ValueChanged(Microsoft.UI.Xaml.Controls.NumberBox sender, Microsoft.UI.Xaml.Controls.NumberBoxValueChangedEventArgs args)
 {
     debounceDispatcher.Debounce(() =>
     {
         DispatcherHelper.CheckBeginInvokeOnUI(async() =>
         {
             ValueSet message = new ValueSet();
             message.Add("margin_left_set", args.NewValue);
             await App.Connection.SendMessageAsync(message);
         });
     });
 }
Ejemplo n.º 10
0
 private void ProgressValue_ValueChanged(Microsoft.UI.Xaml.Controls.NumberBox sender, Microsoft.UI.Xaml.Controls.NumberBoxValueChangedEventArgs args)
 {
     // Value might be NaN, which is not valid as value, thus we need to handle changes ourselves
     if (!sender.Value.IsNaN())
     {
         ProgressBar2.Value = sender.Value;
     }
     else
     {
         sender.Value = 0;
     }
 }
Ejemplo n.º 11
0
 private void FontSizeNumberBox_ValueChanged(Microsoft.UI.Xaml.Controls.NumberBox sender, Microsoft.UI.Xaml.Controls.NumberBoxValueChangedEventArgs args)
 {
     // Ensure that if user clears the NumberBox, we don't pass 0 or null as fontsize
     if (sender.Value >= sender.Minimum)
     {
         FontSizeChangingTextBlock.FontSize = sender.Value;
     }
     else
     {
         // We fell below minimum, so lets restore a correct value
         sender.Value = sender.Minimum;
     }
 }
Ejemplo n.º 12
0
 private void NumberBox_ValueChanged(Microsoft.UI.Xaml.Controls.NumberBox sender, Microsoft.UI.Xaml.Controls.NumberBoxValueChangedEventArgs args)
 {
     Debug.WriteLine($"Value changed to {sender.Value}");
     vm.Amount = (int)sender.Value;
 }
Ejemplo n.º 13
0
 private void ProjectCardSize_ValueChanged(Microsoft.UI.Xaml.Controls.NumberBox sender, Microsoft.UI.Xaml.Controls.NumberBoxValueChangedEventArgs args)
 {
     SettingsManager.SetProjectCardSize(new Point(ProjectCardWidth.Value, ProjectCardHeight.Value));
 }
Ejemplo n.º 14
0
 private void ProgressValue_ValueChanged(Microsoft.UI.Xaml.Controls.NumberBox sender, Microsoft.UI.Xaml.Controls.NumberBoxValueChangedEventArgs args)
 {
 }
Ejemplo n.º 15
0
 private void Number_ValueChanged(Microsoft.UI.Xaml.Controls.NumberBox sender, Microsoft.UI.Xaml.Controls.NumberBoxValueChangedEventArgs args)
 {
     IsPrimaryButtonEnabled = args.NewValue >= 0 && args.NewValue <= Maximum;
 }
Ejemplo n.º 16
0
 private void NumberBoxSecond_ValueChanged(Microsoft.UI.Xaml.Controls.NumberBox sender, Microsoft.UI.Xaml.Controls.NumberBoxValueChangedEventArgs args) => UpdateTime();