示例#1
0
        public VerticalGauge()
        {
            this.InitializeComponent();

            // >> gauge-types-verticalgauge-code
            RadVerticalGauge radVerticalGauge = new RadVerticalGauge();

            radVerticalGauge.Axis = new GaugeLinearAxis()
            {
                Minimum = 0, Maximum = 200, Step = 25
            };
            radVerticalGauge.Indicators.Add(new GaugeShapeIndicator()
            {
                Value = 90
            });
            GaugeRangesDefinition rangesDefinition = new GaugeRangesDefinition();

            rangesDefinition.Ranges.Add(new GaugeRange()
            {
                From = 0, To = 150, Color = Color.Green
            });
            GaugeGradientRange gradientRange = new GaugeGradientRange()
            {
                From = 150, To = 200
            };

            gradientRange.GradientStops.Add(new RadGradientStop(Color.Yellow, 150));
            gradientRange.GradientStops.Add(new RadGradientStop(Color.Red, 200));
            rangesDefinition.Ranges.Add(gradientRange);
            radVerticalGauge.Ranges = rangesDefinition;
            // << gauge-types-verticalgauge-code
        }
示例#2
0
        public Page2()
        {
            InitializeComponent();

            RadVerticalGauge gauge = new RadVerticalGauge()
            {
                Ranges         = new double[] { 0, 45, 60, 70 },
                Colors         = new Color[] { Color.Green, Color.Lime, Color.Red },
                Minimum        = 30,
                Maximum        = 70,
                Step           = 10,
                IndicatorValue = 40
            };

            gauge.SetValue(Grid.RowProperty, 1);
            gauge.SetValue(Grid.ColumnProperty, 0);
            gauge.SetValue(RadVerticalGauge.MarginProperty, new Thickness(10));
            this.root.Children.Add(gauge);

            gauge = new RadVerticalGauge()
            {
                Ranges         = new double[] { 0, 45, 60, 70 },
                Colors         = new Color[] { Color.Green, Color.Lime, Color.Red },
                Minimum        = 30,
                Maximum        = 70,
                Step           = 10,
                IndicatorValue = 56
            };

            gauge.SetValue(Grid.RowProperty, 1);
            gauge.SetValue(Grid.ColumnProperty, 1);
            gauge.SetValue(RadVerticalGauge.MarginProperty, new Thickness(10));
            this.root.Children.Add(gauge);

            gauge = new RadVerticalGauge()
            {
                Ranges         = new double[] { 0, 45, 60, 70 },
                Colors         = new Color[] { Color.Green, Color.Lime, Color.Red },
                Minimum        = 30,
                Maximum        = 70,
                Step           = 10,
                IndicatorValue = 63
            };

            gauge.SetValue(Grid.RowProperty, 1);
            gauge.SetValue(Grid.ColumnProperty, 2);
            gauge.SetValue(RadVerticalGauge.MarginProperty, new Thickness(10));
            this.root.Children.Add(gauge);
        }
示例#3
0
        public Page1()
        {
            InitializeComponent();

            this.gauge = new RadVerticalGauge()
            {
                Ranges        = new double[] { 0, 33, 66, 100 },
                Colors        = new Color[] { Color.White, Color.Green, Color.Red },
                Maximum       = 100,
                HeightRequest = 300
            };

            this.root.Children.Add(gauge);

            Button increaseMaxButton = new Button()
            {
                Text = "Increase Maximum"
            };

            increaseMaxButton.Clicked += this.IncreaseMaxButton_Clicked;
            this.root.Children.Add(increaseMaxButton);

            Button increaseMinButton = new Button()
            {
                Text = "Increase Minimum"
            };

            increaseMinButton.Clicked += this.IncreaseMinButton_Clicked;
            this.root.Children.Add(increaseMinButton);

            Button increaseStepButton = new Button()
            {
                Text = "Increase Step"
            };

            increaseStepButton.Clicked += this.IncreaseStepButton_Clicked;
            this.root.Children.Add(increaseStepButton);

            var animateButton = new Button {
                Text = "animate"
            };

            animateButton.Clicked += Animate;

            this.root.Children.Add(animateButton);
        }