Esempio n. 1
0
        internal ContentControl UpdateLabelContent(DataLabelViewModel content, ContentControl currentControl)
        {
            ContentControl control;

            if (currentControl == null)
            {
                control = new ContentControl();
                control.SetBinding(VisibilityProperty,
                                   new Binding {
                    Path = new PropertyPath(nameof(Visibility)), Source = this
                });
                Canvas.SetZIndex(control, int.MaxValue - 1);

                Model.Chart.View.AddToDrawMargin(control);
            }
            else
            {
                control = currentControl;
            }

            control.Content         = content;
            control.ContentTemplate = DataLabelsTemplate;
            control.FontFamily      = FontFamily;
            control.FontSize        = FontSize;
            control.FontStretch     = FontStretch;
            control.FontStyle       = FontStyle;
            control.FontWeight      = FontWeight;
            control.Foreground      = Foreground;

            return(control);
        }
Esempio n. 2
0
        internal ContentControl UpdateLabelContent(DataLabelViewModel content)
        {
            var control = new ContentControl
            {
                Content         = content,
                ContentTemplate = DataLabelsTemplate,
                FontFamily      = FontFamily,
                FontSize        = FontSize,
                FontStretch     = FontStretch,
                FontStyle       = FontStyle,
                FontWeight      = FontWeight,
                Foreground      = Foreground
            };

            control.SetBinding(VisibilityProperty, new Binding {
                Path = new PropertyPath(VisibilityProperty), Source = this
            });

            return(control);
        }