diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml
index 0f2cc5b..9e453d8 100644
--- a/.github/ISSUE_TEMPLATE/bug.yml
+++ b/.github/ISSUE_TEMPLATE/bug.yml
@@ -21,7 +21,9 @@ body:
- "UI.Controls.ChipBox"
- "UI.Controls.DropDownList"
- "UI.Controls.FilePicker"
+ - "UI.Controls.RichEditToolbar"
- "UI.Controls.Validator"
+ - "UI.Data.Converters"
- "UI.Styling"
- "UI.ViewManagement"
- "UI.Views.Dialogs"
diff --git a/MADE-Uno.sln b/MADE-Uno.sln
index 9950765..3a42eb6 100644
--- a/MADE-Uno.sln
+++ b/MADE-Uno.sln
@@ -43,6 +43,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MADE.UI.Controls.ChipBox",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MADE.UI.Controls.RichEditToolbar", "src\MADE.UI.Controls.RichEditToolbar\MADE.UI.Controls.RichEditToolbar.csproj", "{258FB310-DC02-488C-97C7-CD1226EAAEC8}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MADE.UI.Data.Converters", "src\MADE.UI.Data.Converters\MADE.UI.Data.Converters.csproj", "{55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}"
+EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
samples\MADE.Samples\MADE.Samples.Shared\MADE.Samples.Shared.projitems*{04f1b32d-9056-43fc-b4c2-b8c5481bdacb}*SharedItemsImports = 4
@@ -1104,6 +1106,76 @@ Global
{258FB310-DC02-488C-97C7-CD1226EAAEC8}.Release|x64.Build.0 = Release|Any CPU
{258FB310-DC02-488C-97C7-CD1226EAAEC8}.Release|x86.ActiveCfg = Release|Any CPU
{258FB310-DC02-488C-97C7-CD1226EAAEC8}.Release|x86.Build.0 = Release|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Ad-Hoc|ARM64.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Ad-Hoc|ARM64.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.AppStore|Any CPU.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.AppStore|ARM.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.AppStore|ARM.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.AppStore|ARM64.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.AppStore|ARM64.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.AppStore|iPhone.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.AppStore|x64.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.AppStore|x64.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.AppStore|x86.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.AppStore|x86.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Debug|ARM.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Debug|ARM64.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Debug|iPhone.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Debug|x64.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Debug|x86.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Package|Any CPU.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Package|Any CPU.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Package|ARM.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Package|ARM.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Package|ARM64.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Package|ARM64.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Package|iPhone.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Package|iPhone.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Package|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Package|iPhoneSimulator.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Package|x64.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Package|x64.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Package|x86.ActiveCfg = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Package|x86.Build.0 = Debug|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Release|ARM.ActiveCfg = Release|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Release|ARM.Build.0 = Release|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Release|ARM64.ActiveCfg = Release|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Release|ARM64.Build.0 = Release|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Release|iPhone.ActiveCfg = Release|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Release|iPhone.Build.0 = Release|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Release|x64.ActiveCfg = Release|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Release|x64.Build.0 = Release|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Release|x86.ActiveCfg = Release|Any CPU
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -1126,6 +1198,7 @@ Global
{442D1E25-FFD1-405D-A1FC-40CAFCAD190C} = {01380FB8-F8A7-4416-AABA-5407574B7723}
{D1A16208-5A34-4CC1-B175-01B5AC99E69E} = {01380FB8-F8A7-4416-AABA-5407574B7723}
{258FB310-DC02-488C-97C7-CD1226EAAEC8} = {01380FB8-F8A7-4416-AABA-5407574B7723}
+ {55D12223-8B53-4EC7-8CD2-05FC8A84BA7C} = {01380FB8-F8A7-4416-AABA-5407574B7723}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3921AD86-E6C0-4436-8880-2D9EDFAD6151}
diff --git a/assets/SampleIcons.afdesign b/assets/SampleIcons.afdesign
index be606b8..dafcf75 100644
Binary files a/assets/SampleIcons.afdesign and b/assets/SampleIcons.afdesign differ
diff --git a/docs/articles/features/ui-data-converters.md b/docs/articles/features/ui-data-converters.md
new file mode 100644
index 0000000..b6687e4
--- /dev/null
+++ b/docs/articles/features/ui-data-converters.md
@@ -0,0 +1,62 @@
+---
+uid: package-ui-data-converters
+title: Using the UI Data Converters package
+---
+
+# Using the UI Data Converters package
+
+The UI Data Converters package is designed for making the conversion of data objects to a different type in native applications for Windows, Android, iOS, macOS, Linux, and the web easier.
+
+## Converting boolean values to a string (and back) with the BooleanToStringValueConverter
+
+The `MADE.UI.Data.Converters.BooleanToStringValueConverter` provides a way to convert a boolean value to a string and back with a bound data source in a XAML view.
+
+```xml
+
+
+
+
+
+
+
+
+
+
+
+```
+
+Instances of the converter can be set up with varying values for the `TrueValue` and `FalseValue` properties that will represent the value shown when the boolean is true and false, respectively. The default values are `Yes` and `No`.
+
+**Note**, when converting back from the string value to a boolean when used in a `TwoWay` binding, the `TrueValue` and `FalseValue` properties are used to determine which value is considered true and false. If the string value does not match, an exception will be thrown.
+
+## Displaying a byte array as an image with the ByteArrayToImageSourceValueConverter
+
+The `MADE.UI.Data.Converters.ByteArrayToImageSourceValueConverter` provides a way to convert a bound byte array containing the details of an image to an image source that can be bound to an `Image` XAML element.
+
+```xml
+
+
+
+
+
+
+
+
+```
+
+## Formatting a DateTime value with the DateTimeToStringValueConverter
+
+The `MADE.UI.Data.Converters.DateTimeToStringValueConverter` converts a given `DateTime` object into a string using the provided format in the binding `ConverterParameter` property.
+
+```xml
+
+
+
+
+
+
+
+
+```
+
+**Note**, the converter supports any of the standard and custom formats supported by the `DateTime.ToString()` method. You can [find more information on these in the Microsoft documentation](https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings).
diff --git a/docs/articles/intro.md b/docs/articles/intro.md
index e311533..2186aea 100644
--- a/docs/articles/intro.md
+++ b/docs/articles/intro.md
@@ -23,13 +23,15 @@ dotnet add package MADE.UI
| MADE.UI.Controls.ChipBox | [![NuGet](https://img.shields.io/nuget/v/MADE.UI.Controls.ChipBox)](https://www.nuget.org/packages/MADE.UI.Controls.ChipBox/) |
| MADE.UI.Controls.DropDownList | [![NuGet](https://img.shields.io/nuget/v/MADE.UI.Controls.DropDownList)](https://www.nuget.org/packages/MADE.UI.Controls.DropDownList/) |
| MADE.UI.Controls.FilePicker | [![NuGet](https://img.shields.io/nuget/v/MADE.UI.Controls.FilePicker)](https://www.nuget.org/packages/MADE.UI.Controls.FilePicker/) |
+| MADE.UI.Controls.RichEditToolbar | [![NuGet](https://img.shields.io/nuget/v/MADE.UI.Controls.RichEditToolbar)](https://www.nuget.org/packages/MADE.UI.Controls.RichEditToolbar/) |
| MADE.UI.Controls.Validator | [![NuGet](https://img.shields.io/nuget/v/MADE.UI.Controls.Validator)](https://www.nuget.org/packages/MADE.UI.Controls.Validator/) |
+| MADE.UI.Data.Converters | [![NuGet](https://img.shields.io/nuget/v/MADE.UI.Data.Converters)](https://www.nuget.org/packages/MADE.UI.Data.Converters/) |
| MADE.UI.Styling | [![NuGet](https://img.shields.io/nuget/v/MADE.UI.Styling)](https://www.nuget.org/packages/MADE.UI.Styling/) |
| MADE.UI.ViewManagement | [![NuGet](https://img.shields.io/nuget/v/MADE.UI.ViewManagement)](https://www.nuget.org/packages/MADE.UI.ViewManagement/) |
#### UI
-The UI package is a base library for building out great user experiences for applications built for Windows, Android, iOS, and the web.
+The UI package is a base library for building out great user experiences for applications built for Windows, Android, iOS, and the web.
Taking advantage of the Uno Platform, the UI packages provide extensible features such as:
@@ -67,7 +69,7 @@ The control works in a similar way to the `ComboBox` element in the Windows SDK,
#### UI.Controls.FilePicker
-The UI Controls FilePicker library contains a cross-platform UI element that provides a web-like `` equivalent for native applications.
+The UI Controls FilePicker library contains a cross-platform UI element that provides a web-like `` equivalent for native applications.
The control provides the capability to select one or multiple files of given types and show them within the UI.
@@ -77,6 +79,18 @@ The control provides the capability to select one or multiple files of given typ
+#### UI.Controls.RichEditToolbar
+
+The UI Controls RichEditToolbar library contains a cross-platform UI element that provides customizable and extensible collection of buttons that activate rich text features in an associated RichEditBox.
+
+Think the InkToolbar equivalent for RichEditBox controls!
+
+
+
+[Discover UI.Controls.RichEditToolbar](features/ui-controls-filepicker.md)
+
+
+
#### UI.Controls.Validator
The UI Controls Validator library contains a cross-platform UI element that provides validation capabilities over any input element.
@@ -89,6 +103,16 @@ Taking advantage of the Data Validation library, you can simply and easily setup
+#### UI.Data.Converters
+
+The UI Data Converters package is designed for making the conversion of data objects to a different type in native applications for Windows, Android, iOS, macOS, Linux, and the web easier.
+
+
+
+[Discover UI.Data.Converters](features/ui-data-converters.md)
+
+
+
#### UI.Styling
The UI Styling library contains a collection of cross-platform UI styling components for improving the designing of applications.
@@ -98,3 +122,13 @@ The UI Styling library contains a collection of cross-platform UI styling compon
[Discover UI.Styling](features/ui-styling.md)
+
+#### UI.ViewManagement
+
+The UI View Management package is designed for improving how your applications can create and manage additional windows in Windows applications.
+
+
+
+[Discover UI.ViewManagement](features/ui-view-management.md)
+
+
diff --git a/docs/articles/toc.yml b/docs/articles/toc.yml
index b74f222..3e8efc4 100644
--- a/docs/articles/toc.yml
+++ b/docs/articles/toc.yml
@@ -14,8 +14,12 @@
href: features/ui-controls-dropdownlist.md
- name: FilePicker
href: features/ui-controls-filepicker.md
+ - name: RichEditToolbar
+ href: features/ui-controls-richedittoolbar.md
- name: Validator
href: features/ui-controls-validator.md
+ - name: Data Converters
+ href: features/ui-data-converters.md
- name: Styling
href: features/ui-styling.md
- name: View Management
diff --git a/samples/MADE.Samples/MADE.Samples.Droid/MADE.Samples.Droid.csproj b/samples/MADE.Samples/MADE.Samples.Droid/MADE.Samples.Droid.csproj
index bf04261..93e606b 100644
--- a/samples/MADE.Samples/MADE.Samples.Droid/MADE.Samples.Droid.csproj
+++ b/samples/MADE.Samples/MADE.Samples.Droid/MADE.Samples.Droid.csproj
@@ -80,6 +80,9 @@
5.0.0
+
+ 4.3.4
+ 2.1.0-uno.32
@@ -133,6 +136,10 @@
{e2b20928-dae2-4a9c-bdaf-d787b4f48391}MADE.UI.Controls.Validator
+
+ {55d12223-8b53-4ec7-8cd2-05fc8a84ba7c}
+ MADE.UI.Data.Converters
+ {f8d00106-0598-45e7-b92e-ef408249c02e}MADE.UI.Styling
diff --git a/samples/MADE.Samples/MADE.Samples.Shared/App.xaml b/samples/MADE.Samples/MADE.Samples.Shared/App.xaml
index a6d3413..477ca71 100644
--- a/samples/MADE.Samples/MADE.Samples.Shared/App.xaml
+++ b/samples/MADE.Samples/MADE.Samples.Shared/App.xaml
@@ -1,7 +1,10 @@
-
+
+
+
diff --git a/samples/MADE.Samples/MADE.Samples.Shared/Features/Home/ViewModels/MainPageViewModel.cs b/samples/MADE.Samples/MADE.Samples.Shared/Features/Home/ViewModels/MainPageViewModel.cs
index 076b69f..99276b0 100644
--- a/samples/MADE.Samples/MADE.Samples.Shared/Features/Home/ViewModels/MainPageViewModel.cs
+++ b/samples/MADE.Samples/MADE.Samples.Shared/Features/Home/ViewModels/MainPageViewModel.cs
@@ -25,6 +25,8 @@ public MainPageViewModel(INavigationService navigationService, IMessenger messen
public ICollection SampleGroups { get; } = GetSampleGroups();
+ public ICollection Samples => SampleGroups.SelectMany(x => x.Samples).ToList();
+
private static ICollection GetSampleGroups()
{
var controls = new SampleGroup
@@ -48,13 +50,18 @@ private static ICollection GetSampleGroups()
"InputValidator",
typeof(InputValidatorPage),
"/Features/Samples/Assets/InputValidator/InputValidator.png"),
- new Sample(
- "RichEditToolbar",
- typeof(RichEditToolbarPage),
- "/Features/Samples/Assets/RichEditToolbar/RichEditToolbar.png")
}
};
+#if WINDOWS_UWP
+ AddPlatformSpecificSample(
+ controls,
+ new Sample(
+ "RichEditToolbar",
+ typeof(RichEditToolbarPage),
+ "/Features/Samples/Assets/RichEditToolbar/RichEditToolbar.png"));
+#endif
+
var helpers = new SampleGroup
{
Name = "Helpers",
@@ -63,26 +70,35 @@ private static ICollection GetSampleGroups()
new Sample(
"AppDialog",
typeof(AppDialogPage),
- "/Features/Samples/Assets/AppDialog/AppDialog.png")
+ "/Features/Samples/Assets/AppDialog/AppDialog.png"),
+ new Sample(
+ "Value Converters",
+ typeof(ValueConvertersPage),
+ "/Features/Samples/Assets/ValueConverters/ValueConverters.png")
}
};
if (PlatformApiHelper.IsTypeSupported(typeof(WindowManager)))
{
- helpers.Samples.InsertAtPotentialIndex(
+ AddPlatformSpecificSample(
+ helpers,
new Sample(
"WindowManager",
typeof(WindowManagerPage),
- "/Features/Samples/Assets/WindowManager/WindowManager.png"),
- (item, compare) => compare.Name.IsLessThanOrEqualTo(item.Name));
+ "/Features/Samples/Assets/WindowManager/WindowManager.png"));
}
- var list = new List { controls, helpers };
+ var list = new List {controls, helpers};
return list;
}
- public ICollection Samples => SampleGroups.SelectMany(x => x.Samples).ToList();
+ private static void AddPlatformSpecificSample(SampleGroup sampleGroup, Sample sample)
+ {
+ sampleGroup.Samples.InsertAtPotentialIndex(
+ sample,
+ (item, compare) => compare.Name.IsLessThanOrEqualTo(item.Name));
+ }
private void NavigateToSample(Sample sample)
{
diff --git a/samples/MADE.Samples/MADE.Samples.Shared/Features/Samples/Assets/ValueConverters/BooleanToStringValueConverterXaml.txt b/samples/MADE.Samples/MADE.Samples.Shared/Features/Samples/Assets/ValueConverters/BooleanToStringValueConverterXaml.txt
new file mode 100644
index 0000000..bb03979
--- /dev/null
+++ b/samples/MADE.Samples/MADE.Samples.Shared/Features/Samples/Assets/ValueConverters/BooleanToStringValueConverterXaml.txt
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/MADE.Samples/MADE.Samples.Shared/Features/Samples/Assets/ValueConverters/ByteArrayToImageSourceValueConverterXaml.txt b/samples/MADE.Samples/MADE.Samples.Shared/Features/Samples/Assets/ValueConverters/ByteArrayToImageSourceValueConverterXaml.txt
new file mode 100644
index 0000000..970eb58
--- /dev/null
+++ b/samples/MADE.Samples/MADE.Samples.Shared/Features/Samples/Assets/ValueConverters/ByteArrayToImageSourceValueConverterXaml.txt
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/MADE.Samples/MADE.Samples.Shared/Features/Samples/Assets/ValueConverters/ValueConverters.png b/samples/MADE.Samples/MADE.Samples.Shared/Features/Samples/Assets/ValueConverters/ValueConverters.png
new file mode 100644
index 0000000..3e7cb18
Binary files /dev/null and b/samples/MADE.Samples/MADE.Samples.Shared/Features/Samples/Assets/ValueConverters/ValueConverters.png differ
diff --git a/samples/MADE.Samples/MADE.Samples.Shared/Features/Samples/Pages/ValueConvertersPage.xaml b/samples/MADE.Samples/MADE.Samples.Shared/Features/Samples/Pages/ValueConvertersPage.xaml
new file mode 100644
index 0000000..9492333
--- /dev/null
+++ b/samples/MADE.Samples/MADE.Samples.Shared/Features/Samples/Pages/ValueConvertersPage.xaml
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/MADE.Samples/MADE.Samples.Shared/Features/Samples/Pages/ValueConvertersPage.xaml.cs b/samples/MADE.Samples/MADE.Samples.Shared/Features/Samples/Pages/ValueConvertersPage.xaml.cs
new file mode 100644
index 0000000..b8ac4f7
--- /dev/null
+++ b/samples/MADE.Samples/MADE.Samples.Shared/Features/Samples/Pages/ValueConvertersPage.xaml.cs
@@ -0,0 +1,21 @@
+namespace MADE.Samples.Features.Samples.Pages
+{
+ using CommunityToolkit.Mvvm.Messaging;
+ using MADE.Samples.Features.Samples.ViewModels;
+ using MADE.UI.Views.Navigation;
+ using MADE.UI.Views.Navigation.Pages;
+ using Microsoft.Extensions.DependencyInjection;
+
+ public sealed partial class ValueConvertersPage : MvvmPage
+ {
+ public ValueConvertersPage()
+ {
+ this.InitializeComponent();
+ this.DataContext = new ValueConvertersPageViewModel(
+ App.Services.GetService(),
+ App.Services.GetService());
+ }
+
+ public ValueConvertersPageViewModel ViewModel => this.DataContext as ValueConvertersPageViewModel;
+ }
+}
\ No newline at end of file
diff --git a/samples/MADE.Samples/MADE.Samples.Shared/Features/Samples/ViewModels/ValueConvertersPageViewModel.cs b/samples/MADE.Samples/MADE.Samples.Shared/Features/Samples/ViewModels/ValueConvertersPageViewModel.cs
new file mode 100644
index 0000000..a65f119
--- /dev/null
+++ b/samples/MADE.Samples/MADE.Samples.Shared/Features/Samples/ViewModels/ValueConvertersPageViewModel.cs
@@ -0,0 +1,53 @@
+namespace MADE.Samples.Features.Samples.ViewModels
+{
+ using System.IO;
+ using System.Net.Http;
+ using System.Threading.Tasks;
+ using CommunityToolkit.Mvvm.Messaging;
+ using MADE.Networking.Http.Requests.Streams;
+ using MADE.UI.Views.Navigation;
+ using MADE.UI.Views.Navigation.ViewModels;
+ using Windows.UI.Xaml.Navigation;
+
+ public class ValueConvertersPageViewModel : PageViewModel
+ {
+ private byte[] imageBytes;
+
+ public ValueConvertersPageViewModel(INavigationService navigationService, IMessenger messenger)
+ : base(navigationService, messenger)
+ {
+ }
+
+ public bool True => true;
+
+ public bool False => false;
+
+ public byte[] ImageBytes
+ {
+ get => this.imageBytes;
+ set => this.SetProperty(ref this.imageBytes, value);
+ }
+
+ public override async void OnNavigatedTo(NavigationEventArgs e)
+ {
+ base.OnNavigatedTo(e);
+ await this.GetImageBytesAsync();
+ }
+
+ private async Task GetImageBytesAsync()
+ {
+#if __WASM__
+ var handler = new Uno.UI.Wasm.WasmHttpHandler();
+ var httpClient = new HttpClient(handler);
+#else
+ var httpClient = new HttpClient();
+#endif
+
+ var imageRequest = new StreamGetNetworkRequest(httpClient, "http://placekitten.com/420/420");
+ var contentStream = await imageRequest.ExecuteAsync();
+ MemoryStream ms = new MemoryStream();
+ contentStream.CopyTo(ms);
+ this.ImageBytes = ms.ToArray();
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/MADE.Samples/MADE.Samples.Shared/MADE.Samples.Shared.projitems b/samples/MADE.Samples/MADE.Samples.Shared/MADE.Samples.Shared.projitems
index 59c075d..7187f7c 100644
--- a/samples/MADE.Samples/MADE.Samples.Shared/MADE.Samples.Shared.projitems
+++ b/samples/MADE.Samples/MADE.Samples.Shared/MADE.Samples.Shared.projitems
@@ -42,6 +42,9 @@
RichEditToolbarPage.xaml
+
+ ValueConvertersPage.xaml
+ WindowManagerPage.xaml
@@ -51,6 +54,7 @@
+ SampleControl.xaml
@@ -123,6 +127,17 @@
+
+ Designer
+
+
+
+
+ Designer
+
+
+
+ Designer
@@ -162,6 +177,10 @@
DesignerMSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+ DesignerMSBuild:Compile
diff --git a/samples/MADE.Samples/MADE.Samples.UWP/MADE.Samples.UWP.csproj b/samples/MADE.Samples/MADE.Samples.UWP/MADE.Samples.UWP.csproj
index 0c0f2a8..6d630e4 100644
--- a/samples/MADE.Samples/MADE.Samples.UWP/MADE.Samples.UWP.csproj
+++ b/samples/MADE.Samples/MADE.Samples.UWP/MADE.Samples.UWP.csproj
@@ -178,6 +178,10 @@
{e2b20928-dae2-4a9c-bdaf-d787b4f48391}MADE.UI.Controls.Validator
+
+ {55d12223-8b53-4ec7-8cd2-05fc8a84ba7c}
+ MADE.UI.Data.Converters
+ {f8d00106-0598-45e7-b92e-ef408249c02e}MADE.UI.Styling
diff --git a/samples/MADE.Samples/MADE.Samples.Wasm/MADE.Samples.Wasm.csproj b/samples/MADE.Samples/MADE.Samples.Wasm/MADE.Samples.Wasm.csproj
index e922015..f671507 100644
--- a/samples/MADE.Samples/MADE.Samples.Wasm/MADE.Samples.Wasm.csproj
+++ b/samples/MADE.Samples/MADE.Samples.Wasm/MADE.Samples.Wasm.csproj
@@ -68,6 +68,7 @@
+
diff --git a/samples/MADE.Samples/MADE.Samples.iOS/MADE.Samples.iOS.csproj b/samples/MADE.Samples/MADE.Samples.iOS/MADE.Samples.iOS.csproj
index 2cc2ab8..fdeaa30 100644
--- a/samples/MADE.Samples/MADE.Samples.iOS/MADE.Samples.iOS.csproj
+++ b/samples/MADE.Samples/MADE.Samples.iOS/MADE.Samples.iOS.csproj
@@ -132,6 +132,9 @@
5.0.0
+
+ 4.3.4
+ 2.1.0-uno.32
@@ -198,6 +201,10 @@
{e2b20928-dae2-4a9c-bdaf-d787b4f48391}MADE.UI.Controls.Validator
+
+ {55d12223-8b53-4ec7-8cd2-05fc8a84ba7c}
+ MADE.UI.Data.Converters
+ {f8d00106-0598-45e7-b92e-ef408249c02e}MADE.UI.Styling
diff --git a/src/MADE.UI.Controls.ChipBox/MADE.UI.Controls.ChipBox.csproj b/src/MADE.UI.Controls.ChipBox/MADE.UI.Controls.ChipBox.csproj
index dc71d2f..19aad58 100644
--- a/src/MADE.UI.Controls.ChipBox/MADE.UI.Controls.ChipBox.csproj
+++ b/src/MADE.UI.Controls.ChipBox/MADE.UI.Controls.ChipBox.csproj
@@ -18,10 +18,6 @@
-
-
-
-
Designer
diff --git a/src/MADE.UI.Controls.FilePicker/MADE.UI.Controls.FilePicker.csproj b/src/MADE.UI.Controls.FilePicker/MADE.UI.Controls.FilePicker.csproj
index 38edefc..1361832 100644
--- a/src/MADE.UI.Controls.FilePicker/MADE.UI.Controls.FilePicker.csproj
+++ b/src/MADE.UI.Controls.FilePicker/MADE.UI.Controls.FilePicker.csproj
@@ -18,7 +18,6 @@
-
diff --git a/src/MADE.UI.Controls.RichEditToolbar/MADE.UI.Controls.RichEditToolbar.csproj b/src/MADE.UI.Controls.RichEditToolbar/MADE.UI.Controls.RichEditToolbar.csproj
index 969cb35..f2f880b 100644
--- a/src/MADE.UI.Controls.RichEditToolbar/MADE.UI.Controls.RichEditToolbar.csproj
+++ b/src/MADE.UI.Controls.RichEditToolbar/MADE.UI.Controls.RichEditToolbar.csproj
@@ -17,12 +17,6 @@
-
-
-
-
-
-
Designer
diff --git a/src/MADE.UI.Data.Converters/BooleanToStringValueConverter.cs b/src/MADE.UI.Data.Converters/BooleanToStringValueConverter.cs
new file mode 100644
index 0000000..0679be3
--- /dev/null
+++ b/src/MADE.UI.Data.Converters/BooleanToStringValueConverter.cs
@@ -0,0 +1,135 @@
+// MADE Apps licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace MADE.UI.Data.Converters
+{
+ using System;
+ using MADE.Data.Converters;
+ using MADE.Data.Converters.Exceptions;
+ using MADE.Data.Converters.Strings;
+ using Windows.UI.Xaml;
+ using Windows.UI.Xaml.Data;
+
+ ///
+ /// Defines a XAML value converter for converting from to .
+ ///
+ public partial class BooleanToStringValueConverter : DependencyObject, IValueConverter, IValueConverter
+ {
+ ///
+ /// Defines the dependency property for .
+ ///
+ public static readonly DependencyProperty TrueValueProperty =
+ DependencyProperty.Register(
+ nameof(TrueValue),
+ typeof(string),
+ typeof(BooleanToStringValueConverter),
+ new PropertyMetadata(Resources.BooleanToStringValueConverter_TrueValue));
+
+ ///
+ /// Defines the dependency property for .
+ ///
+ public static readonly DependencyProperty FalseValueProperty =
+ DependencyProperty.Register(
+ nameof(FalseValue),
+ typeof(string),
+ typeof(BooleanToStringValueConverter),
+ new PropertyMetadata(Resources.BooleanToStringValueConverter_FalseValue));
+
+ ///
+ /// Gets or sets the positive/true value.
+ ///
+ public string TrueValue
+ {
+ get => (string)this.GetValue(TrueValueProperty);
+ set => this.SetValue(TrueValueProperty, value);
+ }
+
+ ///
+ /// Gets or sets the negative/false value.
+ ///
+ public string FalseValue
+ {
+ get => (string)this.GetValue(FalseValueProperty);
+ set => this.SetValue(FalseValueProperty, value);
+ }
+
+ ///
+ /// Converts the value to the type.
+ ///
+ /// The value to convert.
+ /// The target type (unused).
+ /// The optional parameter used to help with conversion (unused).
+ /// The display language for the conversion (unused).
+ /// The converted object.
+ public object Convert(object value, Type targetType, object parameter, string language)
+ {
+ return value switch
+ {
+ bool b => this.Convert(b, parameter),
+ _ => value
+ };
+ }
+
+ ///
+ /// Converts the value back to the type.
+ ///
+ /// The value to convert.
+ /// The target type (unused).
+ /// The optional parameter used to help with conversion (unused).
+ /// The display language for the conversion (unused).
+ /// The converted object.
+ /// Thrown if the value converting back to is not known by the converter.
+ public object ConvertBack(object value, Type targetType, object parameter, string language)
+ {
+ return value is not string b ? value : this.ConvertBack(b, parameter);
+ }
+
+ ///
+ /// Converts the value to the type.
+ ///
+ ///
+ /// The value to convert.
+ ///
+ ///
+ /// The optional parameter used to help with conversion.
+ ///
+ ///
+ /// The converted object.
+ ///
+ public string Convert(bool value, object parameter = default)
+ {
+ return value ? this.TrueValue : this.FalseValue;
+ }
+
+ ///
+ /// Converts the value back to the type.
+ ///
+ ///
+ /// The value to convert.
+ ///
+ ///
+ /// The optional parameter used to help with conversion.
+ ///
+ ///
+ /// The converted object.
+ ///
+ /// Thrown if the value converting back to is not known by the converter.
+ public bool ConvertBack(string value, object parameter = default)
+ {
+ if (value == this.TrueValue)
+ {
+ return true;
+ }
+
+ if (value == this.FalseValue)
+ {
+ return false;
+ }
+
+ throw new InvalidDataConversionException(
+ nameof(BooleanToStringValueConverter),
+ value,
+ $"The value to convert back is not of the expected {nameof(this.TrueValue)} or {nameof(this.FalseValue)}");
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/MADE.UI.Data.Converters/ByteArrayToImageSourceValueConverter.cs b/src/MADE.UI.Data.Converters/ByteArrayToImageSourceValueConverter.cs
new file mode 100644
index 0000000..b346d12
--- /dev/null
+++ b/src/MADE.UI.Data.Converters/ByteArrayToImageSourceValueConverter.cs
@@ -0,0 +1,77 @@
+// MADE Apps licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace MADE.UI.Data.Converters
+{
+ using System;
+ using MADE.Data.Converters;
+ using MADE.UI.Data.Converters.Extensions;
+ using Windows.UI.Xaml;
+ using Windows.UI.Xaml.Data;
+ using Windows.UI.Xaml.Media.Imaging;
+
+ ///
+ /// Defines a XAML value converter for converting from a array to .
+ ///
+ public class ByteArrayToImageSourceValueConverter : IValueConverter, IValueConverter
+ {
+ ///
+ /// Converts the value to the type.
+ ///
+ /// The value to convert.
+ /// The target type (unused).
+ /// The optional parameter used to help with conversion (unused).
+ /// The display language for the conversion (unused).
+ /// The converted object.
+ public object Convert(object value, Type targetType, object parameter, string language)
+ {
+ return value switch
+ {
+ byte[] bytes => this.Convert(bytes),
+ _ => value
+ };
+ }
+
+ ///
+ /// Converting back from to a array is not supported.
+ ///
+ /// The value to convert (unused).
+ /// The target type (unused).
+ /// The optional parameter used to help with conversion (unused).
+ /// The display language for the conversion (unused).
+ ///
+ /// An unset value.
+ ///
+ public object ConvertBack(object value, Type targetType, object parameter, string language)
+ {
+ return DependencyProperty.UnsetValue;
+ }
+
+ ///
+ /// Converts the value to the type.
+ ///
+ /// The value to convert.
+ ///
+ /// The optional parameter used to help with conversion.
+ ///
+ ///
+ /// The converted object.
+ ///
+ public BitmapSource Convert(byte[] value, object parameter = null)
+ {
+ return value.ToBitmapSource();
+ }
+
+ ///
+ /// Converting back from to a array is not supported.
+ ///
+ ///
+ /// The converted object.
+ ///
+ public byte[] ConvertBack(BitmapSource value, object parameter = null)
+ {
+ // Not supported.
+ return null;
+ }
+ }
+}
diff --git a/src/MADE.UI.Data.Converters/DateTimeToStringValueConverter.cs b/src/MADE.UI.Data.Converters/DateTimeToStringValueConverter.cs
new file mode 100644
index 0000000..51bdbf3
--- /dev/null
+++ b/src/MADE.UI.Data.Converters/DateTimeToStringValueConverter.cs
@@ -0,0 +1,98 @@
+// MADE Apps licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace MADE.UI.Data.Converters
+{
+ using System;
+ using System.Globalization;
+ using MADE.Data.Converters;
+ using Windows.UI.Xaml.Data;
+
+ ///
+ /// Defines a XAML value converter for converting from to with an optional format string.
+ ///
+ public class DateTimeToStringValueConverter : IValueConverter, IValueConverter
+ {
+ ///
+ /// Converts the value to the type.
+ ///
+ ///
+ /// The value to convert.
+ ///
+ /// The target type (unused).
+ ///
+ /// The optional string format parameter used to help with conversion.
+ ///
+ /// The display language for the conversion (unused).
+ ///
+ /// The converted object.
+ ///
+ public object Convert(object value, Type targetType, object parameter, string language)
+ {
+ return value switch
+ {
+ DateTime dateTime => this.Convert(dateTime, parameter?.ToString()),
+ _ => value
+ };
+ }
+
+ ///
+ /// Converts the value back to the type.
+ ///
+ /// The value to convert.
+ /// The target type (unused).
+ /// The optional parameter used to help with conversion (unused).
+ /// The display language for the conversion (unused).
+ ///
+ /// The converted object.
+ ///
+ public object ConvertBack(object value, Type targetType, object parameter, string language)
+ {
+ string dateTimeString = value?.ToString();
+ return this.ConvertBack(dateTimeString);
+ }
+
+ ///
+ /// Converts the value to the type.
+ ///
+ ///
+ /// The value to convert.
+ ///
+ ///
+ /// The optional parameter used to help with conversion.
+ ///
+ ///
+ /// The converted object.
+ ///
+ public string Convert(DateTime value, object parameter = default)
+ {
+ string format = parameter?.ToString();
+ return !string.IsNullOrWhiteSpace(format)
+ ? value.ToString(format, CultureInfo.InvariantCulture)
+ : value.ToString(CultureInfo.InvariantCulture);
+ }
+
+ ///
+ /// Converts the value back to the type.
+ ///
+ ///
+ /// The value to convert.
+ ///
+ ///
+ /// The optional parameter used to help with conversion.
+ ///
+ ///
+ /// The converted object.
+ ///
+ public DateTime ConvertBack(string value, object parameter = default)
+ {
+ if (string.IsNullOrWhiteSpace(value))
+ {
+ return DateTime.MinValue;
+ }
+
+ bool parsed = DateTime.TryParse(value, out DateTime dateTime);
+ return parsed ? dateTime : DateTime.MinValue;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/MADE.UI.Data.Converters/EmptyStringFormatValueConverter.cs b/src/MADE.UI.Data.Converters/EmptyStringFormatValueConverter.cs
new file mode 100644
index 0000000..c3b81cb
--- /dev/null
+++ b/src/MADE.UI.Data.Converters/EmptyStringFormatValueConverter.cs
@@ -0,0 +1,98 @@
+// MADE Apps licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace MADE.UI.Data.Converters
+{
+ using System;
+ using MADE.Data.Converters;
+ using Windows.UI.Xaml;
+ using Windows.UI.Xaml.Data;
+
+ ///
+ /// Defines a XAML value converter for converting an empty to a set value, or returning the non-empty value string.
+ ///
+ public partial class EmptyStringFormatValueConverter :
+ DependencyObject,
+ IValueConverter,
+ IValueConverter
+ {
+ ///
+ /// Defines the dependency property for .
+ ///
+ public static readonly DependencyProperty EmptyStringValueProperty =
+ DependencyProperty.Register(
+ nameof(EmptyStringValue),
+ typeof(string),
+ typeof(EmptyStringFormatValueConverter),
+ new PropertyMetadata("No value provided"));
+
+ ///
+ /// Gets or sets the value to show when the value is empty.
+ ///
+ public string EmptyStringValue
+ {
+ get => (string)this.GetValue(EmptyStringValueProperty);
+ set => this.SetValue(EmptyStringValueProperty, value);
+ }
+
+ ///
+ /// Converts the value to the if empty; otherwise, the value is returned.
+ ///
+ /// The value to convert.
+ /// The target type (unused).
+ /// The optional parameter used to help with conversion (unused).
+ /// The display language for the conversion (unused).
+ /// The converted object.
+ public object Convert(object value, Type targetType, object parameter, string language)
+ {
+ return this.Convert(value?.ToString(), parameter);
+ }
+
+ ///
+ /// Converts the value back to the value.
+ ///
+ /// The value to convert.
+ /// The target type (unused).
+ /// The optional parameter used to help with conversion (unused).
+ /// The display language for the conversion (unused).
+ /// The object.
+ public object ConvertBack(object value, Type targetType, object parameter, string language)
+ {
+ return this.ConvertBack(value?.ToString(), parameter);
+ }
+
+ ///
+ /// Converts the value to the if empty; otherwise, the value is returned.
+ ///
+ ///
+ /// The value to convert.
+ ///
+ ///
+ /// The optional parameter used to help with conversion.
+ ///
+ ///
+ /// The converted object.
+ ///
+ public string Convert(string value, object parameter = default)
+ {
+ return string.IsNullOrWhiteSpace(value) ? this.EmptyStringValue : value;
+ }
+
+ ///
+ /// Converts the value back to the value.
+ ///
+ ///
+ /// The value to convert.
+ ///
+ ///
+ /// The optional parameter used to help with conversion.
+ ///
+ ///
+ /// The converted object.
+ ///
+ public string ConvertBack(string value, object parameter = default)
+ {
+ return value == this.EmptyStringValue ? string.Empty : value;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/MADE.UI.Data.Converters/Extensions/ByteArrayExtensions.cs b/src/MADE.UI.Data.Converters/Extensions/ByteArrayExtensions.cs
new file mode 100644
index 0000000..984a38a
--- /dev/null
+++ b/src/MADE.UI.Data.Converters/Extensions/ByteArrayExtensions.cs
@@ -0,0 +1,53 @@
+// MADE Apps licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+namespace MADE.UI.Data.Converters.Extensions
+{
+ using System;
+ using System.IO;
+ using Windows.Storage.Streams;
+ using Windows.UI.Xaml.Media.Imaging;
+
+ ///
+ /// Defines a collection of extensions for array instances.
+ ///
+ public static class ByteArrayExtensions
+ {
+ ///
+ /// Converts an array of bytes representing an image into a .
+ ///
+ ///
+ /// The image bytes.
+ ///
+ ///
+ /// Returns a of the specified bytes.
+ ///
+ public static BitmapSource ToBitmapSource(this byte[] imageBytes)
+ {
+ BitmapSource bitmapSource = new BitmapImage();
+
+#if WINDOWS_UWP
+ using var raStream = new InMemoryRandomAccessStream();
+ using (var writer = new DataWriter(raStream))
+ {
+ // Write the bytes to the stream
+ writer.WriteBytes(imageBytes);
+
+ // Store the bytes to the MemoryStream
+ writer.StoreAsync().GetAwaiter().GetResult();
+
+ // Detach from the Memory stream so we don't close it
+ writer.DetachStream();
+ }
+
+ raStream.Seek(0);
+
+ bitmapSource.SetSource(raStream);
+#else
+ bitmapSource.SetSource(new MemoryStream(imageBytes) { Position = 0 });
+#endif
+
+ return bitmapSource;
+ }
+ }
+}
diff --git a/src/MADE.UI.Data.Converters/MADE.UI.Data.Converters.csproj b/src/MADE.UI.Data.Converters/MADE.UI.Data.Converters.csproj
new file mode 100644
index 0000000..bc674cd
--- /dev/null
+++ b/src/MADE.UI.Data.Converters/MADE.UI.Data.Converters.csproj
@@ -0,0 +1,33 @@
+
+
+
+ uap10.0.19041;MonoAndroid11.0;xamarinios10;netstandard2.0;xamarinmac20
+ true
+ MADE.NET UI Data Converters
+
+ This package includes UI components for Windows and Uno Platform applications such as:
+ - BooleanToStringValueConverter for converting between a boolean and a given string value.
+ - ByteArrayToImageSourceValueConverter for converting between a byte array and a BitmapSource for image source bindings.
+ - DateTimeToStringValueConverter for converting between a DateTime and string value.
+
+ MADE UI Data Value Converter Windows Android iOS macOS Xamarin Uno MVVM
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+ Designer
+ MSBuild:Compile
+ PreserveNewest
+
+
+
+
\ No newline at end of file