diff --git a/components/SettingsControls/samples/ContentAlignmentSettingsCardSample.xaml b/components/SettingsControls/samples/ContentAlignmentSettingsCardSample.xaml new file mode 100644 index 00000000..180f6e08 --- /dev/null +++ b/components/SettingsControls/samples/ContentAlignmentSettingsCardSample.xaml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 800 + 600 + + + + + + diff --git a/components/SettingsControls/samples/ContentAlignmentSettingsCardSample.xaml.cs b/components/SettingsControls/samples/ContentAlignmentSettingsCardSample.xaml.cs new file mode 100644 index 00000000..4fa3234a --- /dev/null +++ b/components/SettingsControls/samples/ContentAlignmentSettingsCardSample.xaml.cs @@ -0,0 +1,17 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace SettingsControlsExperiment.Samples; + +[ToolkitSampleBoolOption("IsCardEnabled", true, Title = "Is Enabled")] + +[ToolkitSample(id: nameof(ContentAlignmentSettingsCardSample), "ContentAlignmentSettingsCardSample", description: "A sample for showing how to use the SettingsCard.ContentAlignment attached property")] + +public sealed partial class ContentAlignmentSettingsCardSample : Page +{ + public ContentAlignmentSettingsCardSample() + { + this.InitializeComponent(); + } +} diff --git a/components/SettingsControls/samples/SettingsCard.md b/components/SettingsControls/samples/SettingsCard.md index 667bc703..cab4d336 100644 --- a/components/SettingsControls/samples/SettingsCard.md +++ b/components/SettingsControls/samples/SettingsCard.md @@ -12,11 +12,15 @@ issue-id: 0 icon: Assets/SettingsCard.png --- -SettingsCard is a control that can be used to display settings in your experience. It uses the default styling found in Windows 11 and is easy to use, meets all accessibility standards and will make your settings page look great! +`SettingsCard` is a control that can be used to display settings in your experience. It uses the default styling found in Windows 11 and is easy to use, meets all accessibility standards and will make your settings page look great! You can set the `Header`, `Description`, `HeaderIcon` and `Content` properties to create an easy to use experience, like so: > [!SAMPLE SettingsCardSample] -SettingsCard can also be turned into a button, by setting the `IsClickEnabled` property. This can be useful whenever you want your settings component to navigate to a detail page or open an external link. You can set a custom icon by setting the `ActionIcon`, or hiding it completely by setting the `IsActionIconVisible` to `false`. +`SettingsCard` can also be turned into a button, by setting the `IsClickEnabled` property. This can be useful whenever you want your settings component to navigate to a detail page or open an external link. You can set a custom icon by setting the `ActionIcon`, or hiding it completely by setting the `IsActionIconVisible` to `false`. > [!SAMPLE ClickableSettingsCardSample] + +You can easily override certain properties to create custom experiences. For instance, you can customize the `ContentAlignment` of a `SettingsCard`, to align your content to the Right (default), Left (hiding the `HeaderIcon`, `Header` and `Description`), Vertically (usually best paired with changing the `HorizontalContentAlignment` to `Stretch`) or Horizontally (attaching additional `VisualState` to reverse the Content layout). + +> [!SAMPLE ContentAlignmentSettingsCardSample] diff --git a/components/SettingsControls/samples/SettingsCardSample.xaml b/components/SettingsControls/samples/SettingsCardSample.xaml index 6e17962d..583bd122 100644 --- a/components/SettingsControls/samples/SettingsCardSample.xaml +++ b/components/SettingsControls/samples/SettingsCardSample.xaml @@ -1,4 +1,4 @@ - + - - - 800 - 600 - -