private static void OnNotExpandedHeightChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (e.NewValue == null || e.OldValue == null) { return; } TabbedExpander control = d as TabbedExpander; if (!control.IsExpanded) { control.Height = (double)e.NewValue;// - control.EXPANDER_OFFSET; } control.NotifyPropChanged("EXPANDER_NOTEXPANDED_HEIGHT"); }
private static void OnIsExpandedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (e.NewValue == null || e.OldValue == null) { return; } TabbedExpander control = d as TabbedExpander; if ((bool)e.NewValue) { control.MinHeight = control._MinHeight; control.VerticalAlignment = VerticalAlignment.Stretch; control.Height = control.EXPANDER_EXPANDED_HEIGHT; /*control.SetBinding( * TabbedExpander.HeightProperty, * new Binding() * { * Source = control, * Path = new PropertyPath("EXPANDER_EXPANDED_HEIGHT"), * Mode = BindingMode.OneWay * });*/ } else { control.MinHeight = control.EXPANDER_NOTEXPANDED_HEIGHT; control.VerticalAlignment = control._VerticalAlignment; control.Height = control.EXPANDER_NOTEXPANDED_HEIGHT;// - control.EXPANDER_OFFSET; /*switch(control.TabStripPlacement) * { * case Dock.Bottom: * control.VerticalAlignment = VerticalAlignment.Bottom; * break; * case Dock.Left: * control.HorizontalAlignment = HorizontalAlignment.Left; * break; * case Dock.Right: * control.HorizontalAlignment = HorizontalAlignment.Right; * break; * case Dock.Top: * control.VerticalAlignment = VerticalAlignment.Top; * break; * }*/ } control.NotifyPropChanged("IsExpanded"); }