예제 #1
0
        private void CornerTyeChanged(object attachedObject)
        {
            var list = attachedObject as List <object>;

            Syncfusion.XForms.Buttons.SelectionChangedEventArgs selectionChangedEventArgs = list[0] as Syncfusion.XForms.Buttons.SelectionChangedEventArgs;
            if (selectionChangedEventArgs == null)
            {
                return;
            }

            var selectedIndex = selectionChangedEventArgs.Index;

            switch (selectedIndex)
            {
            case 0:
                this.LeftCornerRadius  = this.currentRadius;
                this.RightCornerRadius = this.currentRadius;
                break;

            case 1:
                this.LeftCornerRadius  = this.currentRadius;
                this.RightCornerRadius = 0;
                break;

            case 2:
                this.LeftCornerRadius  = 0;
                this.RightCornerRadius = this.currentRadius;
                break;
            }
        }
예제 #2
0
 private async void SegmentedControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (e.Index == 2)
     {
         await Navigation.PopAsync();
     }
 }
 private void SegmentedControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (e.Index == 3)
     {
         App.Current.MainPage = new NavigationPage(new SemiAutomatic());
     }
 }
예제 #4
0
        /// <summary>
        /// Handles the selection changed.
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">E.</param>
        private void Handle_SelectionChanged(object sender, Syncfusion.XForms.Buttons.SelectionChangedEventArgs e)
        {
            if (allowSelectionChanged)
            {
                return;
            }
            this.UpdateSegmentColor(e.Index);
            {
                if (e.Index == 1 && oldIndex == 2)
                {
                    allowSelectionChanged         = true;
                    this.MainSwitch.SelectedIndex = 0;
                    this.UpdateSegmentColor(0);
                }
                else if (e.Index == 1 && oldIndex == 0)
                {
                    allowSelectionChanged         = true;
                    this.MainSwitch.SelectedIndex = 2;
                    this.UpdateSegmentColor(2);
                }
                else
                {
                    allowSelectionChanged = false;
                }
            }

            oldIndex = this.MainSwitch.SelectedIndex;
        }
예제 #5
0
 private void Color_SelectionChanged(object sender, Syncfusion.XForms.Buttons.SelectionChangedEventArgs e)
 {
     if (colorsView.SelectedIndex >= 0)
     {
         PrimaryColorChanged(colorsView.SelectedIndex);
     }
 }
예제 #6
0
        private void ExpandModeChanged(object attachedObject)
        {
            var list = attachedObject as List <object>;

            Syncfusion.XForms.Buttons.SelectionChangedEventArgs selectionChangedEventArgs = list[0] as Syncfusion.XForms.Buttons.SelectionChangedEventArgs;
            var backdrop = list[1] as SfBackdropPage;

            if (selectionChangedEventArgs == null || backdrop == null)
            {
                return;
            }

            var selectedIndex = selectionChangedEventArgs.Index;

            switch (selectedIndex)
            {
            case 0:
                backdrop.BackLayerRevealOption = RevealOption.Auto;
                break;

            case 1:
                backdrop.BackLayerRevealOption = RevealOption.Fill;
                break;
            }
        }
 private void buySellsegmentButton_SelectionChanged(object sender, Syncfusion.XForms.Buttons.SelectionChangedEventArgs e)
 {
     if (e.Index == 0)
     {
         ButtonSwitched?.Invoke(sender, new RankTypeEventArgs(RankType.OverBuy));
     }
     else if (e.Index == 1)
     {
         ButtonSwitched?.Invoke(sender, new RankTypeEventArgs(RankType.OverSell));
     }
 }
 private void InfectionSegment_SelectionChanged(object sender, Syncfusion.XForms.Buttons.SelectionChangedEventArgs e)
 {
     if (e.Index == 0)
     {
         vm.CowInfected = true;
     }
     else
     {
         vm.CowInfected = false;
     }
 }
예제 #9
0
        /// <summary>
        /// Invoked when selection is changed.
        /// </summary>
        /// <param name="sender">The Sender</param>
        /// <param name="e">Selection Changed Event Args</param>
        private void OnSelectionChanged(object sender, Syncfusion.XForms.Buttons.SelectionChangedEventArgs e)
        {
            if (this.Command == null)
            {
                return;
            }

            if (this.Command.CanExecute(this.CommandParameter))
            {
                this.Command.Execute(this.CommandParameter);
            }
        }
        private void SelectionChanged(object sender, Syncfusion.XForms.Buttons.SelectionChangedEventArgs e)
        {
            if (Command == null)
            {
                return;
            }

            var paramerter = new List <object> {
                e, CommandParameter
            };

            if (Command.CanExecute(paramerter))
            {
                Command.Execute(paramerter);
            }
        }
예제 #11
0
        /// <summary>
        /// Raised when select the cloth type segmented control.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ClothType_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var index = e.Index;

            if (index == 0)
            {
                _viewModel.FontIconText = "A";
            }
            else if (index == 1)
            {
                _viewModel.FontIconText = "B";
            }
            else
            {
                _viewModel.FontIconText = "C";
            }
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Backlight_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (e.Index == 1)
     {
         if (Device.RuntimePlatform == Device.UWP)
         {
             this.MainGrid.FadeTo(0.75, 250, Easing.Linear);
         }
         else
         {
             this.MainGrid.FadeTo(0.5, 250, Easing.Linear);
         }
     }
     else
     {
         this.MainGrid.FadeTo(1, 500, Easing.Linear);
     }
 }
 void Handle_SelectionChanged(object sender, Syncfusion.XForms.Buttons.SelectionChangedEventArgs e)
 {
     if ((sender as Syncfusion.XForms.Buttons.SfSegmentedControl) == TextColorSegment)
     {
         viewModel.TextColor = viewModel.PrimaryColors[e.Index].FontIconFontColor;
         this.TextColorSegment.SelectionTextColor = viewModel.PrimaryColors[e.Index].FontIconFontColor;
     }
     else if ((sender as Syncfusion.XForms.Buttons.SfSegmentedControl) == BackgroundColorSegment)
     {
         viewModel.BackgroundColor = viewModel.PrimaryColors[e.Index].FontIconFontColor;
         this.BackgroundColorSegment.SelectionTextColor = viewModel.PrimaryColors[e.Index].FontIconFontColor;
     }
     else if ((sender as Syncfusion.XForms.Buttons.SfSegmentedControl) == BorderColorSegment)
     {
         viewModel.BorderColor = viewModel.PrimaryColors[e.Index].FontIconFontColor;
         this.BorderColorSegment.SelectionTextColor = viewModel.PrimaryColors[e.Index].FontIconFontColor;
     }
 }
예제 #14
0
        /// <summary>
        /// Raised when select the cloth type segmented control.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ClothType_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var index = e.Index;

            if (index == 0)
            {
                _fontIconText = "A";
            }
            else if (index == 1)
            {
                _fontIconText = "B";
            }
            else
            {
                _fontIconText = "C";
            }
            this.preview.Text = _fontIconText;
        }
        /// <summary>
        /// Invoked when selection is changed.
        /// </summary>
        /// <param name="sender">The Sender</param>
        /// <param name="e">Selection Changed Event Args</param>
        private void OnSelectionChanged(object sender, Syncfusion.XForms.Buttons.SelectionChangedEventArgs e)
        {
            if (this.Command == null)
            {
                return;
            }

            var context = this.ParentBindingContext as StockOverviewViewModel;
            if (context != null)
            {
                context.SelectedDataVariantIndex = e.Index;
            }

            if (this.Command.CanExecute(this.CommandParameter))
            {
                this.Command.Execute(this.CommandParameter);
            }
        }
예제 #16
0
        private void EdgeShapeChanged(object attachedObject)
        {
            var list = attachedObject as List <object>;

            Syncfusion.XForms.Buttons.SelectionChangedEventArgs selectionChangedEventArgs = list[0] as Syncfusion.XForms.Buttons.SelectionChangedEventArgs;
            var frontLayer = (list[1] as SfBackdropPage)?.FrontLayer;

            if (selectionChangedEventArgs == null || frontLayer == null)
            {
                return;
            }

            var selectedIndex = selectionChangedEventArgs.Index;

            if (selectedIndex > -1)
            {
                frontLayer.EdgeShape = selectedIndex == 0 ? EdgeShape.Curve : EdgeShape.Flat;
            }
        }
        /// <summary>
        /// Toggle between linear and radial gradient.
        /// </summary>
        /// <param name="sender">segmented control</param>
        /// <param name="e">event arguments</param>
        private void ToggleButton_SelectionChanged(object sender, Syncfusion.XForms.Buttons.SelectionChangedEventArgs e)
        {
            var viewModel = (this.BindingContext as GettingStartedViewModel);
            var chip      = chipControl;

            if (e.Index == 0)
            {
                gradientAngle.Text = "\xe702";
                SfLinearGradientBrush brush = viewModel.LinearGradientBrushes[chipSelectedIndex];
                brush.StartPoint             = startPoint;
                brush.EndPoint               = endPoint;
                viewModel.BackgroundGradient = brush;
            }
            else
            {
                gradientAngle.Text           = "\xe701";
                viewModel.BackgroundGradient = viewModel.RadialGradientBrushes[chipSelectedIndex];
                rotationAngle = 0;
                startPoint    = new Point(0.5, 0);
                endPoint      = new Point(0.5, 1);
            }
        }
 void Handle_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     viewModel.BorderColor = viewModel.PrimaryColors[e.Index].FontIconFontColor;
     this.BorderColorSegment.SelectionTextColor = viewModel.PrimaryColors[e.Index].FontIconFontColor;
 }
예제 #19
0
 void HandleSelectionChanged(object sender, Syncfusion.XForms.Buttons.SelectionChangedEventArgs e) =>
 _trendsChartSettingsService.CurrentTrendsChartOption = (TrendsChartOptions)e.Index;