Пример #1
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (this.PART_BarItemsControl != null)
            {
                this.PART_BarItemsControl.ElementGenerated -= BarItemsControlBarGenerated;
            }

            this.PART_BarItemsControl = (SlimItemsControl)GetTemplateChild("PART_BarItemsControl");
            if (this.PART_BarItemsControl != null)
            {
                this.PART_BarItemsControl.ElementGenerated += BarItemsControlBarGenerated;

                this.PART_BarItemsControl.SetBinding(SlimItemsControl.ItemTemplateSelectorProperty, new Binding(nameof(this.BarItemTemplateSelector))
                {
                    Source = this
                });
                this.PART_BarItemsControl.SetBinding(SlimItemsControl.ItemTemplateProperty, new Binding(nameof(this.BarItemTemplate))
                {
                    Source = this
                });
                UpdateBarWidth();
                UpdateItemsSource();
            }
        }
Пример #2
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (this.PART_SeriesItemsControl != null)
            {
                this.PART_SeriesItemsControl.ElementGenerated -= SeriesItemTemplateApplied;
            }

            this.PART_SeriesItemsControl = (SlimItemsControl)GetTemplateChild(sPART_SeriesItemsControl);

            if (this.PART_SeriesItemsControl != null)
            {
                this.PART_SeriesItemsControl.ElementGenerated += SeriesItemTemplateApplied;
                this.PART_SeriesItemsControl.ChildRemoved     += SeriesItemsControl_ChildRemoved;
                this.PART_SeriesItemsControl.Reset            += PART_SeriesItemsControl_Reset;

                OnSeriesTemplateChanged();
                OnSeriesTemplateSelectorChanged();

                this.PART_SeriesItemsControl.ItemsSource = this.SeriesItemsSource;
            }
        }
Пример #3
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (this.PART_SeriesItemsControl != null)
            {
                this.PART_SeriesItemsControl.ElementGenerated -= SeriesItemTemplateApplied;
            }

            this.PART_SeriesItemsControl = (SlimItemsControl)GetTemplateChild(sPART_SeriesItemsControl);

            if (this.PART_SeriesItemsControl != null)
            {
                this.PART_SeriesItemsControl.ElementGenerated += SeriesItemTemplateApplied;
                //this.PART_SeriesItemsControl.ItemAdded += PART_SeriesItemsControl_ItemAdded;
                this.PART_SeriesItemsControl.ChildRemoved += PartSeriesChildrenControlChildRemoved;
                //this.PART_SeriesItemsControl.ItemReplaced += PART_SeriesItemsControl_ItemReplaced;
                this.PART_SeriesItemsControl.Reset += PART_SeriesItemsControl_Reset;

                this.PART_SeriesItemsControl.SetBinding(SlimItemsControl.ItemTemplateProperty,
                                                        new Binding(nameof(this.SeriesTemplate))
                {
                    Source = this
                });
                this.PART_SeriesItemsControl.SetBinding(SlimItemsControl.ItemTemplateSelectorProperty,
                                                        new Binding(nameof(this.SeriesTemplateSelector))
                {
                    Source = this
                });
                this.PART_SeriesItemsControl.SetBinding(SlimItemsControl.ItemsSourceProperty,
                                                        new Binding(nameof(this.SeriesItemsSource))
                {
                    Source = this
                });
            }
        }