From 6801c2ca647424d7dcc3f05fcbe9c89c613c3a24 Mon Sep 17 00:00:00 2001 From: Shaun Lawrence Date: Fri, 14 Jan 2022 19:05:30 +0000 Subject: [PATCH 1/2] Declared xmlns for xaml suitable namespaces --- src/CommunityToolkit.Maui/AssemblyInfo.shared.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/CommunityToolkit.Maui/AssemblyInfo.shared.cs diff --git a/src/CommunityToolkit.Maui/AssemblyInfo.shared.cs b/src/CommunityToolkit.Maui/AssemblyInfo.shared.cs new file mode 100644 index 0000000000..1490093a74 --- /dev/null +++ b/src/CommunityToolkit.Maui/AssemblyInfo.shared.cs @@ -0,0 +1,10 @@ +[assembly: XmlnsDefinition(Constants.XamlNamespace, Constants.CommunityToolkitNamespacePrefix + nameof(CommunityToolkit.Maui.Alerts))] +[assembly: XmlnsDefinition(Constants.XamlNamespace, Constants.CommunityToolkitNamespacePrefix + nameof(CommunityToolkit.Maui.Behaviors))] +[assembly: XmlnsDefinition(Constants.XamlNamespace, Constants.CommunityToolkitNamespacePrefix + nameof(CommunityToolkit.Maui.Converters))] + +class Constants +{ + public const string XamlNamespace = "http://schemas.microsoft.com/dotnet/2022/maui/tookit"; + + public const string CommunityToolkitNamespacePrefix = nameof(CommunityToolkit) + "." + nameof(CommunityToolkit.Maui) + "."; +} \ No newline at end of file From 8c0b3ba73cab4c9405f10577793a4ebb0e9919ed Mon Sep 17 00:00:00 2001 From: Shaun Lawrence Date: Fri, 14 Jan 2022 19:05:51 +0000 Subject: [PATCH 2/2] Updated samples to use new namespace definition --- .../Pages/Alerts/SnackbarPage.xaml | 4 +- .../CharactersValidationBehaviorPage.xaml | 64 ++++++++-------- .../EmailValidationBehaviorPage.xaml | 4 +- .../Behaviors/EventToCommandBehaviorPage.xaml | 4 +- .../Pages/Behaviors/MaskedBehaviorPage.xaml | 16 ++-- .../MaxLengthReachedBehaviorPage.xaml | 12 +-- .../MultiValidationBehaviorPage.xaml | 74 +++++++++---------- .../NumericValidationBehaviorPage.xaml | 14 ++-- .../ProgressBarAnimationBehaviorPage.xaml | 4 +- .../RequiredStringValidationBehaviorPage.xaml | 18 ++--- .../Behaviors/TextValidationBehaviorPage.xaml | 12 +-- .../Behaviors/UriValidationBehaviorPage.xaml | 26 +++---- .../UserStoppedTypingBehaviorPage.xaml | 10 +-- .../Converters/BoolToObjectConverterPage.xaml | 8 +- .../Pages/Converters/ColorsConverterPage.xaml | 44 +++++------ .../DateTimeOffsetConverterPage.xaml | 4 +- .../Converters/DoubleToIntConverterPage.xaml | 4 +- .../Converters/EnumToBoolConverterPage.xaml | 1 - .../Converters/EnumToIntConverterPage.xaml | 4 +- .../Pages/Converters/EqualConverterPage.xaml | 4 +- .../ImageResourceConverterPage.xaml | 1 - .../IndexToArrayItemConverterPage.xaml | 4 +- .../Converters/IntToBoolConverterPage.xaml | 4 +- .../Converters/InvertedBoolConverterPage.xaml | 4 +- .../IsNotNullOrEmptyConverterPage.xaml | 4 +- .../IsNullOrEmptyConverterPage.xaml | 4 +- .../Converters/ItemTappedEventArgsPage.xaml | 4 +- .../ListIsNotNullOrEmptyConverterPage.xaml | 4 +- .../ListIsNullOrEmptyConverterPage.xaml | 4 +- .../Converters/ListToStringConverterPage.xaml | 4 +- .../MathExpressionConverterPage.xaml | 1 - .../Pages/Converters/MultiConverterPage.xaml | 1 - .../Converters/NotEqualConverterPage.xaml | 4 +- .../Converters/StringToListConverterPage.xaml | 10 +-- .../Converters/TextCaseConverterPage.xaml | 4 +- .../VariableMultiValueConverterPage.xaml | 1 - 36 files changed, 193 insertions(+), 196 deletions(-) diff --git a/samples/CommunityToolkit.Maui.Sample/Pages/Alerts/SnackbarPage.xaml b/samples/CommunityToolkit.Maui.Sample/Pages/Alerts/SnackbarPage.xaml index 5f72c48258..6dbfe015f3 100644 --- a/samples/CommunityToolkit.Maui.Sample/Pages/Alerts/SnackbarPage.xaml +++ b/samples/CommunityToolkit.Maui.Sample/Pages/Alerts/SnackbarPage.xaml @@ -2,12 +2,12 @@ - + diff --git a/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/CharactersValidationBehaviorPage.xaml b/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/CharactersValidationBehaviorPage.xaml index 1051e836db..67d77d0c90 100644 --- a/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/CharactersValidationBehaviorPage.xaml +++ b/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/CharactersValidationBehaviorPage.xaml @@ -3,7 +3,7 @@ x:Class="CommunityToolkit.Maui.Sample.Pages.Behaviors.CharactersValidationBehaviorPage" xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" - xmlns:mct="clr-namespace:CommunityToolkit.Maui.Behaviors;assembly=CommunityToolkit.Maui" + xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/tookit" xmlns:pages="clr-namespace:CommunityToolkit.Maui.Sample.Pages">