diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 83845359833..0f014681364 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -31,6 +31,7 @@ Please check if your PR fulfills the following requirements: - [ ] Sample in sample app has been added / updated (for bug fixes / features) - [ ] Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/Microsoft/UWPCommunityToolkit-design-assets) - [ ] Tests for the changes have been added (for bug fixes / features) (if applicable) +- [ ] Header has been added to all new source files (run *build/UpdateHeaders.bat*) - [ ] Contains **NO** breaking changes diff --git a/Directory.Build.props b/Directory.Build.props index 437e56bd302..e89738becb8 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -69,11 +69,11 @@ - 2.0.37-beta + 2.1.23 - + @@ -81,14 +81,4 @@ stylecop.json - - - - - - \ No newline at end of file diff --git a/Microsoft.Toolkit.Services/Services/Bing/BingLanguage.cs b/Microsoft.Toolkit.Services/Services/Bing/BingLanguage.cs index 47fdb7320f5..6dc1f265e71 100644 --- a/Microsoft.Toolkit.Services/Services/Bing/BingLanguage.cs +++ b/Microsoft.Toolkit.Services/Services/Bing/BingLanguage.cs @@ -661,12 +661,6 @@ public enum BingLanguage [StringValue("mn")] Mongolian, - /// - /// Moldavian - /// - [StringValue("mo")] - Moldavian, - /// /// Marathi /// @@ -1141,4 +1135,4 @@ public enum BingLanguage [StringValue("zu")] Zulu } -} \ No newline at end of file +} diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/RangeSelector/RangeSelectorCode.bind b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/RangeSelector/RangeSelectorCode.bind index c963c735c51..7fbe48c54cd 100644 --- a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/RangeSelector/RangeSelectorCode.bind +++ b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/RangeSelector/RangeSelectorCode.bind @@ -27,7 +27,7 @@ Grid.Column="1" Minimum="@[Minimum:Slider:0:0-100]@" Maximum="@[Maximum:Slider:100:0-100]@" - StepFrequency="@[StepFrequency:DoubleSlider:1.0:0.25-10.0]@"/> + StepFrequency="@[StepFrequency:Slider:1:1-10]@"/> items && items.Contains(e.Parameter)) { - listAnimProperty.ListViewBase.PrepareConnectedAnimation(props.Key, e.Parameter, listAnimProperty.ElementName); + try + { + listAnimProperty.ListViewBase.PrepareConnectedAnimation(props.Key, e.Parameter, listAnimProperty.ElementName); + } + catch + { + // Ignore + } } } } diff --git a/Microsoft.Toolkit.Uwp.UI.Controls/Carousel/Carousel.cs b/Microsoft.Toolkit.Uwp.UI.Controls/Carousel/Carousel.cs index a99e56d1c59..380731e7489 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls/Carousel/Carousel.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls/Carousel/Carousel.cs @@ -512,7 +512,6 @@ protected override void PrepareContainerForItemOverride(DependencyObject element var compositeTransform = new CompositeTransform(); compositeTransform.CenterX = 0.5; compositeTransform.CenterY = 0.5; - compositeTransform.CenterY = 0.5; carouselItem.Projection = planeProjection; carouselItem.RenderTransform = compositeTransform; diff --git a/Microsoft.Toolkit.Uwp.UI.Controls/Expander/Expander.Properties.cs b/Microsoft.Toolkit.Uwp.UI.Controls/Expander/Expander.Properties.cs index b7c13a3e0a1..e5024001a88 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls/Expander/Expander.Properties.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls/Expander/Expander.Properties.cs @@ -19,18 +19,6 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls /// public partial class Expander { - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty HeaderProperty = - DependencyProperty.Register(nameof(Header), typeof(string), typeof(Expander), new PropertyMetadata(null)); - - /// - /// Identifies the dependency property. - /// - public static readonly DependencyProperty HeaderTemplateProperty = - DependencyProperty.Register(nameof(HeaderTemplate), typeof(DataTemplate), typeof(Expander), new PropertyMetadata(null)); - /// /// Identifies the dependency property. /// @@ -50,22 +38,10 @@ public partial class Expander DependencyProperty.Register(nameof(ContentOverlay), typeof(UIElement), typeof(Expander), new PropertyMetadata(default(UIElement))); /// - /// Gets or sets a value indicating whether the Header of the control. - /// - public string Header - { - get { return (string)GetValue(HeaderProperty); } - set { SetValue(HeaderProperty, value); } - } - - /// - /// Gets or sets a value indicating whether the HeaderTemplate of the control. + /// Identifies the dependency property. /// - public DataTemplate HeaderTemplate - { - get { return (DataTemplate)GetValue(HeaderTemplateProperty); } - set { SetValue(HeaderTemplateProperty, value); } - } + 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. @@ -94,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.cs b/Microsoft.Toolkit.Uwp.UI.Controls/Expander/Expander.cs index 975571fca7d..cf3c5289323 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls/Expander/Expander.cs +++ b/Microsoft.Toolkit.Uwp.UI.Controls/Expander/Expander.cs @@ -40,7 +40,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls [TemplatePart(Name = LayoutTransformerPart, Type = typeof(LayoutTransformControl))] [TemplatePart(Name = ContentOverlayPart, Type = typeof(ContentPresenter))] [ContentProperty(Name = "Content")] - public partial class Expander : ContentControl + public partial class Expander : HeaderedContentControl { /// /// Initializes a new instance of the class. diff --git a/Microsoft.Toolkit.Uwp.UI.Controls/Expander/Expander.xaml b/Microsoft.Toolkit.Uwp.UI.Controls/Expander/Expander.xaml index 2fde0d3ee49..ae4adf77c3a 100644 --- a/Microsoft.Toolkit.Uwp.UI.Controls/Expander/Expander.xaml +++ b/Microsoft.Toolkit.Uwp.UI.Controls/Expander/Expander.xaml @@ -11,9 +11,11 @@ + - - + + + @@ -251,10 +253,11 @@ ContentTemplate="{TemplateBinding ContentTemplate}" ContentTransitions="{TemplateBinding ContentTransitions}" Content="{TemplateBinding Content}" + HorizontalAlignment="{TemplateBinding HorizontalAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" + VerticalAlignment="{TemplateBinding VerticalAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" - HorizontalAlignment="Left" RenderTransformOrigin="0.5,0.5" /> @@ -265,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)