diff --git a/doc/material-controls-extensions.md b/doc/material-controls-extensions.md index 15ae35018..7a3242e81 100644 --- a/doc/material-controls-extensions.md +++ b/doc/material-controls-extensions.md @@ -4,31 +4,61 @@ uid: Uno.Themes.Material.Extensions # Material Control Extensions +> [!NOTE] +> Uno Material also has support for C# Markup through a [Uno.Material.WinUI.Markup](https://www.nuget.org/packages/Uno.Material.WinUI.Markup) NuGet Package. To get started with Uno Material in your C# Markup application, add the `Uno.Material.WinUI.Markup` NuGet package to your **App Code Library** project and your platform heads. + ## Icon -This feature allows for the addition of icon on the supported controls. Those icons could be any of the [`IconElement`](https://docs.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.iconelement)s: ``, ``, `` or ``. +This feature allows for the addition of icon on the supported controls. Those icons could be any of the [`IconElement`](https://docs.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.iconelement)s: `BitmapIcon`, `FontIcon`, `PathIcon` or `SymbolIcon`. Here are supported control with samples: * TextBox: - ```xml - - - - - - ``` +# [**XAML**](#tab/xaml) +```xml + + + + + +``` + +# [**C#**](#tab/csharp) +```cs +new TextBox() + .Style(Theme.TextBox.Styles.Filled) + .ControlExtensions + ( + icon: + new SymbolIcon() + .Symbol(Symbol.SolidStar) + ) +``` +*** * ComboBox: - ```xml - - - - - - ``` +# [**XAML**](#tab/xaml) +```xml + + + + + +``` +# [**C#**](#tab/csharp) +```cs +new ComboBox() + .Style(Theme.ComboBox.Styles.Default) + .ControlExtensions + ( + icon: + new SymbolIcon() + .Symbol(Symbol.SolidStar) + ) +``` +*** ## Alternate Content @@ -37,17 +67,36 @@ It's control specific and for now, you can only use it with the ToggleButton con ### Alternate Content on ToggleButton +# [**XAML**](#tab/xaml) ```xml - ``` +# [**C#**](#tab/csharp) +```cs +new ToggleButton() + .Style(Theme.ToggleButton.Styles.Icon) + // This is the default content - which is when the control state is UNCHECKED (the default value of a ToggleButton) + .Content + ( + new PathIcon() + .Data(StaticResource.Get("Icon_more_horizontal")) + ) + // This is the alternate content - which is when the control state is CHECKED + .ControlExtensions + ( + alternateContent: + new PathIcon() + .Data(StaticResource.Get("Icon_more_vertical")) + ) +``` +*** ## Elevation @@ -97,6 +146,7 @@ Within the `ControlTemplate` of the `ElevatedButtonStyle`, instead of performing Applying the surface tint for elevated controls is optional and must be explicitly enabled through the use of the `IsTintEnabled` attached property. Below is an example of how an elevated control may appear with or without a surface tint: +# [**XAML**](#tab/xaml) ```xml