diff --git a/Microsoft.Toolkit.Uwp.UI.Controls/Expander/Expander.Properties.cs b/Microsoft.Toolkit.Uwp.UI.Controls/Expander/Expander.Properties.cs index f73060608a3..e5024001a88 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls/Expander/Expander.Properties.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls/Expander/Expander.Properties.cs @@ -37,6 +37,12 @@ public partial class Expander public static readonly DependencyProperty ContentOverlayProperty = DependencyProperty.Register(nameof(ContentOverlay), typeof(UIElement), typeof(Expander), new PropertyMetadata(default(UIElement))); + /// + /// Identifies the dependency property. + /// + public static readonly DependencyProperty HeaderStyleProperty = + DependencyProperty.Register(nameof(HeaderStyle), typeof(Style), typeof(Expander), new PropertyMetadata(default(Style))); + /// /// Gets or sets a value indicating whether the content of the control is opened/visible or closed/hidden. /// @@ -64,6 +70,15 @@ public UIElement ContentOverlay set { SetValue(ContentOverlayProperty, value); } } + /// + /// Gets or sets a value for the style to use for the Header of the Expander. + /// + public Style HeaderStyle + { + get { return (Style)GetValue(HeaderStyleProperty); } + set { SetValue(HeaderStyleProperty, value); } + } + private static void OnIsExpandedPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var expander = d as Expander; diff --git a/Microsoft.Toolkit.Uwp.UI.Controls/Expander/Expander.xaml b/Microsoft.Toolkit.Uwp.UI.Controls/Expander/Expander.xaml index d4cce319f81..ae4adf77c3a 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls/Expander/Expander.xaml +++ b/Microsoft.Toolkit.Uwp.UI.Controls/Expander/Expander.xaml @@ -11,6 +11,7 @@ + @@ -267,6 +268,7 @@ + + + + + +``` + +## Events + + + +| Events | Description | +| -- | -- | +| Collapsed | Fires when the expander is closed. | +| Expanded | Fires when the expander is opened. | + ## Example Image ![Expander animation](../resources/images/Controls-Expander.gif "Expander") -## Example Code +## Sample Code [Expander Sample Page](https://github.com/Microsoft/UWPCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Expander) @@ -90,4 +119,9 @@ The `ContentOverlay` property can be used to define the content to be shown when ## API -* [Expander source code](https://github.com/Microsoft/UWPCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/Expander) \ No newline at end of file +- [Expander source code](https://github.com/Microsoft/UWPCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls/Expander) + +## Related Topics + +- [HeaderedControlControl](HeaderedContentControl.md) +- [ToggleButton](https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Controls.Primitives.ToggleButton)