Interaction logic for HeatColorRange.xaml
Exemple #1
0
        /// <summary>
        /// Defines special elements to draw according to the series type
        /// </summary>
        public override void DrawSpecializedElements()
        {
            if (DrawsHeatRange)
            {
                if (ColorRangeControl == null)
                {
                    ColorRangeControl = new HeatColorRange();
                }

                ColorRangeControl.SetBinding(TextBlock.FontFamilyProperty,
                                             new Binding {
                    Path = new PropertyPath(FontFamilyProperty), Source = this
                });
                ColorRangeControl.SetBinding(TextBlock.FontSizeProperty,
                                             new Binding {
                    Path = new PropertyPath(FontSizeProperty), Source = this
                });
                ColorRangeControl.SetBinding(TextBlock.FontStretchProperty,
                                             new Binding {
                    Path = new PropertyPath(FontStretchProperty), Source = this
                });
                ColorRangeControl.SetBinding(TextBlock.FontStyleProperty,
                                             new Binding {
                    Path = new PropertyPath(FontStyleProperty), Source = this
                });
                ColorRangeControl.SetBinding(TextBlock.FontWeightProperty,
                                             new Binding {
                    Path = new PropertyPath(FontWeightProperty), Source = this
                });
                ColorRangeControl.SetBinding(TextBlock.ForegroundProperty,
                                             new Binding {
                    Path = new PropertyPath(ForegroundProperty), Source = this
                });
                ColorRangeControl.SetBinding(VisibilityProperty,
                                             new Binding {
                    Path = new PropertyPath(VisibilityProperty), Source = this
                });

                if (ColorRangeControl.Parent == null)
                {
                    Model.Chart.View.AddToView(ColorRangeControl);
                }
                var max = ColorRangeControl.SetMax(ActualValues.GetTracker(this).WLimit.Max.ToString(CultureInfo.InvariantCulture));
                var min = ColorRangeControl.SetMin(ActualValues.GetTracker(this).WLimit.Min.ToString(CultureInfo.InvariantCulture));

                var m = max > min ? max : min;

                ColorRangeControl.Width = m;

                Model.Chart.ControlSize = new CoreSize(Model.Chart.ControlSize.Width - m - 4,
                                                       Model.Chart.ControlSize.Height);
            }
            else
            {
                Model.Chart.View.RemoveFromView(ColorRangeControl);
            }
        }
Exemple #2
0
        public override void DrawSpecializedElements()
        {
            if (DrawsHeatRange)
            {
                if (ColorRangeControl == null)
                {
                    ColorRangeControl = new HeatColorRange();
                }

                //ColorRangeControl.FontFamily = FontFamily;
                //ColorRangeControl.FontSize = FontSize;
                //ColorRangeControl.FontStretch = FontStretch;
                //ColorRangeControl.FontStyle = FontStyle;
                //ColorRangeControl.FontWeight = FontWeight;
                //ColorRangeControl.Foreground = Foreground;
                //ColorRangeControl.Visibility = Visibility;

                if (ColorRangeControl.Parent == null)
                {
                    Model.Chart.View.AddToView(ColorRangeControl);
                }
                var max = ColorRangeControl.SetMax(ActualValues.GetTracker(this).WLimit.Max.ToString(CultureInfo.InvariantCulture));
                var min = ColorRangeControl.SetMin(ActualValues.GetTracker(this).WLimit.Min.ToString(CultureInfo.InvariantCulture));

                var m = max > min ? max : min;

                ColorRangeControl.Width = m;

                Model.Chart.ControlSize = new CoreSize(Model.Chart.ControlSize.Width - m - 4,
                                                       Model.Chart.ControlSize.Height);
            }
            else
            {
                Model.Chart.View.RemoveFromView(ColorRangeControl);
            }
        }
        /// <summary>
        /// Defines special elements to draw according to the series type
        /// </summary>
        public override void DrawSpecializedElements()
        {
            if (DrawsHeatRange)
            {
                if (ColorRangeControl == null)
                {
                    ColorRangeControl = new HeatColorRange();
                }

                ColorRangeControl.SetBinding(TextBlock.FontFamilyProperty,
                    new Binding {Path = new PropertyPath(FontFamilyProperty), Source = this});
                ColorRangeControl.SetBinding(TextBlock.FontSizeProperty,
                    new Binding { Path = new PropertyPath(FontSizeProperty), Source = this });
                ColorRangeControl.SetBinding(TextBlock.FontStretchProperty,
                    new Binding { Path = new PropertyPath(FontStretchProperty), Source = this });
                ColorRangeControl.SetBinding(TextBlock.FontStyleProperty,
                    new Binding { Path = new PropertyPath(FontStyleProperty), Source = this });
                ColorRangeControl.SetBinding(TextBlock.FontWeightProperty,
                    new Binding { Path = new PropertyPath(FontWeightProperty), Source = this });
                ColorRangeControl.SetBinding(TextBlock.ForegroundProperty,
                    new Binding { Path = new PropertyPath(ForegroundProperty), Source = this });
                ColorRangeControl.SetBinding(VisibilityProperty,
                    new Binding { Path = new PropertyPath(VisibilityProperty), Source = this });

                if (ColorRangeControl.Parent == null)
                {
                    Model.Chart.View.AddToView(ColorRangeControl);
                }
                var max = ColorRangeControl.SetMax(ActualValues.GetTracker(this).WLimit.Max.ToString(CultureInfo.InvariantCulture));
                var min = ColorRangeControl.SetMin(ActualValues.GetTracker(this).WLimit.Min.ToString(CultureInfo.InvariantCulture));

                var m = max > min ? max : min;

                ColorRangeControl.Width = m;

                Model.Chart.ControlSize = new CoreSize(Model.Chart.ControlSize.Width - m - 4,
                    Model.Chart.ControlSize.Height);
            }
            else
            {
                Model.Chart.View.RemoveFromView(ColorRangeControl);
            }
        }