/// <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"]); }
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); } } }
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); }