diff --git a/components/Segmented/samples/Segmented.Samples.csproj b/components/Segmented/samples/Segmented.Samples.csproj index f915b692..fa35cd4b 100644 --- a/components/Segmented/samples/Segmented.Samples.csproj +++ b/components/Segmented/samples/Segmented.Samples.csproj @@ -7,6 +7,8 @@ + + diff --git a/components/Segmented/samples/Segmented.md b/components/Segmented/samples/Segmented.md index b9575e0c..5983db4e 100644 --- a/components/Segmented/samples/Segmented.md +++ b/components/Segmented/samples/Segmented.md @@ -27,3 +27,9 @@ The `Segmented` control is best used with 2-5 items and does not support overflo The `Segmented` control contains various additional styles, to match the look and feel of your application. The `PivotSegmentedStyle` matches a modern `Pivot` style while the `ButtonSegmentedStyle` represents buttons. To load these styles, make sure to add the `ResourceDictionary` as a resource (see `Page.Resources` sample below). > [!SAMPLE SegmentedStylesSample] + +## Segmented + SwitchPresenter + +The `Segmented` control can be combined with e.g. a `SwitchPresenter` to provide easy navigation and with limited XAML and no code-behind! + +> [!SAMPLE SegmentedSwitchPresenterSample] diff --git a/components/Segmented/samples/SegmentedSwitchPresenterSample.xaml b/components/Segmented/samples/SegmentedSwitchPresenterSample.xaml new file mode 100644 index 00000000..c131ccf5 --- /dev/null +++ b/components/Segmented/samples/SegmentedSwitchPresenterSample.xaml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/Segmented/samples/SegmentedSwitchPresenterSample.xaml.cs b/components/Segmented/samples/SegmentedSwitchPresenterSample.xaml.cs new file mode 100644 index 00000000..032c5c29 --- /dev/null +++ b/components/Segmented/samples/SegmentedSwitchPresenterSample.xaml.cs @@ -0,0 +1,21 @@ +// 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. + +using CommunityToolkit.WinUI.Controls; + +namespace SegmentedExperiment.Samples; + +/// +/// An example sample page of a Segmented control. +/// + +[ToolkitSample(id: nameof(SegmentedSwitchPresenterSample), "Segmented + SwitchPresenter", description: $"A sample for showing how to create and use a {nameof(Segmented)} control in combination with a SwitchPresenter.")] +public sealed partial class SegmentedSwitchPresenterSample : Page +{ + public SegmentedSwitchPresenterSample() + { + this.InitializeComponent(); + } +} +