コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            PART_Border   = Template.FindName("PART_Border", this) as Border;
            PART_Splitter = Template.FindName("PART_Splitter", this) as GridSplitter;

            NameColumn.CellTemplate  = (DataTemplate)PART_Border.Resources["DataTemplate.Property.Name"];
            ValueColumn.CellTemplate = (DataTemplate)PART_Border.Resources["DataTemplate.Property.Value"];

            GroupStyle.Add((GroupStyle)PART_Border.Resources["Style.Group"]);
        }
コード例 #2
0
        protected override void OnTemplateChanged(ControlTemplate oldTemplate, ControlTemplate newTemplate)
        {
            base.OnTemplateChanged(oldTemplate, newTemplate);

            //Check if this template specifies a GroupStyle (which can't be done in Xaml directly)
            if (newTemplate != null)
            {
                GroupStyle groupStyle = newTemplate.Resources["PART_GroupStyle"] as GroupStyle;
                if (groupStyle != null)
                {
                    GroupStyle.Clear();
                    GroupStyle.Add(groupStyle);
                }
            }
        }
コード例 #3
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (DesignerProperties.GetIsInDesignMode(this))
            {
                return;
            }

            GroupStyle.Add(new GroupStyle()
            {
                ContainerStyle = FindResource("DelightGroupItemStyle") as Style
            });

            // Search bar Binding
            Binding b = BindingHelper.SetBinding(
                GetTemplateChild("PART_searchBox"), TextBox.TextProperty,
                this, FilterKeywordProperty,
                sourceTrigger: UpdateSourceTrigger.PropertyChanged);
        }