From 6aa3f894e2543c1bd1195062493172a6941284da Mon Sep 17 00:00:00 2001 From: sthewissen Date: Thu, 16 Jan 2025 14:44:15 +0100 Subject: [PATCH 1/9] Add shadow support to CSS + simpler initialization through type converter --- .../ShadowTypeConverter.xml | 62 ++++++++ .../netstandard/PublicAPI.Unshipped.txt | 6 + src/Controls/src/Core/ShadowTypeConverter.cs | 141 ++++++++++++++++++ .../src/Core/VisualElement/VisualElement.cs | 1 + .../tests/Core.UnitTests/ShadowTests.cs | 52 +++++++ 5 files changed, 262 insertions(+) create mode 100644 src/Controls/docs/Microsoft.Maui.Controls/ShadowTypeConverter.xml create mode 100644 src/Controls/src/Core/ShadowTypeConverter.cs diff --git a/src/Controls/docs/Microsoft.Maui.Controls/ShadowTypeConverter.xml b/src/Controls/docs/Microsoft.Maui.Controls/ShadowTypeConverter.xml new file mode 100644 index 000000000000..8617869c7cc0 --- /dev/null +++ b/src/Controls/docs/Microsoft.Maui.Controls/ShadowTypeConverter.xml @@ -0,0 +1,62 @@ + + + + + + + Microsoft.Maui.Controls.Core + 0.0.0.0 + 2.0.0.0 + + + System.ComponentModel.TypeConverter + + + + + Microsoft.Maui.Controls.Xaml.TypeConversion(typeof(System.Collections.Generic.List`1<System.String>)) + + + + Type converter for converting a properly formatted string to a Shadow. + + + + + + + Constructor + + 0.0.0.0 + 2.0.0.0 + Microsoft.Maui.Controls.Core + + + + Creates a new object. + + + + + + + + Method + + 0.0.0.0 + 2.0.0.0 + Microsoft.Maui.Controls.Core + + + System.Object + + + + + + The value to convert. + Converts to a Shadow. + + + + diff --git a/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt index 4aa089b40e07..cd42f412a5ee 100644 --- a/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt @@ -10,6 +10,8 @@ *REMOVED*~Microsoft.Maui.Controls.NavigableElement.StyleClass.get -> System.Collections.Generic.IList *REMOVED*~Microsoft.Maui.Controls.NavigableElement.StyleClass.set -> void Microsoft.Maui.Controls.HybridWebView.SetInvokeJavaScriptTarget(T! target) -> void +Microsoft.Maui.Controls.ShadowTypeConverter +Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void Microsoft.Maui.Controls.StyleableElement.Style.get -> Microsoft.Maui.Controls.Style? ~Microsoft.Maui.Controls.ResourceDictionary.SetAndCreateSource(System.Uri value) -> void ~Microsoft.Maui.Controls.Internals.TypedBindingBase.UpdateSourceEventName.set -> void @@ -17,6 +19,10 @@ Microsoft.Maui.Controls.StyleableElement.Style.get -> Microsoft.Maui.Controls.St ~Microsoft.Maui.Controls.WebViewProcessTerminatedEventArgs.PlatformArgs.get -> Microsoft.Maui.Controls.PlatformWebViewProcessTerminatedEventArgs ~Microsoft.Maui.Controls.Xaml.RequireServiceAttribute.RequireServiceAttribute(System.Type[] serviceTypes) -> void ~Microsoft.Maui.Controls.Xaml.RequireServiceAttribute.ServiceTypes.get -> System.Type[] +~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) -> bool +~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) -> bool +~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) -> object +~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) -> object ~override Microsoft.Maui.Controls.ShellContent.OnPropertyChanged(string propertyName = null) -> void *REMOVED*~static Microsoft.Maui.Controls.Application.ControlsApplicationMapper -> Microsoft.Maui.IPropertyMapper ~static Microsoft.Maui.Controls.Brush.DarkGrey.get -> Microsoft.Maui.Controls.SolidColorBrush diff --git a/src/Controls/src/Core/ShadowTypeConverter.cs b/src/Controls/src/Core/ShadowTypeConverter.cs new file mode 100644 index 000000000000..c8082cea136d --- /dev/null +++ b/src/Controls/src/Core/ShadowTypeConverter.cs @@ -0,0 +1,141 @@ +#nullable disable +using System; +using System.ComponentModel; +using System.Globalization; +using Microsoft.Maui.Graphics; + +namespace Microsoft.Maui.Controls +{ + /// + /// Type converter for converting a properly formatted string to a Shadow. + /// + public class ShadowTypeConverter : TypeConverter + { + /// + /// Checks whether the given is a string. + /// + /// The context to use for conversion. + /// The type to convert from. + /// + public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) + => sourceType == typeof(string); + + /// + /// Checks whether the given is a string. + /// + /// The context to use for conversion. + /// The type to convert to. + /// + public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) + => destinationType == typeof(string); + + /// + /// Converts to a Shadow. + /// + /// The context to use for conversion. + /// The culture to use for conversion. + /// The value to convert. + /// + /// Thrown when is null. + /// Thrown when is not a valid Shadow. + public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) + { + var strValue = value?.ToString(); + + if (strValue == null) + { + throw new ArgumentNullException(nameof(strValue)); + } + + var parts = strValue.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); + + try + { + if (parts.Length == 3) // | | e.g. #000000 4 4 + { + var brush = new SolidColorBrush(Color.FromArgb(parts[0])); + var offsetX = float.Parse(parts[1], CultureInfo.InvariantCulture); + var offsetY = float.Parse(parts[2], CultureInfo.InvariantCulture); + + return new Shadow + { + Brush = brush, + Offset = new Point(offsetX, offsetY) + }; + } + else if (parts.Length == 4) // | | | e.g. 4 4 16 #000000 + { + var offsetX = float.Parse(parts[0], CultureInfo.InvariantCulture); + var offsetY = float.Parse(parts[1], CultureInfo.InvariantCulture); + var radius = float.Parse(parts[2], CultureInfo.InvariantCulture); + var brush = new SolidColorBrush(Color.FromArgb(parts[3])); + + return new Shadow + { + Offset = new Point(offsetX, offsetY), + Radius = radius, + Brush = brush + }; + } + else if (parts.Length == 5) // | | | | e.g. 4 4 16 #000000 0.5 + { + var offsetX = float.Parse(parts[0], CultureInfo.InvariantCulture); + var offsetY = float.Parse(parts[1], CultureInfo.InvariantCulture); + var radius = float.Parse(parts[2], CultureInfo.InvariantCulture); + var brush = new SolidColorBrush(Color.FromArgb(parts[3])); + var opacity = float.Parse(parts[4], CultureInfo.InvariantCulture); + + return new Shadow + { + Offset = new Point(offsetX, offsetY), + Radius = radius, + Brush = brush, + Opacity = opacity + }; + } + } + catch (Exception ex) + { + throw new InvalidOperationException($"Cannot convert \"{strValue}\" into {typeof(Shadow)}.", ex); + } + + throw new InvalidOperationException($"Cannot convert \"{strValue}\" into {typeof(IShadow)}."); + } + + /// + /// Converts a Shadow to a string. + /// + /// The context to use for conversion. + /// The culture to use for conversion. + /// The Shadow to convert. + /// The type to convert to. + /// A string representation of the Shadow. + /// Thrown when is null. + /// Thrown when is not a Shadow or the Brush is not a SolidColorBrush. + public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) + { + if(value is null) + { + throw new ArgumentNullException(nameof(value)); + } + + if (value is Shadow shadow) + { + var offsetX = shadow.Offset.X.ToString(CultureInfo.InvariantCulture); + var offsetY = shadow.Offset.Y.ToString(CultureInfo.InvariantCulture); + var radius = shadow.Radius.ToString(CultureInfo.InvariantCulture); + var color = (shadow.Brush as SolidColorBrush)?.Color.ToHex(); + var opacity = shadow.Opacity.ToString(CultureInfo.InvariantCulture); + + if (color == null) + { + throw new InvalidOperationException("Cannot convert Shadow to string: Brush is not a valid SolidColorBrush or has no Color."); + } + + return $"{offsetX} {offsetY} {radius} {color} {opacity}"; + } + + throw new InvalidOperationException($"Cannot convert \"{value}\" into string."); + } + } +} \ No newline at end of file diff --git a/src/Controls/src/Core/VisualElement/VisualElement.cs b/src/Controls/src/Core/VisualElement/VisualElement.cs index 0fbda9c5facc..368b8f61e938 100644 --- a/src/Controls/src/Core/VisualElement/VisualElement.cs +++ b/src/Controls/src/Core/VisualElement/VisualElement.cs @@ -1851,6 +1851,7 @@ private protected override void OnHandlerChangedCore() /// /// Gets or sets the shadow effect cast by the element. This is a bindable property. /// + [TypeConverter(typeof(ShadowTypeConverter))] public Shadow Shadow { get { return (Shadow)GetValue(ShadowProperty); } diff --git a/src/Controls/tests/Core.UnitTests/ShadowTests.cs b/src/Controls/tests/Core.UnitTests/ShadowTests.cs index 4194c66e4c37..f1b2b6a0969e 100644 --- a/src/Controls/tests/Core.UnitTests/ShadowTests.cs +++ b/src/Controls/tests/Core.UnitTests/ShadowTests.cs @@ -1,3 +1,4 @@ +using System; using Microsoft.Maui.Graphics; using Xunit; @@ -27,5 +28,56 @@ public void ShadowInitializesCorrectly() Assert.Equal(expectedOpacity, shadow.Opacity); Assert.Equal(expectedRadius, shadow.Radius); } + + [Fact] + public void TestShadowTypeConverter() + { + var converter = new ShadowTypeConverter(); + Assert.True(converter.CanConvertFrom(typeof(string))); + + // Test converting from string to Shadow (format 1) + var shadow1 = (Shadow)converter.ConvertFromInvariantString("#000000 4 4"); + Assert.NotNull(shadow1); + Assert.Equal(Color.FromArgb("#000000"), (shadow1.Brush as SolidColorBrush)?.Color); + Assert.Equal(new Point(4, 4), shadow1.Offset); + + // Test converting from string to Shadow (format 2) + var shadow2 = (Shadow)converter.ConvertFromInvariantString("4 4 16 #FF00FF"); + Assert.NotNull(shadow2); + Assert.Equal(Color.FromArgb("#FF00FF"), (shadow2.Brush as SolidColorBrush)?.Color); + Assert.Equal(new Point(4, 4), shadow2.Offset); + Assert.Equal(16, shadow2.Radius); + + // Test converting from string to Shadow (format 3) + var shadow3 = (Shadow)converter.ConvertFromInvariantString("4 4 16 #00FF00 0.5"); + Assert.NotNull(shadow3); + Assert.Equal(Color.FromArgb("#00FF00"), (shadow3.Brush as SolidColorBrush)?.Color); + Assert.Equal(new Point(4, 4), shadow3.Offset); + Assert.Equal(16, shadow3.Radius); + Assert.Equal(0.5f, shadow3.Opacity); + + // Test for converting Shadow to a string + var shadow = new Shadow + { + Brush = new SolidColorBrush(Color.FromArgb("#123456")), + Offset = new Point(10, 20), + Radius = 30, + Opacity = 0.8f + }; + + var shadowString = converter.ConvertToInvariantString(shadow); + Assert.Equal("10 20 30 #123456 0.8", shadowString); + + // Test some problematic cases + Assert.Throws(() => converter.ConvertFromInvariantString(null)); + Assert.Throws(() => converter.ConvertFromInvariantString("")); + Assert.Throws(() => converter.ConvertFromInvariantString("invalid")); + Assert.Throws(() => converter.ConvertFromInvariantString("#ZZZZZZ 4 4")); + Assert.Throws(() => converter.ConvertFromInvariantString("4 4 #000000")); + + Assert.Throws(() => converter.ConvertToInvariantString(null)); + Assert.Throws(() => converter.ConvertToInvariantString("invalid")); + Assert.Throws(() => converter.ConvertToInvariantString(new { })); + } } } \ No newline at end of file From 30fd107ce142f225e701813f60162d24e21d62f3 Mon Sep 17 00:00:00 2001 From: sthewissen Date: Thu, 16 Jan 2025 14:45:47 +0100 Subject: [PATCH 2/9] CanConvertTo should be a Shadow as destinationtype --- src/Controls/src/Core/ShadowTypeConverter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Controls/src/Core/ShadowTypeConverter.cs b/src/Controls/src/Core/ShadowTypeConverter.cs index c8082cea136d..d8382834599a 100644 --- a/src/Controls/src/Core/ShadowTypeConverter.cs +++ b/src/Controls/src/Core/ShadowTypeConverter.cs @@ -21,13 +21,13 @@ public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceT => sourceType == typeof(string); /// - /// Checks whether the given is a string. + /// Checks whether the given is a Shadow. /// /// The context to use for conversion. /// The type to convert to. /// public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) - => destinationType == typeof(string); + => destinationType == typeof(Shadow); /// /// Converts to a Shadow. From 8cf9a0fbe3d2bc91da5ce368abaeedbe88d0c549 Mon Sep 17 00:00:00 2001 From: sthewissen Date: Thu, 16 Jan 2025 14:53:59 +0100 Subject: [PATCH 3/9] Update AssemblyInfo.cs --- src/Controls/src/Core/Properties/AssemblyInfo.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Controls/src/Core/Properties/AssemblyInfo.cs b/src/Controls/src/Core/Properties/AssemblyInfo.cs index 6b85c51555f6..0453e6f0ee7c 100644 --- a/src/Controls/src/Core/Properties/AssemblyInfo.cs +++ b/src/Controls/src/Core/Properties/AssemblyInfo.cs @@ -160,6 +160,8 @@ [assembly: StyleProperty("-maui-vertical-text-alignment", typeof(Label), nameof(TextAlignmentElement.VerticalTextAlignmentProperty))] [assembly: StyleProperty("-maui-thumb-color", typeof(Switch), nameof(Switch.ThumbColorProperty))] +[assembly: StyleProperty("-maui-shadow", typeof(VisualElement), nameof(VisualElement.ShadowProperty))] + //shell [assembly: StyleProperty("-maui-flyout-background", typeof(Shell), nameof(Shell.FlyoutBackgroundColorProperty))] [assembly: StyleProperty("-maui-shell-background", typeof(Element), nameof(Shell.BackgroundColorProperty), PropertyOwnerType = typeof(Shell))] From 4259c4e97d05b08175ecb206f3cada8f0aeaab77 Mon Sep 17 00:00:00 2001 From: Steven Thewissen Date: Mon, 20 Jan 2025 12:44:30 +0100 Subject: [PATCH 4/9] Use InlineData for tests and change parsing for colors/brushes --- src/Controls/src/Core/ShadowTypeConverter.cs | 77 ++++++++++++---- .../tests/Core.UnitTests/ShadowTests.cs | 87 +++++++++---------- 2 files changed, 102 insertions(+), 62 deletions(-) diff --git a/src/Controls/src/Core/ShadowTypeConverter.cs b/src/Controls/src/Core/ShadowTypeConverter.cs index d8382834599a..92f51739f2d3 100644 --- a/src/Controls/src/Core/ShadowTypeConverter.cs +++ b/src/Controls/src/Core/ShadowTypeConverter.cs @@ -1,8 +1,12 @@ #nullable disable + using System; using System.ComponentModel; using System.Globalization; +using System.Linq; +using System.Text.RegularExpressions; using Microsoft.Maui.Graphics; +using Microsoft.Maui.Graphics.Converters; namespace Microsoft.Maui.Controls { @@ -11,6 +15,8 @@ namespace Microsoft.Maui.Controls /// public class ShadowTypeConverter : TypeConverter { + readonly BrushTypeConverter _brushTypeConverter = new BrushTypeConverter(); + /// /// Checks whether the given is a string. /// @@ -47,15 +53,33 @@ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo c throw new ArgumentNullException(nameof(strValue)); } - var parts = strValue.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); - try { - if (parts.Length == 3) // | | e.g. #000000 4 4 + var regex = new Regex(@" + # Match colors + ( + \#([0-9a-fA-F]{3,8}) # Hex colors (#RGB, #RRGGBB, #RRGGBBAA) + |rgb\(\s*\d+%\s*,\s*\d+%\s*,\s*\d+%\s*\) # rgb(percent, percent, percent) + |rgba\(\s*\d+%\s*,\s*\d+%\s*,\s*\d+%\s*,\s*\d+(?:\.\d+)?\s*\) # rgba(percent, percent, percent, alpha) + |rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\) # rgb(int, int, int) + |rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*\d+(?:\.\d+)?\s*\) # rgba(int, int, int, alpha) + |hsl\(\s*\d+\s*,\s*\d+%\s*,\s*\d+%\s*\) # hsl(hue, saturation, lightness) + |hsla\(\s*\d+\s*,\s*\d+%\s*,\s*\d+%\s*,\s*\d+(?:\.\d+)?\s*\) # hsla(hue, saturation, lightness, alpha) + ) + | # Match numbers + ( + -?\d+(?:\.\d+)?(?:[eE][+-]?\d+)? # Floats or scientific notation + ) + ", RegexOptions.IgnorePatternWhitespace); + + var matches = regex.Matches(strValue); + //var parts = matches.Select(m => m.Value).ToArray(); + + if (matches.Count == 3) // | | e.g. #000000 4 4 { - var brush = new SolidColorBrush(Color.FromArgb(parts[0])); - var offsetX = float.Parse(parts[1], CultureInfo.InvariantCulture); - var offsetY = float.Parse(parts[2], CultureInfo.InvariantCulture); + var brush = ParseBrush(matches[0].Value); + var offsetX = float.Parse(matches[1].Value, CultureInfo.InvariantCulture); + var offsetY = float.Parse(matches[2].Value, CultureInfo.InvariantCulture); return new Shadow { @@ -63,12 +87,12 @@ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo c Offset = new Point(offsetX, offsetY) }; } - else if (parts.Length == 4) // | | | e.g. 4 4 16 #000000 + else if (matches.Count == 4) // | | | e.g. 4 4 16 #000000 { - var offsetX = float.Parse(parts[0], CultureInfo.InvariantCulture); - var offsetY = float.Parse(parts[1], CultureInfo.InvariantCulture); - var radius = float.Parse(parts[2], CultureInfo.InvariantCulture); - var brush = new SolidColorBrush(Color.FromArgb(parts[3])); + var offsetX = float.Parse(matches[0].Value, CultureInfo.InvariantCulture); + var offsetY = float.Parse(matches[1].Value, CultureInfo.InvariantCulture); + var radius = float.Parse(matches[2].Value, CultureInfo.InvariantCulture); + var brush = ParseBrush(matches[3].Value); return new Shadow { @@ -77,13 +101,13 @@ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo c Brush = brush }; } - else if (parts.Length == 5) // | | | | e.g. 4 4 16 #000000 0.5 + else if (matches.Count == 5) // | | | | e.g. 4 4 16 #000000 0.5 { - var offsetX = float.Parse(parts[0], CultureInfo.InvariantCulture); - var offsetY = float.Parse(parts[1], CultureInfo.InvariantCulture); - var radius = float.Parse(parts[2], CultureInfo.InvariantCulture); - var brush = new SolidColorBrush(Color.FromArgb(parts[3])); - var opacity = float.Parse(parts[4], CultureInfo.InvariantCulture); + var offsetX = float.Parse(matches[0].Value, CultureInfo.InvariantCulture); + var offsetY = float.Parse(matches[1].Value, CultureInfo.InvariantCulture); + var radius = float.Parse(matches[2].Value, CultureInfo.InvariantCulture); + var brush = ParseBrush(matches[3].Value); + var opacity = float.Parse(matches[4].Value, CultureInfo.InvariantCulture); return new Shadow { @@ -137,5 +161,22 @@ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo cul throw new InvalidOperationException($"Cannot convert \"{value}\" into string."); } + + /// + /// Parses a string value into a SolidColorBrush. + /// + /// The value to parse. + /// A SolidColorBrush. + /// Thrown when the value is not a SolidColorBrush or has no Color. + SolidColorBrush ParseBrush(string value) + { + // If the value is a color, return a SolidColorBrush + if (_brushTypeConverter.ConvertFrom(value) is SolidColorBrush solidColorBrush) + { + return solidColorBrush; + } + + throw new InvalidOperationException("Cannot convert Shadow to string: Brush is not a valid SolidColorBrush or has no Color."); + } } -} \ No newline at end of file +} diff --git a/src/Controls/tests/Core.UnitTests/ShadowTests.cs b/src/Controls/tests/Core.UnitTests/ShadowTests.cs index f1b2b6a0969e..4bc5ce6fd30f 100644 --- a/src/Controls/tests/Core.UnitTests/ShadowTests.cs +++ b/src/Controls/tests/Core.UnitTests/ShadowTests.cs @@ -29,55 +29,54 @@ public void ShadowInitializesCorrectly() Assert.Equal(expectedRadius, shadow.Radius); } - [Fact] - public void TestShadowTypeConverter() + [Theory] + [InlineData("#000000 4 4")] + [InlineData("rgb(6, 201, 198) 4 4")] + [InlineData("rgba(6, 201, 188, 0.2) 4 8")] + [InlineData("hsl(6, 20%, 45%) 1 5")] + [InlineData("hsla(6, 20%, 45%,0.75) 6 3")] + [InlineData("rgb(100%, 32%, 64%) 8 5")] + [InlineData("rgba(100%, 32%, 64%,0.27) 16 5")] + [InlineData("4 4 16 #FF00FF")] + [InlineData("5 8 8 rgb(6, 201, 198)")] + [InlineData("7 5 4 rgba(6, 201, 188, 0.2)")] + [InlineData("9 4 6 hsl(6, 20%, 45%)")] + [InlineData("8 1 5 hsla(6, 20%, 45%,0.75)")] + [InlineData("5 2 8 rgb(100%, 32%, 64%)")] + [InlineData("1 5 3 rgba(100%, 32%, 64%,0.27)")] + [InlineData("4 4 16 #00FF00 0.5")] + [InlineData("5 8 8 rgb(6, 201, 198) 0.5")] + [InlineData("7 5 4 rgba(6, 201, 188, 0.2) 0.5")] + [InlineData("9 4 6 hsl(6, 20%, 45%) 0.5")] + [InlineData("8 1 5 hsla(6, 20%, 45%,0.75) 0.5")] + [InlineData("5 2 8 rgb(100%, 32%, 64%) 0.5")] + [InlineData("1 5 3 rgba(100%, 32%, 64%,0.27) 0.5")] + public void ShadowTypeConverter_Valid(string value) { var converter = new ShadowTypeConverter(); Assert.True(converter.CanConvertFrom(typeof(string))); - // Test converting from string to Shadow (format 1) - var shadow1 = (Shadow)converter.ConvertFromInvariantString("#000000 4 4"); - Assert.NotNull(shadow1); - Assert.Equal(Color.FromArgb("#000000"), (shadow1.Brush as SolidColorBrush)?.Color); - Assert.Equal(new Point(4, 4), shadow1.Offset); - - // Test converting from string to Shadow (format 2) - var shadow2 = (Shadow)converter.ConvertFromInvariantString("4 4 16 #FF00FF"); - Assert.NotNull(shadow2); - Assert.Equal(Color.FromArgb("#FF00FF"), (shadow2.Brush as SolidColorBrush)?.Color); - Assert.Equal(new Point(4, 4), shadow2.Offset); - Assert.Equal(16, shadow2.Radius); - - // Test converting from string to Shadow (format 3) - var shadow3 = (Shadow)converter.ConvertFromInvariantString("4 4 16 #00FF00 0.5"); - Assert.NotNull(shadow3); - Assert.Equal(Color.FromArgb("#00FF00"), (shadow3.Brush as SolidColorBrush)?.Color); - Assert.Equal(new Point(4, 4), shadow3.Offset); - Assert.Equal(16, shadow3.Radius); - Assert.Equal(0.5f, shadow3.Opacity); - - // Test for converting Shadow to a string - var shadow = new Shadow - { - Brush = new SolidColorBrush(Color.FromArgb("#123456")), - Offset = new Point(10, 20), - Radius = 30, - Opacity = 0.8f - }; - - var shadowString = converter.ConvertToInvariantString(shadow); - Assert.Equal("10 20 30 #123456 0.8", shadowString); - - // Test some problematic cases - Assert.Throws(() => converter.ConvertFromInvariantString(null)); - Assert.Throws(() => converter.ConvertFromInvariantString("")); - Assert.Throws(() => converter.ConvertFromInvariantString("invalid")); - Assert.Throws(() => converter.ConvertFromInvariantString("#ZZZZZZ 4 4")); - Assert.Throws(() => converter.ConvertFromInvariantString("4 4 #000000")); + bool actual = converter.IsValid(value); + Assert.True(actual); + } - Assert.Throws(() => converter.ConvertToInvariantString(null)); - Assert.Throws(() => converter.ConvertToInvariantString("invalid")); - Assert.Throws(() => converter.ConvertToInvariantString(new { })); + [Theory] + [InlineData(null)] + [InlineData("")] + [InlineData("invalid")] + [InlineData("#ZZZZZZ 4 4")] + [InlineData("4 4 #000000")] + [InlineData("rgb(6, 14.5, 198) 4 4")] + [InlineData("argb(0.2, 6, 201, 188) 4 8")] + [InlineData("hsl(6, 20%, 45.8%) 1 5")] + [InlineData("hsla(6.8, 20%, 45%,0.75) 6 3")] + [InlineData("rgb(100%, 32.9%, 64%) 8 5")] + [InlineData("argb(0.27, 100%, 32%, 64%) 16 5")] + public void ShadowTypeConverter_Invalid(string value) + { + ShadowTypeConverter converter = new ShadowTypeConverter(); + bool actual = converter.IsValid(value); + Assert.False(actual); } } } \ No newline at end of file From 8b9e4be8e88c335c43ed09f91b5c9381a9a42bd6 Mon Sep 17 00:00:00 2001 From: Steven Thewissen Date: Mon, 20 Jan 2025 16:11:33 +0100 Subject: [PATCH 5/9] Add more tests and color schemes --- src/Controls/src/Core/ShadowTypeConverter.cs | 299 +++++++++--------- .../tests/Core.UnitTests/ShadowTests.cs | 10 + 2 files changed, 161 insertions(+), 148 deletions(-) diff --git a/src/Controls/src/Core/ShadowTypeConverter.cs b/src/Controls/src/Core/ShadowTypeConverter.cs index 92f51739f2d3..57dc087cb326 100644 --- a/src/Controls/src/Core/ShadowTypeConverter.cs +++ b/src/Controls/src/Core/ShadowTypeConverter.cs @@ -10,51 +10,51 @@ namespace Microsoft.Maui.Controls { - /// - /// Type converter for converting a properly formatted string to a Shadow. - /// - public class ShadowTypeConverter : TypeConverter - { - readonly BrushTypeConverter _brushTypeConverter = new BrushTypeConverter(); - - /// - /// Checks whether the given is a string. - /// - /// The context to use for conversion. - /// The type to convert from. - /// - public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) - => sourceType == typeof(string); - - /// - /// Checks whether the given is a Shadow. - /// - /// The context to use for conversion. - /// The type to convert to. - /// - public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) - => destinationType == typeof(Shadow); - - /// - /// Converts to a Shadow. - /// - /// The context to use for conversion. - /// The culture to use for conversion. - /// The value to convert. - /// - /// Thrown when is null. - /// Thrown when is not a valid Shadow. - public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) - { - var strValue = value?.ToString(); - - if (strValue == null) - { - throw new ArgumentNullException(nameof(strValue)); - } - - try - { + /// + /// Type converter for converting a properly formatted string to a Shadow. + /// + public class ShadowTypeConverter : TypeConverter + { + readonly ColorTypeConverter _colorTypeConverter = new ColorTypeConverter(); + + /// + /// Checks whether the given is a string. + /// + /// The context to use for conversion. + /// The type to convert from. + /// + public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) + => sourceType == typeof(string); + + /// + /// Checks whether the given is a Shadow. + /// + /// The context to use for conversion. + /// The type to convert to. + /// + public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) + => destinationType == typeof(Shadow); + + /// + /// Converts to a Shadow. + /// + /// The context to use for conversion. + /// The culture to use for conversion. + /// The value to convert. + /// + /// Thrown when is null. + /// Thrown when is not a valid Shadow. + public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) + { + var strValue = value?.ToString(); + + if (strValue == null) + { + throw new ArgumentNullException(nameof(strValue)); + } + + try + { var regex = new Regex(@" # Match colors ( @@ -65,6 +65,10 @@ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo c |rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*\d+(?:\.\d+)?\s*\) # rgba(int, int, int, alpha) |hsl\(\s*\d+\s*,\s*\d+%\s*,\s*\d+%\s*\) # hsl(hue, saturation, lightness) |hsla\(\s*\d+\s*,\s*\d+%\s*,\s*\d+%\s*,\s*\d+(?:\.\d+)?\s*\) # hsla(hue, saturation, lightness, alpha) + |hsv\(\s*\d+\s*,\s*\d+%\s*,\s*\d+%\s*\) # hsl(hue, saturation, value) + |hsva\(\s*\d+\s*,\s*\d+%\s*,\s*\d+%\s*,\s*\d+(?:\.\d+)?\s*\) # hsla(hue, saturation, value, alpha) + |[a-zA-Z]+ # X11 named colors (e.g., AliceBlue, limegreen) + ) | # Match numbers ( @@ -76,107 +80,106 @@ public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo c //var parts = matches.Select(m => m.Value).ToArray(); if (matches.Count == 3) // | | e.g. #000000 4 4 - { - var brush = ParseBrush(matches[0].Value); - var offsetX = float.Parse(matches[1].Value, CultureInfo.InvariantCulture); - var offsetY = float.Parse(matches[2].Value, CultureInfo.InvariantCulture); - - return new Shadow - { - Brush = brush, - Offset = new Point(offsetX, offsetY) - }; - } - else if (matches.Count == 4) // | | | e.g. 4 4 16 #000000 - { - var offsetX = float.Parse(matches[0].Value, CultureInfo.InvariantCulture); - var offsetY = float.Parse(matches[1].Value, CultureInfo.InvariantCulture); - var radius = float.Parse(matches[2].Value, CultureInfo.InvariantCulture); - var brush = ParseBrush(matches[3].Value); - - return new Shadow - { - Offset = new Point(offsetX, offsetY), - Radius = radius, - Brush = brush - }; - } - else if (matches.Count == 5) // | | | | e.g. 4 4 16 #000000 0.5 - { - var offsetX = float.Parse(matches[0].Value, CultureInfo.InvariantCulture); - var offsetY = float.Parse(matches[1].Value, CultureInfo.InvariantCulture); - var radius = float.Parse(matches[2].Value, CultureInfo.InvariantCulture); - var brush = ParseBrush(matches[3].Value); - var opacity = float.Parse(matches[4].Value, CultureInfo.InvariantCulture); - - return new Shadow - { - Offset = new Point(offsetX, offsetY), - Radius = radius, - Brush = brush, - Opacity = opacity - }; - } - } - catch (Exception ex) - { - throw new InvalidOperationException($"Cannot convert \"{strValue}\" into {typeof(Shadow)}.", ex); - } - - throw new InvalidOperationException($"Cannot convert \"{strValue}\" into {typeof(IShadow)}."); - } - - /// - /// Converts a Shadow to a string. - /// - /// The context to use for conversion. - /// The culture to use for conversion. - /// The Shadow to convert. - /// The type to convert to. - /// A string representation of the Shadow. - /// Thrown when is null. - /// Thrown when is not a Shadow or the Brush is not a SolidColorBrush. - public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) - { - if(value is null) - { - throw new ArgumentNullException(nameof(value)); - } - - if (value is Shadow shadow) - { - var offsetX = shadow.Offset.X.ToString(CultureInfo.InvariantCulture); - var offsetY = shadow.Offset.Y.ToString(CultureInfo.InvariantCulture); - var radius = shadow.Radius.ToString(CultureInfo.InvariantCulture); - var color = (shadow.Brush as SolidColorBrush)?.Color.ToHex(); - var opacity = shadow.Opacity.ToString(CultureInfo.InvariantCulture); - - if (color == null) - { - throw new InvalidOperationException("Cannot convert Shadow to string: Brush is not a valid SolidColorBrush or has no Color."); - } - - return $"{offsetX} {offsetY} {radius} {color} {opacity}"; - } - - throw new InvalidOperationException($"Cannot convert \"{value}\" into string."); - } - - /// - /// Parses a string value into a SolidColorBrush. - /// - /// The value to parse. - /// A SolidColorBrush. - /// Thrown when the value is not a SolidColorBrush or has no Color. - SolidColorBrush ParseBrush(string value) - { - // If the value is a color, return a SolidColorBrush - if (_brushTypeConverter.ConvertFrom(value) is SolidColorBrush solidColorBrush) - { - return solidColorBrush; - } - - throw new InvalidOperationException("Cannot convert Shadow to string: Brush is not a valid SolidColorBrush or has no Color."); - } - } + { + var brush = ParseBrush(matches[0].Value); + var offsetX = float.Parse(matches[1].Value, CultureInfo.InvariantCulture); + var offsetY = float.Parse(matches[2].Value, CultureInfo.InvariantCulture); + + return new Shadow + { + Brush = brush, + Offset = new Point(offsetX, offsetY) + }; + } + else if (matches.Count == 4) // | | | e.g. 4 4 16 #000000 + { + var offsetX = float.Parse(matches[0].Value, CultureInfo.InvariantCulture); + var offsetY = float.Parse(matches[1].Value, CultureInfo.InvariantCulture); + var radius = float.Parse(matches[2].Value, CultureInfo.InvariantCulture); + var brush = ParseBrush(matches[3].Value); + + return new Shadow + { + Offset = new Point(offsetX, offsetY), + Radius = radius, + Brush = brush + }; + } + else if (matches.Count == 5) // | | | | e.g. 4 4 16 #000000 0.5 + { + var offsetX = float.Parse(matches[0].Value, CultureInfo.InvariantCulture); + var offsetY = float.Parse(matches[1].Value, CultureInfo.InvariantCulture); + var radius = float.Parse(matches[2].Value, CultureInfo.InvariantCulture); + var brush = ParseBrush(matches[3].Value); + var opacity = float.Parse(matches[4].Value, CultureInfo.InvariantCulture); + + return new Shadow + { + Offset = new Point(offsetX, offsetY), + Radius = radius, + Brush = brush, + Opacity = opacity + }; + } + } + catch (Exception ex) + { + throw new InvalidOperationException($"Cannot convert \"{strValue}\" into {typeof(Shadow)}.", ex); + } + + throw new InvalidOperationException($"Cannot convert \"{strValue}\" into {typeof(IShadow)}."); + } + + /// + /// Converts a Shadow to a string. + /// + /// The context to use for conversion. + /// The culture to use for conversion. + /// The Shadow to convert. + /// The type to convert to. + /// A string representation of the Shadow. + /// Thrown when is null. + /// Thrown when is not a Shadow or the Brush is not a SolidColorBrush. + public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) + { + if (value is null) + { + throw new ArgumentNullException(nameof(value)); + } + + if (value is Shadow shadow) + { + var offsetX = shadow.Offset.X.ToString(CultureInfo.InvariantCulture); + var offsetY = shadow.Offset.Y.ToString(CultureInfo.InvariantCulture); + var radius = shadow.Radius.ToString(CultureInfo.InvariantCulture); + var color = (shadow.Brush as SolidColorBrush)?.Color.ToHex(); + var opacity = shadow.Opacity.ToString(CultureInfo.InvariantCulture); + + if (color == null) + { + throw new InvalidOperationException("Cannot convert Shadow to string: Brush is not a valid SolidColorBrush or has no Color."); + } + + return $"{offsetX} {offsetY} {radius} {color} {opacity}"; + } + + throw new InvalidOperationException($"Cannot convert \"{value}\" into string."); + } + + /// + /// Parses a string value into a SolidColorBrush. + /// + /// The value to parse. + /// A SolidColorBrush. + /// Thrown when the value is not a SolidColorBrush or has no Color. + SolidColorBrush ParseBrush(string value) + // If the value is a color, return a SolidColorBrush + if (_colorTypeConverter.ConvertFrom(value) is Color color) + { + return new SolidColorBrush(color); + } + + throw new InvalidOperationException("Cannot convert Shadow to string: Brush is not a valid SolidColorBrush or has no Color."); + } + } } diff --git a/src/Controls/tests/Core.UnitTests/ShadowTests.cs b/src/Controls/tests/Core.UnitTests/ShadowTests.cs index 4bc5ce6fd30f..e4a47fbce475 100644 --- a/src/Controls/tests/Core.UnitTests/ShadowTests.cs +++ b/src/Controls/tests/Core.UnitTests/ShadowTests.cs @@ -35,9 +35,13 @@ public void ShadowInitializesCorrectly() [InlineData("rgba(6, 201, 188, 0.2) 4 8")] [InlineData("hsl(6, 20%, 45%) 1 5")] [InlineData("hsla(6, 20%, 45%,0.75) 6 3")] + [InlineData("fuchsia 4 4")] [InlineData("rgb(100%, 32%, 64%) 8 5")] [InlineData("rgba(100%, 32%, 64%,0.27) 16 5")] + [InlineData("hsv(6, 20%, 45%) 1 5")] + [InlineData("hsva(6, 20%, 45%,0.75) 6 3")] [InlineData("4 4 16 #FF00FF")] + [InlineData("4 4 16 AliceBlue")] [InlineData("5 8 8 rgb(6, 201, 198)")] [InlineData("7 5 4 rgba(6, 201, 188, 0.2)")] [InlineData("9 4 6 hsl(6, 20%, 45%)")] @@ -45,10 +49,13 @@ public void ShadowInitializesCorrectly() [InlineData("5 2 8 rgb(100%, 32%, 64%)")] [InlineData("1 5 3 rgba(100%, 32%, 64%,0.27)")] [InlineData("4 4 16 #00FF00 0.5")] + [InlineData("4 4 16 limegreen 0.5")] [InlineData("5 8 8 rgb(6, 201, 198) 0.5")] [InlineData("7 5 4 rgba(6, 201, 188, 0.2) 0.5")] [InlineData("9 4 6 hsl(6, 20%, 45%) 0.5")] [InlineData("8 1 5 hsla(6, 20%, 45%,0.75) 0.5")] + [InlineData("9 4 6 hsv(6, 20%, 45%) 0.5")] + [InlineData("8 1 5 hsva(6, 20%, 45%,0.75) 0.5")] [InlineData("5 2 8 rgb(100%, 32%, 64%) 0.5")] [InlineData("1 5 3 rgba(100%, 32%, 64%,0.27) 0.5")] public void ShadowTypeConverter_Valid(string value) @@ -66,10 +73,13 @@ public void ShadowTypeConverter_Valid(string value) [InlineData("invalid")] [InlineData("#ZZZZZZ 4 4")] [InlineData("4 4 #000000")] + [InlineData("4 4 dotnetpurple")] [InlineData("rgb(6, 14.5, 198) 4 4")] [InlineData("argb(0.2, 6, 201, 188) 4 8")] [InlineData("hsl(6, 20%, 45.8%) 1 5")] [InlineData("hsla(6.8, 20%, 45%,0.75) 6 3")] + [InlineData("hsv(6, 20%, 45.8%) 1 5")] + [InlineData("hsva(6.8, 20%, 45%,0.75) 6 3")] [InlineData("rgb(100%, 32.9%, 64%) 8 5")] [InlineData("argb(0.27, 100%, 32%, 64%) 16 5")] public void ShadowTypeConverter_Invalid(string value) From 33fc189c5c65276fe5f1d4af03ce58cf28a30495 Mon Sep 17 00:00:00 2001 From: Steven Thewissen Date: Wed, 22 Jan 2025 14:56:20 +0100 Subject: [PATCH 6/9] Remove the XML file --- .../ShadowTypeConverter.xml | 62 ------------------- 1 file changed, 62 deletions(-) delete mode 100644 src/Controls/docs/Microsoft.Maui.Controls/ShadowTypeConverter.xml diff --git a/src/Controls/docs/Microsoft.Maui.Controls/ShadowTypeConverter.xml b/src/Controls/docs/Microsoft.Maui.Controls/ShadowTypeConverter.xml deleted file mode 100644 index 8617869c7cc0..000000000000 --- a/src/Controls/docs/Microsoft.Maui.Controls/ShadowTypeConverter.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - Microsoft.Maui.Controls.Core - 0.0.0.0 - 2.0.0.0 - - - System.ComponentModel.TypeConverter - - - - - Microsoft.Maui.Controls.Xaml.TypeConversion(typeof(System.Collections.Generic.List`1<System.String>)) - - - - Type converter for converting a properly formatted string to a Shadow. - - - - - - - Constructor - - 0.0.0.0 - 2.0.0.0 - Microsoft.Maui.Controls.Core - - - - Creates a new object. - - - - - - - - Method - - 0.0.0.0 - 2.0.0.0 - Microsoft.Maui.Controls.Core - - - System.Object - - - - - - The value to convert. - Converts to a Shadow. - - - - From 29cb1c54e4800409a510c6912b72cf5562048298 Mon Sep 17 00:00:00 2001 From: sthewissen Date: Wed, 22 Jan 2025 15:26:24 +0100 Subject: [PATCH 7/9] Somehow fat fingers got rid of a brace --- src/Controls/src/Core/ShadowTypeConverter.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Controls/src/Core/ShadowTypeConverter.cs b/src/Controls/src/Core/ShadowTypeConverter.cs index 57dc087cb326..dfd44490ab16 100644 --- a/src/Controls/src/Core/ShadowTypeConverter.cs +++ b/src/Controls/src/Core/ShadowTypeConverter.cs @@ -173,6 +173,7 @@ public override object ConvertTo(ITypeDescriptorContext context, CultureInfo cul /// A SolidColorBrush. /// Thrown when the value is not a SolidColorBrush or has no Color. SolidColorBrush ParseBrush(string value) + { // If the value is a color, return a SolidColorBrush if (_colorTypeConverter.ConvertFrom(value) is Color color) { From 79c59338c33020f49977f5b3390e89d382b0269b Mon Sep 17 00:00:00 2001 From: sthewissen Date: Wed, 22 Jan 2025 17:42:34 +0100 Subject: [PATCH 8/9] Add APIs to definitions --- .../PublicAPI/net-android/PublicAPI.Unshipped.txt | 6 ++++++ .../Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt | 6 ++++++ .../net-maccatalyst/PublicAPI.Unshipped.txt | 6 ++++++ .../Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt | 6 ++++++ .../PublicAPI/net-windows/PublicAPI.Unshipped.txt | 6 ++++++ .../src/Core/PublicAPI/net/PublicAPI.Unshipped.txt | 6 ++++++ .../PublicAPI/netstandard/PublicAPI.Unshipped.txt | 12 ++++++------ 7 files changed, 42 insertions(+), 6 deletions(-) diff --git a/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt index 63960bf311ac..1e20ec963df4 100644 --- a/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -148,3 +148,9 @@ static readonly Microsoft.Maui.Controls.TitleBar.TitleProperty -> Microsoft.Maui static readonly Microsoft.Maui.Controls.TitleBar.TrailingContentProperty -> Microsoft.Maui.Controls.BindableProperty! static readonly Microsoft.Maui.Controls.Window.TitleBarProperty -> Microsoft.Maui.Controls.BindableProperty! virtual Microsoft.Maui.Controls.Application.ActivateWindow(Microsoft.Maui.Controls.Window! window) -> void +Microsoft.Maui.Controls.ShadowTypeConverter +Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void +~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) -> bool +~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) -> bool +~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) -> object +~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) -> object diff --git a/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt index e6098daa7e33..d7752ca7c139 100644 --- a/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt @@ -342,3 +342,9 @@ virtual Microsoft.Maui.Controls.Handlers.Items2.ItemsViewDelegator2.UpdateLayout() -> void override Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.MovedToWindow() -> void ~Microsoft.Maui.Controls.Internals.TypedBindingBase.UpdateSourceEventName.set -> void +Microsoft.Maui.Controls.ShadowTypeConverter +Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void +~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) -> bool +~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) -> bool +~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) -> object +~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) -> object diff --git a/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt index c33e604531d2..bb480d9bed6d 100644 --- a/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt @@ -342,3 +342,9 @@ virtual Microsoft.Maui.Controls.Handlers.Items2.ItemsViewController2 virtual Microsoft.Maui.Controls.Handlers.Items2.ItemsViewDelegator2.GetVisibleItemsIndex() -> (bool VisibleItems, int First, int Center, int Last) virtual Microsoft.Maui.Controls.Handlers.Items2.ItemsViewHandler2.UpdateLayout() -> void override Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.MovedToWindow() -> void +Microsoft.Maui.Controls.ShadowTypeConverter +Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void +~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) -> bool +~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) -> bool +~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) -> object +~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) -> object diff --git a/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt index 4aa089b40e07..8d9e11ff0d7e 100644 --- a/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt @@ -143,3 +143,9 @@ static readonly Microsoft.Maui.Controls.TitleBar.TitleProperty -> Microsoft.Maui static readonly Microsoft.Maui.Controls.TitleBar.TrailingContentProperty -> Microsoft.Maui.Controls.BindableProperty! static readonly Microsoft.Maui.Controls.Window.TitleBarProperty -> Microsoft.Maui.Controls.BindableProperty! virtual Microsoft.Maui.Controls.Application.ActivateWindow(Microsoft.Maui.Controls.Window! window) -> void +Microsoft.Maui.Controls.ShadowTypeConverter +Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void +~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) -> bool +~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) -> bool +~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) -> object +~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) -> object diff --git a/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt index ac7b76433c0b..3057a264334b 100644 --- a/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt @@ -149,3 +149,9 @@ static readonly Microsoft.Maui.Controls.TitleBar.TitleProperty -> Microsoft.Maui static readonly Microsoft.Maui.Controls.TitleBar.TrailingContentProperty -> Microsoft.Maui.Controls.BindableProperty! static readonly Microsoft.Maui.Controls.Window.TitleBarProperty -> Microsoft.Maui.Controls.BindableProperty! virtual Microsoft.Maui.Controls.Application.ActivateWindow(Microsoft.Maui.Controls.Window! window) -> void +Microsoft.Maui.Controls.ShadowTypeConverter +Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void +~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) -> bool +~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) -> bool +~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) -> object +~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) -> object \ No newline at end of file diff --git a/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt index 0ea6716a471b..1e552322af4a 100644 --- a/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt @@ -143,3 +143,9 @@ static readonly Microsoft.Maui.Controls.TitleBar.TitleProperty -> Microsoft.Maui static readonly Microsoft.Maui.Controls.TitleBar.TrailingContentProperty -> Microsoft.Maui.Controls.BindableProperty! static readonly Microsoft.Maui.Controls.Window.TitleBarProperty -> Microsoft.Maui.Controls.BindableProperty! virtual Microsoft.Maui.Controls.Application.ActivateWindow(Microsoft.Maui.Controls.Window! window) -> void +Microsoft.Maui.Controls.ShadowTypeConverter +Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void +~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) -> bool +~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) -> bool +~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) -> object +~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) -> object diff --git a/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt index cd42f412a5ee..f840a1937460 100644 --- a/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt @@ -10,8 +10,6 @@ *REMOVED*~Microsoft.Maui.Controls.NavigableElement.StyleClass.get -> System.Collections.Generic.IList *REMOVED*~Microsoft.Maui.Controls.NavigableElement.StyleClass.set -> void Microsoft.Maui.Controls.HybridWebView.SetInvokeJavaScriptTarget(T! target) -> void -Microsoft.Maui.Controls.ShadowTypeConverter -Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void Microsoft.Maui.Controls.StyleableElement.Style.get -> Microsoft.Maui.Controls.Style? ~Microsoft.Maui.Controls.ResourceDictionary.SetAndCreateSource(System.Uri value) -> void ~Microsoft.Maui.Controls.Internals.TypedBindingBase.UpdateSourceEventName.set -> void @@ -19,10 +17,6 @@ Microsoft.Maui.Controls.StyleableElement.Style.get -> Microsoft.Maui.Controls.St ~Microsoft.Maui.Controls.WebViewProcessTerminatedEventArgs.PlatformArgs.get -> Microsoft.Maui.Controls.PlatformWebViewProcessTerminatedEventArgs ~Microsoft.Maui.Controls.Xaml.RequireServiceAttribute.RequireServiceAttribute(System.Type[] serviceTypes) -> void ~Microsoft.Maui.Controls.Xaml.RequireServiceAttribute.ServiceTypes.get -> System.Type[] -~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) -> bool -~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) -> bool -~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) -> object -~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) -> object ~override Microsoft.Maui.Controls.ShellContent.OnPropertyChanged(string propertyName = null) -> void *REMOVED*~static Microsoft.Maui.Controls.Application.ControlsApplicationMapper -> Microsoft.Maui.IPropertyMapper ~static Microsoft.Maui.Controls.Brush.DarkGrey.get -> Microsoft.Maui.Controls.SolidColorBrush @@ -149,3 +143,9 @@ static readonly Microsoft.Maui.Controls.TitleBar.TitleProperty -> Microsoft.Maui static readonly Microsoft.Maui.Controls.TitleBar.TrailingContentProperty -> Microsoft.Maui.Controls.BindableProperty! static readonly Microsoft.Maui.Controls.Window.TitleBarProperty -> Microsoft.Maui.Controls.BindableProperty! virtual Microsoft.Maui.Controls.Application.ActivateWindow(Microsoft.Maui.Controls.Window! window) -> void +Microsoft.Maui.Controls.ShadowTypeConverter +Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void +~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) -> bool +~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) -> bool +~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) -> object +~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) -> object \ No newline at end of file From 8968ad7aea0f8799457f2b85bba6c09f2afa7aab Mon Sep 17 00:00:00 2001 From: Steven Thewissen Date: Mon, 10 Feb 2025 16:42:11 +0100 Subject: [PATCH 9/9] Change to internal --- .../Core/PublicAPI/net-android/PublicAPI.Unshipped.txt | 8 +------- .../src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt | 8 +------- .../PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt | 8 +------- .../src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt | 8 +------- .../Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt | 8 +------- .../src/Core/PublicAPI/net/PublicAPI.Unshipped.txt | 8 +------- .../Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt | 8 +------- src/Controls/src/Core/ShadowTypeConverter.cs | 8 ++++---- 8 files changed, 11 insertions(+), 53 deletions(-) diff --git a/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt index 1e20ec963df4..f48b2b26b2c2 100644 --- a/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -147,10 +147,4 @@ static readonly Microsoft.Maui.Controls.TitleBar.SubtitleProperty -> Microsoft.M static readonly Microsoft.Maui.Controls.TitleBar.TitleProperty -> Microsoft.Maui.Controls.BindableProperty! static readonly Microsoft.Maui.Controls.TitleBar.TrailingContentProperty -> Microsoft.Maui.Controls.BindableProperty! static readonly Microsoft.Maui.Controls.Window.TitleBarProperty -> Microsoft.Maui.Controls.BindableProperty! -virtual Microsoft.Maui.Controls.Application.ActivateWindow(Microsoft.Maui.Controls.Window! window) -> void -Microsoft.Maui.Controls.ShadowTypeConverter -Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void -~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) -> bool -~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) -> bool -~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) -> object -~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) -> object +virtual Microsoft.Maui.Controls.Application.ActivateWindow(Microsoft.Maui.Controls.Window! window) -> void \ No newline at end of file diff --git a/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt index d7752ca7c139..42d5115c8acc 100644 --- a/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt @@ -341,10 +341,4 @@ virtual Microsoft.Maui.Controls.Handlers.Items2.ItemsViewController2 virtual Microsoft.Maui.Controls.Handlers.Items2.ItemsViewDelegator2.GetVisibleItemsIndex() -> (bool VisibleItems, int First, int Center, int Last) virtual Microsoft.Maui.Controls.Handlers.Items2.ItemsViewHandler2.UpdateLayout() -> void override Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.MovedToWindow() -> void -~Microsoft.Maui.Controls.Internals.TypedBindingBase.UpdateSourceEventName.set -> void -Microsoft.Maui.Controls.ShadowTypeConverter -Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void -~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) -> bool -~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) -> bool -~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) -> object -~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) -> object +~Microsoft.Maui.Controls.Internals.TypedBindingBase.UpdateSourceEventName.set -> void \ No newline at end of file diff --git a/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt index bb480d9bed6d..d316177c7108 100644 --- a/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt @@ -341,10 +341,4 @@ virtual Microsoft.Maui.Controls.Handlers.Items2.ItemsViewController2 virtual Microsoft.Maui.Controls.Handlers.Items2.ItemsViewController2.UpdateVisibility() -> void virtual Microsoft.Maui.Controls.Handlers.Items2.ItemsViewDelegator2.GetVisibleItemsIndex() -> (bool VisibleItems, int First, int Center, int Last) virtual Microsoft.Maui.Controls.Handlers.Items2.ItemsViewHandler2.UpdateLayout() -> void -override Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.MovedToWindow() -> void -Microsoft.Maui.Controls.ShadowTypeConverter -Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void -~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) -> bool -~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) -> bool -~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) -> object -~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) -> object +override Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.MovedToWindow() -> void \ No newline at end of file diff --git a/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt index 8d9e11ff0d7e..275b44d25503 100644 --- a/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt @@ -142,10 +142,4 @@ static readonly Microsoft.Maui.Controls.TitleBar.SubtitleProperty -> Microsoft.M static readonly Microsoft.Maui.Controls.TitleBar.TitleProperty -> Microsoft.Maui.Controls.BindableProperty! static readonly Microsoft.Maui.Controls.TitleBar.TrailingContentProperty -> Microsoft.Maui.Controls.BindableProperty! static readonly Microsoft.Maui.Controls.Window.TitleBarProperty -> Microsoft.Maui.Controls.BindableProperty! -virtual Microsoft.Maui.Controls.Application.ActivateWindow(Microsoft.Maui.Controls.Window! window) -> void -Microsoft.Maui.Controls.ShadowTypeConverter -Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void -~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) -> bool -~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) -> bool -~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) -> object -~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) -> object +virtual Microsoft.Maui.Controls.Application.ActivateWindow(Microsoft.Maui.Controls.Window! window) -> void \ No newline at end of file diff --git a/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt index 3057a264334b..b1dbe9d0aa07 100644 --- a/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt @@ -148,10 +148,4 @@ static readonly Microsoft.Maui.Controls.TitleBar.SubtitleProperty -> Microsoft.M static readonly Microsoft.Maui.Controls.TitleBar.TitleProperty -> Microsoft.Maui.Controls.BindableProperty! static readonly Microsoft.Maui.Controls.TitleBar.TrailingContentProperty -> Microsoft.Maui.Controls.BindableProperty! static readonly Microsoft.Maui.Controls.Window.TitleBarProperty -> Microsoft.Maui.Controls.BindableProperty! -virtual Microsoft.Maui.Controls.Application.ActivateWindow(Microsoft.Maui.Controls.Window! window) -> void -Microsoft.Maui.Controls.ShadowTypeConverter -Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void -~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) -> bool -~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) -> bool -~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) -> object -~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) -> object \ No newline at end of file +virtual Microsoft.Maui.Controls.Application.ActivateWindow(Microsoft.Maui.Controls.Window! window) -> void \ No newline at end of file diff --git a/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt index 1e552322af4a..27745f220371 100644 --- a/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt @@ -142,10 +142,4 @@ static readonly Microsoft.Maui.Controls.TitleBar.SubtitleProperty -> Microsoft.M static readonly Microsoft.Maui.Controls.TitleBar.TitleProperty -> Microsoft.Maui.Controls.BindableProperty! static readonly Microsoft.Maui.Controls.TitleBar.TrailingContentProperty -> Microsoft.Maui.Controls.BindableProperty! static readonly Microsoft.Maui.Controls.Window.TitleBarProperty -> Microsoft.Maui.Controls.BindableProperty! -virtual Microsoft.Maui.Controls.Application.ActivateWindow(Microsoft.Maui.Controls.Window! window) -> void -Microsoft.Maui.Controls.ShadowTypeConverter -Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void -~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) -> bool -~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) -> bool -~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) -> object -~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) -> object +virtual Microsoft.Maui.Controls.Application.ActivateWindow(Microsoft.Maui.Controls.Window! window) -> void \ No newline at end of file diff --git a/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt index f840a1937460..275b44d25503 100644 --- a/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt @@ -142,10 +142,4 @@ static readonly Microsoft.Maui.Controls.TitleBar.SubtitleProperty -> Microsoft.M static readonly Microsoft.Maui.Controls.TitleBar.TitleProperty -> Microsoft.Maui.Controls.BindableProperty! static readonly Microsoft.Maui.Controls.TitleBar.TrailingContentProperty -> Microsoft.Maui.Controls.BindableProperty! static readonly Microsoft.Maui.Controls.Window.TitleBarProperty -> Microsoft.Maui.Controls.BindableProperty! -virtual Microsoft.Maui.Controls.Application.ActivateWindow(Microsoft.Maui.Controls.Window! window) -> void -Microsoft.Maui.Controls.ShadowTypeConverter -Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void -~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Type sourceType) -> bool -~override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Type destinationType) -> bool -~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) -> object -~override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) -> object \ No newline at end of file +virtual Microsoft.Maui.Controls.Application.ActivateWindow(Microsoft.Maui.Controls.Window! window) -> void \ No newline at end of file diff --git a/src/Controls/src/Core/ShadowTypeConverter.cs b/src/Controls/src/Core/ShadowTypeConverter.cs index dfd44490ab16..8d8bdb3a28ec 100644 --- a/src/Controls/src/Core/ShadowTypeConverter.cs +++ b/src/Controls/src/Core/ShadowTypeConverter.cs @@ -10,10 +10,10 @@ namespace Microsoft.Maui.Controls { - /// - /// Type converter for converting a properly formatted string to a Shadow. - /// - public class ShadowTypeConverter : TypeConverter + /// + /// Type converter for converting a properly formatted string to a Shadow. + /// + internal class ShadowTypeConverter : TypeConverter { readonly ColorTypeConverter _colorTypeConverter = new ColorTypeConverter();