diff --git a/components/Converters/samples/BoolNegationConverterSample.xaml b/components/Converters/samples/BoolNegationConverterSample.xaml
new file mode 100644
index 00000000..a541800c
--- /dev/null
+++ b/components/Converters/samples/BoolNegationConverterSample.xaml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
diff --git a/components/Converters/samples/BoolNegationConverterSample.xaml.cs b/components/Converters/samples/BoolNegationConverterSample.xaml.cs
new file mode 100644
index 00000000..17c29a01
--- /dev/null
+++ b/components/Converters/samples/BoolNegationConverterSample.xaml.cs
@@ -0,0 +1,16 @@
+// 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 ConvertersExperiment.Samples;
+
+[ToolkitSampleBoolOption("MyBooleanValue", true, Title = "Original value")]
+
+[ToolkitSample(id: nameof(BoolNegationConverterSample), "BoolNegationConverter", description: $"A sample for showing how to use the BoolNegationConverter.")]
+public sealed partial class BoolNegationConverterSample : Page
+{
+ public BoolNegationConverterSample()
+ {
+ this.InitializeComponent();
+ }
+}
diff --git a/components/Converters/samples/BoolToObjectConverterSample.xaml b/components/Converters/samples/BoolToObjectConverterSample.xaml
new file mode 100644
index 00000000..19cadccf
--- /dev/null
+++ b/components/Converters/samples/BoolToObjectConverterSample.xaml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
diff --git a/components/Converters/samples/BoolToObjectConverterSample.xaml.cs b/components/Converters/samples/BoolToObjectConverterSample.xaml.cs
new file mode 100644
index 00000000..b948917d
--- /dev/null
+++ b/components/Converters/samples/BoolToObjectConverterSample.xaml.cs
@@ -0,0 +1,16 @@
+// 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 ConvertersExperiment.Samples;
+
+[ToolkitSampleBoolOption("MyBooleanValue", false, Title = "Toggle to change colors")]
+
+[ToolkitSample(id: nameof(BoolToObjectConverterSample), "BoolToObjectConverter", description: $"A sample for showing how to use the BoolToObjectConverter.")]
+public sealed partial class BoolToObjectConverterSample : Page
+{
+ public BoolToObjectConverterSample()
+ {
+ this.InitializeComponent();
+ }
+}
diff --git a/components/Converters/samples/BoolToVisibilityConverterSample.xaml b/components/Converters/samples/BoolToVisibilityConverterSample.xaml
new file mode 100644
index 00000000..9ad0cef7
--- /dev/null
+++ b/components/Converters/samples/BoolToVisibilityConverterSample.xaml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/Converters/samples/BoolToVisibilityConverterSample.xaml.cs b/components/Converters/samples/BoolToVisibilityConverterSample.xaml.cs
new file mode 100644
index 00000000..e6c7c218
--- /dev/null
+++ b/components/Converters/samples/BoolToVisibilityConverterSample.xaml.cs
@@ -0,0 +1,16 @@
+// 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 ConvertersExperiment.Samples;
+
+[ToolkitSampleBoolOption("MyBooleanValue", true, Title = "Toggle to show or hide the image")]
+
+[ToolkitSample(id: nameof(BoolToVisibilityConverterSample), "BoolToVisibilityConverter", description: $"A sample for showing how to use the BoolToVisibilityConverter.")]
+public sealed partial class BoolToVisibilityConverterSample : Page
+{
+ public BoolToVisibilityConverterSample()
+ {
+ this.InitializeComponent();
+ }
+}
diff --git a/components/Converters/samples/CollectionVisibilityConverterSample.xaml b/components/Converters/samples/CollectionVisibilityConverterSample.xaml
new file mode 100644
index 00000000..00d8e83b
--- /dev/null
+++ b/components/Converters/samples/CollectionVisibilityConverterSample.xaml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/Converters/samples/CollectionVisibilityConverterSample.xaml.cs b/components/Converters/samples/CollectionVisibilityConverterSample.xaml.cs
new file mode 100644
index 00000000..f123209e
--- /dev/null
+++ b/components/Converters/samples/CollectionVisibilityConverterSample.xaml.cs
@@ -0,0 +1,16 @@
+// 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 ConvertersExperiment.Samples;
+
+[ToolkitSample(id: nameof(CollectionVisibilityConverterSample), "CollectionVisibilityConverter", description: $"A sample for showing how to use the CollectionVisibilityConverter.")]
+public sealed partial class CollectionVisibilityConverterSample : Page
+{
+ public ObservableCollection EmptyCollection = new();
+
+ public CollectionVisibilityConverterSample()
+ {
+ this.InitializeComponent();
+ }
+}
diff --git a/components/Converters/samples/ColorToDisplayNameConverterSample.xaml b/components/Converters/samples/ColorToDisplayNameConverterSample.xaml
new file mode 100644
index 00000000..933ccc3a
--- /dev/null
+++ b/components/Converters/samples/ColorToDisplayNameConverterSample.xaml
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/Converters/samples/ColorToDisplayNameConverterSample.xaml.cs b/components/Converters/samples/ColorToDisplayNameConverterSample.xaml.cs
new file mode 100644
index 00000000..8b1b42bd
--- /dev/null
+++ b/components/Converters/samples/ColorToDisplayNameConverterSample.xaml.cs
@@ -0,0 +1,14 @@
+// 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 ConvertersExperiment.Samples;
+
+[ToolkitSample(id: nameof(ColorToDisplayNameConverterSample), "ColorToDisplayNameConverter", description: $"A sample for showing how to use the ColorToDisplayNameConverter.")]
+public sealed partial class ColorToDisplayNameConverterSample : Page
+{
+ public ColorToDisplayNameConverterSample()
+ {
+ this.InitializeComponent();
+ }
+}
diff --git a/components/Converters/samples/Converters.Samples.csproj b/components/Converters/samples/Converters.Samples.csproj
index 3c2f561a..fb54743b 100644
--- a/components/Converters/samples/Converters.Samples.csproj
+++ b/components/Converters/samples/Converters.Samples.csproj
@@ -5,9 +5,17 @@
+
+
+
+
+
+ PreserveNewest
+
+ StringFormatConverterSample.xaml
diff --git a/components/Converters/samples/Converters.md b/components/Converters/samples/Converters.md
index e09f9fe2..7854e707 100644
--- a/components/Converters/samples/Converters.md
+++ b/components/Converters/samples/Converters.md
@@ -12,151 +12,78 @@ issue-id: 0
icon: Assets/Converters.png
---
-| Converter | Purpose |
-| --- | --- |
-| [BoolNegationConverter](/dotnet/api/microsoft.toolkit.uwp.ui.converters.boolnegationconverter?view=uwp-toolkit-dotnet) | Converts a boolean to the inverse value (True to False and vice versa) |
-| [BoolToObjectConverter](/dotnet/api/microsoft.toolkit.uwp.ui.converters.booltoobjectconverter?view=uwp-toolkit-dotnet) | Converts a boolean value into an object. The converted value is selected between the values of TrueValue and FalseValue properties |
-| [BoolToVisibilityConverter](/dotnet/api/microsoft.toolkit.uwp.ui.converters.booltovisibilityconverter?view=uwp-toolkit-dotnet) | Converts a boolean value into a Visibility enumeration |
-| [CollectionVisibilityConverter](/dotnet/api/microsoft.toolkit.uwp.ui.converters.collectionvisibilityconverter?view=uwp-toolkit-dotnet) | Converts a collection into a Visibility enumeration (Collapsed if the given collection is empty or null) |
-| [DoubleToObjectConverter](/dotnet/api/microsoft.toolkit.uwp.ui.converters.doubletoobjectconverter?view=uwp-toolkit-dotnet) | Converts a double value into an object based on a value to be greater than, less than, or in-between. |
-| [DoubleToVisibilityConverter](/dotnet/api/microsoft.toolkit.uwp.ui.converters.doubletovisibilityconverter?view=uwp-toolkit-dotnet) | Converts a double value into a Visibility enumeration based on a value to be greater than, less than, or in-between. |
-| [EmptyCollectionToObjectConverter](/dotnet/api/microsoft.toolkit.uwp.ui.converters.emptycollectiontoobjectconverter?view=uwp-toolkit-dotnet) | Converts a collection into an object. The converted value is selected between the values of EmptyValue and NotEmptyValue properties |
-| [EmptyObjectToObjectConverter](/dotnet/api/microsoft.toolkit.uwp.ui.converters.emptyobjecttoobjectconverter?view=uwp-toolkit-dotnet) | Converts a check on a null value into an object. The converted value is selected between the values of EmptyValue and NonEmptyValue properties |
-| [EmptyStringToObjectConverter](/dotnet/api/microsoft.toolkit.uwp.ui.converters.emptystringtoobjectconverter?view=uwp-toolkit-dotnet) | Converts a string into an object. The converted value is selected between the values of EmptyValue and NotEmptyValue properties |
-| [FormatStringConverter](/dotnet/api/microsoft.toolkit.uwp.ui.converters.formatstringconverter?view=uwp-toolkit-dotnet) | Converts an [IFormattable](/dotnet/api/system.string.format?view=netframework-4.7) value into a string. The ConverterParameter provides the string format |
-| [ResourceNameToResourceStringConverter](/dotnet/api/microsoft.toolkit.uwp.ui.converters.resourcenametoresourcestringconverter?view=uwp-toolkit-dotnet) | Converter to look up the source string in the App Resources strings and returns its value, if found |
-| [StringFormatConverter](/dotnet/api/microsoft.toolkit.uwp.ui.converters.stringformatconverter?view=uwp-toolkit-dotnet) | Converts a source object to the formatted string version using [string.Format](/dotnet/api/system.string.format?view=netframework-4.7). The ConverterParameter provides the string format |
-| [StringVisibilityConverter](/dotnet/api/microsoft.toolkit.uwp.ui.converters.stringvisibilityconverter?view=uwp-toolkit-dotnet) | Converts a string value into a Visibility enumeration (if the value is null or empty returns a collapsed value) |
-| [ToolbarFormatActiveConverter](/dotnet/api/microsoft.toolkit.uwp.ui.converters.toolbarformatactiveconverter?view=uwp-toolkit-dotnet) | Compares if Formats are equal and returns bool |
-| [VisibilityToBoolConverter](/dotnet/api/microsoft.toolkit.uwp.ui.converters.visibilitytoboolconverter?view=uwp-toolkit-dotnet) | This class converts a Visibility enumeration to a boolean value |
+Converters are an easy way to handle situations where the source and target properties are of a different type. These are often declared in the `.Resources` of your app or page and can be referenced in XAML. In some cases, default converter values can be inverted by setting `ConverterParameter=True`.
-## BoolToObjectConverter Examples
+## BoolNegationConverter
+Converts a boolean to the inverse value (True to False and vice versa)
-`BoolToObjectConverter` can be used to generalize the behavior of `BoolToVisibilityConverter` by allowing to pass the two values it can return.
-You can use it to switch Visibility by declaring it :
+> [!Sample BoolNegationConverterSample]
-```xaml
-
+## BoolToObjectConverter
+Converts a boolean value into an other object. Can be used to convert true/false to e.g. visibility, color, or different images.
-
-
-
-```
+> [!Sample BoolToObjectConverterSample]
-and using it like that :
+## BoolToVisibilityConverter
+ Converts a boolean value into a `Visibility` enumeration. The `ConverterParameter` can be used to invert the logic.
-```xaml
-
-```
+> [!Sample BoolToVisibilityConverterSample]
-It can also be used to switch between two values of brush.
+## ColorToDisplayNameConverter
+Converts a color to the approximated display name.
-Note : you can use a resource for the brush or pass the color string and have it converted to a brush automatically.
+> [!Sample ColorToDisplayNameConverterSample]
-```xaml
-
-
-
-```
+## DoubleToObjectConverter
+Converts a double value into an other object. Can be used to convert doubles to e.g. visibility, colors , or different images. If `GreaterThan` and `LessThan` are both set, the logic looks for a value between the two values. Otherwise the logic looks for the value to be `GreaterThan` or `LessThan` the specified value.
-and using it like that :
+> [!Sample DoubleToObjectConverterSample]
-```xaml
-
-```
+## DoubleToVisibilityConverter
+Converts a double value into an other object. Can be used to convert doubles to e.g. visibility, colors , or different images. If `GreaterThan` and `LessThan` are both set, the logic looks for a value between the two values. Otherwise the logic looks for the value to be `GreaterThan` or `LessThan` the specified value.
-An other example is to switch between two images by specifying their source :
+> [!Sample DoubleToVisibilityConverterSample]
-```xaml
-
-
-
-```
+## EmptyCollectionToObjectConverter & CollectionVisibilityConverter
+Converts a collection size into an other object. Can be used to convert to bind a visibility, a color or an image to the size of the collection. The `CollectionVisibilityConverter` is derived from it and can be easily used to convert a collection into a `Visibility` enumeration (Collapsed if the given collection is empty or null).
+Note: this converter only checks the initial state of a collection and does not detect any updates. For that scenario, using a `IsNullOrEmptyStateTrigger` is more appropriate.
-and using it like that :
+> [!Sample CollectionVisibilityConverterSample]
-```xaml
-
-```
+## EmptyObjectToObjectConverter, EmptyStringToObjectConverter & StringToVisibilityConverter
+Converts an object value into a an object (if the value is null returns the false value). Can be used to bind a visibility, a color or an image to the value of an object.
+The `EmptyStringToObjectConverter` converts a string value into a an object (if the value is null or empty returns the false value). Can be used to bind a visibility, a color or an image to the value of a string.
-## BoolToVisibilityConverter Examples
+> [!Sample EmptyStringToObjectConverterSample]
-`BoolToVisibilityConverter` can be used to easily change a boolean value to a Visibility based one.
-If targeting 14393 or later, this is done automatically through [x:Bind](/windows/uwp/xaml-platform/x-bind-markup-extension). First, declare the converter in your resources:
+## FileSizeToFriendlyStringConverter
+Converts a file size in bytes to a more human-readable friendly format using `ToFileSizeString(Int64)`.
-```xaml
-
-
-
-```
+> [!Sample FileSizeToFriendlyStringConverterSample]
-and use it like this :
+## ResourceNameToResourceStringConverter
+Converts a source string from the App resources and returns its value, if found.
-```xaml
-
-```
-
-you can also invert the boolean as a ConverterParameter:
-
-```xaml
-
-```
-
-or if you want to not pass a parameter, you can use `BoolToObjectConverter` to create an `InverseBoolToVisibilityConveter`:
-
-```xaml
-
-
-
-```
-
-## DoubleToVisibilityConverter Examples
-
-`DoubleToVisibilityConverter` can be used to easily change a double value to a Visibility based one based on a given threshold value. If both `GreaterThan` and `LessThan` are set, the converter will set the visibility if the target value is in-between those two values. Otherwise, it will look for the target being greater than or less than the specified value.
-
-If a `True` value is provided for a `ConverterParameter` than the equation will be inverted.
-
-```xaml
-
-
-
-```
-
-and use it like this :
-
-```xaml
-
-```
-
-## EmptyObjectToObjectConverter Examples
-
-`EmptyObjectToObjectConverter`, `EmptyCollectionToObjectConverter`, and `EmptyStringToObjectConverter` work similarly to the `BoolToObjectConverter` except using `EmptyValue` and `NotEmptyValue` instead of `TrueValue`/`FalseValue`.
-
-They inspect the type of 'empty'/null object value and return the specific value `EmptyValue` or `NotEmptyValue` based on the result.
-That result can also be inverted withe a ConverterParameter.
-
-For instance you can generalize the `CollectionVisibilityConverter` using the `EmptyCollectionToObjectConverter`:
+## StringFormatConverter
+This allows you to format a string property upon binding wrapping [string.Format](/dotnet/api/system.string.format?view=netstandard-2.0).
+It only allows for a single input value (the binding string), but can be formatted with the regular string.Format
+methods.
-```xaml
-
-
-
-```
+> [!Sample StringFormatConverterSample]
-this can be used as follows to hide a list with no items and instead show text through inversion with the ConverterParameter:
+## StringVisibilityConverter
+Converts a string value into a Visibility value (if the value is null or empty returns a collapsed value).
-```xaml
-
+> [!Sample StringVisibilityConverterSample]
-
-```
+## TaskResultConverter
+Converter that can be used to safely retrieve results from `Task` instances. See the [MVVM Toolkit Gallery](https://aka.ms/mvvmtoolkit/app) for an example.
-## StringFormatConverter Examples
+## TypeToObjectConverter
+Returns an object or another, depending on whether the type of the provided value matches another provided Type.
+> [!Sample TypeToObjectConverterSample]
-`StringFormatConverter` allows you to format a string property upon binding wrapping [string.Format](/dotnet/api/system.string.format?view=netstandard-2.0).
-It only allows for a single input value (the binding string), but can be formatted with the regular string.Format
-methods. First, add it to your page resources:
+## VisibilityToBoolConverter
+Converts a `Visibility` enumaration to a boolean value.
-> [!Sample StringFormatConverterSample]
+> [!Sample VisibilityToBoolConverterSample]
diff --git a/components/Converters/samples/DoubleToObjectConverterSample.xaml b/components/Converters/samples/DoubleToObjectConverterSample.xaml
new file mode 100644
index 00000000..6daf153f
--- /dev/null
+++ b/components/Converters/samples/DoubleToObjectConverterSample.xaml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
diff --git a/components/Converters/samples/DoubleToObjectConverterSample.xaml.cs b/components/Converters/samples/DoubleToObjectConverterSample.xaml.cs
new file mode 100644
index 00000000..f55157d0
--- /dev/null
+++ b/components/Converters/samples/DoubleToObjectConverterSample.xaml.cs
@@ -0,0 +1,16 @@
+// 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 ConvertersExperiment.Samples;
+
+[ToolkitSampleNumericOption("NumericValue", 0, 0, 10, 1, false, Title = "Number")]
+
+[ToolkitSample(id: nameof(DoubleToObjectConverterSample), "DoubleToObjectConverter", description: $"A sample for showing how to use the DoubleToObjectConverter.")]
+public sealed partial class DoubleToObjectConverterSample : Page
+{
+ public DoubleToObjectConverterSample()
+ {
+ this.InitializeComponent();
+ }
+}
diff --git a/components/Converters/samples/DoubleToVisibilityConverterSample.xaml b/components/Converters/samples/DoubleToVisibilityConverterSample.xaml
new file mode 100644
index 00000000..f320628b
--- /dev/null
+++ b/components/Converters/samples/DoubleToVisibilityConverterSample.xaml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/Converters/samples/DoubleToVisibilityConverterSample.xaml.cs b/components/Converters/samples/DoubleToVisibilityConverterSample.xaml.cs
new file mode 100644
index 00000000..e594f0ca
--- /dev/null
+++ b/components/Converters/samples/DoubleToVisibilityConverterSample.xaml.cs
@@ -0,0 +1,16 @@
+// 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 ConvertersExperiment.Samples;
+
+[ToolkitSampleNumericOption("NumericValue", 0, 0, 10, 1, false, Title = "Number")]
+
+[ToolkitSample(id: nameof(DoubleToVisibilityConverterSample), "DoubleToVisibilityConverter", description: $"A sample for showing how to use the DoubleToObjectConverter.")]
+public sealed partial class DoubleToVisibilityConverterSample : Page
+{
+ public DoubleToVisibilityConverterSample()
+ {
+ this.InitializeComponent();
+ }
+}
diff --git a/components/Converters/samples/EmptyStringToObjectConverterSample.xaml b/components/Converters/samples/EmptyStringToObjectConverterSample.xaml
new file mode 100644
index 00000000..bd4b36bb
--- /dev/null
+++ b/components/Converters/samples/EmptyStringToObjectConverterSample.xaml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/Converters/samples/EmptyStringToObjectConverterSample.xaml.cs b/components/Converters/samples/EmptyStringToObjectConverterSample.xaml.cs
new file mode 100644
index 00000000..2e02589d
--- /dev/null
+++ b/components/Converters/samples/EmptyStringToObjectConverterSample.xaml.cs
@@ -0,0 +1,16 @@
+// 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 ConvertersExperiment.Samples;
+
+[ToolkitSampleTextOption("MyTextStringValue", "", Title = "Enter text to enable the button")]
+
+[ToolkitSample(id: nameof(EmptyStringToObjectConverterSample), "EmptyStringToObjectConverter", description: $"A sample for showing how to use the EmptyStringToObjectConverter.")]
+public sealed partial class EmptyStringToObjectConverterSample : Page
+{
+ public EmptyStringToObjectConverterSample()
+ {
+ this.InitializeComponent();
+ }
+}
diff --git a/components/Converters/samples/FileSizeToFriendlyStringConverterSample.xaml b/components/Converters/samples/FileSizeToFriendlyStringConverterSample.xaml
new file mode 100644
index 00000000..4a6a22ed
--- /dev/null
+++ b/components/Converters/samples/FileSizeToFriendlyStringConverterSample.xaml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/Converters/samples/FileSizeToFriendlyStringConverterSample.xaml.cs b/components/Converters/samples/FileSizeToFriendlyStringConverterSample.xaml.cs
new file mode 100644
index 00000000..eedafce5
--- /dev/null
+++ b/components/Converters/samples/FileSizeToFriendlyStringConverterSample.xaml.cs
@@ -0,0 +1,16 @@
+// 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 ConvertersExperiment.Samples;
+
+[ToolkitSample(id: nameof(FileSizeToFriendlyStringConverterSample), "FileSizeToFriendlyStringConverter", description: $"A sample for showing how to use the FileSizeToFriendlyStringConverter.")]
+public sealed partial class FileSizeToFriendlyStringConverterSample : Page
+{
+ public long FileSizeInBytes = 2400000;
+
+ public FileSizeToFriendlyStringConverterSample()
+ {
+ this.InitializeComponent();
+ }
+}
diff --git a/components/Converters/samples/StringFormatConverterSample.xaml b/components/Converters/samples/StringFormatConverterSample.xaml
index 8a791bac..f081aa36 100644
--- a/components/Converters/samples/StringFormatConverterSample.xaml
+++ b/components/Converters/samples/StringFormatConverterSample.xaml
@@ -13,11 +13,8 @@
-
-
+
-
-
-
+
diff --git a/components/Converters/samples/StringFormatConverterSample.xaml.cs b/components/Converters/samples/StringFormatConverterSample.xaml.cs
index 5e3c022c..b7e4bf00 100644
--- a/components/Converters/samples/StringFormatConverterSample.xaml.cs
+++ b/components/Converters/samples/StringFormatConverterSample.xaml.cs
@@ -9,8 +9,8 @@ namespace ConvertersExperiment.Samples;
///
/// An example sample page of a custom control inheriting from Panel.
///
-[ToolkitSampleBoolOption("MyBooleanValue", true, Title = "Is Loading?")]
-[ToolkitSampleNumericOption("MyDoubleValue", step:0.25, Title = "Display Value")]
+[ToolkitSampleBoolOption("MyBooleanValue", true, Title = "Is loading")]
+[ToolkitSampleNumericOption("MyDoubleValue", 1, 0, 10, 0.25, false, Title = "Number of pixels")]
[ToolkitSample(id: nameof(StringFormatConverterSample), "StringFormatConverter", description: $"A sample for showing how to use the StringFormatConverter.")]
public sealed partial class StringFormatConverterSample : Page
{
diff --git a/components/Converters/samples/StringVisibilityConverterSample.xaml b/components/Converters/samples/StringVisibilityConverterSample.xaml
new file mode 100644
index 00000000..3268b308
--- /dev/null
+++ b/components/Converters/samples/StringVisibilityConverterSample.xaml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/Converters/samples/StringVisibilityConverterSample.xaml.cs b/components/Converters/samples/StringVisibilityConverterSample.xaml.cs
new file mode 100644
index 00000000..3d50006f
--- /dev/null
+++ b/components/Converters/samples/StringVisibilityConverterSample.xaml.cs
@@ -0,0 +1,16 @@
+// 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 ConvertersExperiment.Samples;
+
+[ToolkitSampleTextOption("MyTextStringValue", "", Title = "Enter text to hide the TextBlock")]
+
+[ToolkitSample(id: nameof(StringVisibilityConverterSample), "StringVisibilityConverter", description: $"A sample for showing how to use the StringVisibilityConverter.")]
+public sealed partial class StringVisibilityConverterSample : Page
+{
+ public StringVisibilityConverterSample()
+ {
+ this.InitializeComponent();
+ }
+}
diff --git a/components/Converters/samples/TypeToObjectConverterSample.xaml b/components/Converters/samples/TypeToObjectConverterSample.xaml
new file mode 100644
index 00000000..c9852683
--- /dev/null
+++ b/components/Converters/samples/TypeToObjectConverterSample.xaml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+ 64
+
+
+ 44.44
+
+ I'm a String!
+
+
+
+
+
diff --git a/components/Converters/samples/TypeToObjectConverterSample.xaml.cs b/components/Converters/samples/TypeToObjectConverterSample.xaml.cs
new file mode 100644
index 00000000..39e7f3e3
--- /dev/null
+++ b/components/Converters/samples/TypeToObjectConverterSample.xaml.cs
@@ -0,0 +1,14 @@
+// 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 ConvertersExperiment.Samples;
+
+[ToolkitSample(id: nameof(TypeToObjectConverterSample), "TypeToObjectConverter", description: $"A sample for showing how to use the TypeToObjectConverter.")]
+public sealed partial class TypeToObjectConverterSample : Page
+{
+ public TypeToObjectConverterSample()
+ {
+ this.InitializeComponent();
+ }
+}
diff --git a/components/Converters/samples/VisibilityToBoolConverterSample.xaml b/components/Converters/samples/VisibilityToBoolConverterSample.xaml
new file mode 100644
index 00000000..2f187029
--- /dev/null
+++ b/components/Converters/samples/VisibilityToBoolConverterSample.xaml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/Converters/samples/VisibilityToBoolConverterSample.xaml.cs b/components/Converters/samples/VisibilityToBoolConverterSample.xaml.cs
new file mode 100644
index 00000000..6aedabcc
--- /dev/null
+++ b/components/Converters/samples/VisibilityToBoolConverterSample.xaml.cs
@@ -0,0 +1,16 @@
+// 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 ConvertersExperiment.Samples;
+
+[ToolkitSampleBoolOption("MyBooleanValue", true, Title = "Toggle to show or hide the image")]
+
+[ToolkitSample(id: nameof(VisibilityToBoolConverterSample), "VisibilityToBoolConverter", description: $"A sample for showing how to use the VisibilityToBoolConverter.")]
+public sealed partial class VisibilityToBoolConverterSample : Page
+{
+ public VisibilityToBoolConverterSample()
+ {
+ this.InitializeComponent();
+ }
+}
diff --git a/components/Converters/src/ColorToDisplayNameConverter.cs b/components/Converters/src/ColorToDisplayNameConverter.cs
index 5397691a..bc5a83f2 100644
--- a/components/Converters/src/ColorToDisplayNameConverter.cs
+++ b/components/Converters/src/ColorToDisplayNameConverter.cs
@@ -37,7 +37,8 @@ public object Convert(
#if !WINAPPSDK && !HAS_UNO
return Windows.UI.ColorHelper.ToDisplayName(color);
#else
- throw new NotSupportedException("See https://github.com/microsoft/microsoft-ui-xaml/issues/8287");
+ // ToDisplayName not yet supported on WASDK. See https://github.com/microsoft/microsoft-ui-xaml/issues/8287
+ return "Not supported";
#endif
}