diff --git a/src/Controls/src/Core/Handlers/Items/Tizen/ItemTemplateAdaptor.cs b/src/Controls/src/Core/Handlers/Items/Tizen/ItemTemplateAdaptor.cs index d0a68324cafd..5b116649ff4e 100644 --- a/src/Controls/src/Core/Handlers/Items/Tizen/ItemTemplateAdaptor.cs +++ b/src/Controls/src/Core/Handlers/Items/Tizen/ItemTemplateAdaptor.cs @@ -421,12 +421,12 @@ public DefaultItemTemplate() : base(CreateView) { } class ToTextConverter : IValueConverter { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) { return value?.ToString() ?? string.Empty; } - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException(); + public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) => throw new NotImplementedException(); } static View CreateView() diff --git a/src/Controls/src/Core/IValueConverter.cs b/src/Controls/src/Core/IValueConverter.cs index 0491ecd9375f..fd3d91360c00 100644 --- a/src/Controls/src/Core/IValueConverter.cs +++ b/src/Controls/src/Core/IValueConverter.cs @@ -1,4 +1,4 @@ -#nullable disable +#nullable enable using System; using System.Globalization; @@ -6,7 +6,7 @@ namespace Microsoft.Maui.Controls { public interface IValueConverter { - object Convert(object value, Type targetType, object parameter, CultureInfo culture); - object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture); + object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture); + object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture); } } \ No newline at end of file diff --git a/src/Controls/src/Core/Platform/Tizen/IconConverter.cs b/src/Controls/src/Core/Platform/Tizen/IconConverter.cs index 214cd517468c..4610095ccd09 100644 --- a/src/Controls/src/Core/Platform/Tizen/IconConverter.cs +++ b/src/Controls/src/Core/Platform/Tizen/IconConverter.cs @@ -6,13 +6,13 @@ namespace Microsoft.Maui.Controls.Platform { public class IconConverter : IValueConverter { - object? IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture) + object? IValueConverter.Convert(object? value, Type targetType, object? parameter, CultureInfo culture) { PathGeometryConverter converter = new PathGeometryConverter(); - return converter.ConvertFromInvariantString((string)value); + return converter.ConvertFromInvariantString((value as string)!); } - object? IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + object? IValueConverter.ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) { PathGeometryConverter converter = new PathGeometryConverter(); return converter.ConvertToString(value); 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 218837ca2448..f2dced895bf7 100644 --- a/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -46,4 +46,6 @@ override Microsoft.Maui.Controls.SearchBar.IsEnabledCore.get -> bool *REMOVED*Microsoft.Maui.Controls.OpenGLView.HasRenderLoop.set -> void *REMOVED*Microsoft.Maui.Controls.OpenGLView.OpenGLView() -> void *REMOVED*Microsoft.Maui.Controls.Application.SavePropertiesAsync() -> System.Threading.Tasks.Task! -*REMOVED*Microsoft.Maui.Controls.Application.Properties.get -> System.Collections.Generic.IDictionary! \ No newline at end of file +*REMOVED*Microsoft.Maui.Controls.Application.Properties.get -> System.Collections.Generic.IDictionary! +Microsoft.Maui.Controls.IValueConverter.Convert(object? value, System.Type! targetType, object? parameter, System.Globalization.CultureInfo! culture) -> object? +Microsoft.Maui.Controls.IValueConverter.ConvertBack(object? value, System.Type! targetType, object? parameter, System.Globalization.CultureInfo! culture) -> object? \ 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 bfe73ebeb904..8f977b00c163 100644 --- a/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt @@ -43,4 +43,6 @@ override Microsoft.Maui.Controls.SearchBar.IsEnabledCore.get -> bool *REMOVED*Microsoft.Maui.Controls.OpenGLView.HasRenderLoop.set -> void *REMOVED*Microsoft.Maui.Controls.OpenGLView.OpenGLView() -> void *REMOVED*Microsoft.Maui.Controls.Application.SavePropertiesAsync() -> System.Threading.Tasks.Task! -*REMOVED*Microsoft.Maui.Controls.Application.Properties.get -> System.Collections.Generic.IDictionary! \ No newline at end of file +*REMOVED*Microsoft.Maui.Controls.Application.Properties.get -> System.Collections.Generic.IDictionary! +Microsoft.Maui.Controls.IValueConverter.Convert(object? value, System.Type! targetType, object? parameter, System.Globalization.CultureInfo! culture) -> object? +Microsoft.Maui.Controls.IValueConverter.ConvertBack(object? value, System.Type! targetType, object? parameter, System.Globalization.CultureInfo! culture) -> object? \ 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 bfe73ebeb904..369b4400a551 100644 --- a/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt @@ -43,4 +43,6 @@ override Microsoft.Maui.Controls.SearchBar.IsEnabledCore.get -> bool *REMOVED*Microsoft.Maui.Controls.OpenGLView.HasRenderLoop.set -> void *REMOVED*Microsoft.Maui.Controls.OpenGLView.OpenGLView() -> void *REMOVED*Microsoft.Maui.Controls.Application.SavePropertiesAsync() -> System.Threading.Tasks.Task! -*REMOVED*Microsoft.Maui.Controls.Application.Properties.get -> System.Collections.Generic.IDictionary! \ No newline at end of file +*REMOVED*Microsoft.Maui.Controls.Application.Properties.get -> System.Collections.Generic.IDictionary! +Microsoft.Maui.Controls.IValueConverter.Convert(object? value, System.Type! targetType, object? parameter, System.Globalization.CultureInfo! culture) -> object? +Microsoft.Maui.Controls.IValueConverter.ConvertBack(object? value, System.Type! targetType, object? parameter, System.Globalization.CultureInfo! culture) -> 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 7fc7bdb374db..d470beb90cd0 100644 --- a/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt @@ -41,4 +41,6 @@ override Microsoft.Maui.Controls.SearchBar.IsEnabledCore.get -> bool *REMOVED*Microsoft.Maui.Controls.OpenGLView.HasRenderLoop.set -> void *REMOVED*Microsoft.Maui.Controls.OpenGLView.OpenGLView() -> void *REMOVED*Microsoft.Maui.Controls.Application.SavePropertiesAsync() -> System.Threading.Tasks.Task! -*REMOVED*Microsoft.Maui.Controls.Application.Properties.get -> System.Collections.Generic.IDictionary! \ No newline at end of file +*REMOVED*Microsoft.Maui.Controls.Application.Properties.get -> System.Collections.Generic.IDictionary! +Microsoft.Maui.Controls.IValueConverter.Convert(object? value, System.Type! targetType, object? parameter, System.Globalization.CultureInfo! culture) -> object? +Microsoft.Maui.Controls.IValueConverter.ConvertBack(object? value, System.Type! targetType, object? parameter, System.Globalization.CultureInfo! culture) -> object? \ 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 1e2360ee9067..026732e2b8c8 100644 --- a/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt @@ -40,4 +40,6 @@ override Microsoft.Maui.Controls.SearchBar.IsEnabledCore.get -> bool *REMOVED*Microsoft.Maui.Controls.OpenGLView.HasRenderLoop.set -> void *REMOVED*Microsoft.Maui.Controls.OpenGLView.OpenGLView() -> void *REMOVED*Microsoft.Maui.Controls.Application.SavePropertiesAsync() -> System.Threading.Tasks.Task! -*REMOVED*Microsoft.Maui.Controls.Application.Properties.get -> System.Collections.Generic.IDictionary! \ No newline at end of file +*REMOVED*Microsoft.Maui.Controls.Application.Properties.get -> System.Collections.Generic.IDictionary! +Microsoft.Maui.Controls.IValueConverter.Convert(object? value, System.Type! targetType, object? parameter, System.Globalization.CultureInfo! culture) -> object? +Microsoft.Maui.Controls.IValueConverter.ConvertBack(object? value, System.Type! targetType, object? parameter, System.Globalization.CultureInfo! culture) -> 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 b615d03eee31..09f33a198b3c 100644 --- a/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt @@ -44,4 +44,6 @@ override Microsoft.Maui.Controls.SearchBar.IsEnabledCore.get -> bool *REMOVED*Microsoft.Maui.Controls.OpenGLView.HasRenderLoop.set -> void *REMOVED*Microsoft.Maui.Controls.OpenGLView.OpenGLView() -> void *REMOVED*Microsoft.Maui.Controls.Application.SavePropertiesAsync() -> System.Threading.Tasks.Task! -*REMOVED*Microsoft.Maui.Controls.Application.Properties.get -> System.Collections.Generic.IDictionary! \ No newline at end of file +*REMOVED*Microsoft.Maui.Controls.Application.Properties.get -> System.Collections.Generic.IDictionary! +Microsoft.Maui.Controls.IValueConverter.Convert(object? value, System.Type! targetType, object? parameter, System.Globalization.CultureInfo! culture) -> object? +Microsoft.Maui.Controls.IValueConverter.ConvertBack(object? value, System.Type! targetType, object? parameter, System.Globalization.CultureInfo! culture) -> object? diff --git a/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt index 286aa4b17784..d3365b8e2287 100644 --- a/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt @@ -38,4 +38,6 @@ override Microsoft.Maui.Controls.SearchBar.IsEnabledCore.get -> bool *REMOVED*Microsoft.Maui.Controls.OpenGLView.HasRenderLoop.set -> void *REMOVED*Microsoft.Maui.Controls.OpenGLView.OpenGLView() -> void *REMOVED*Microsoft.Maui.Controls.Application.SavePropertiesAsync() -> System.Threading.Tasks.Task! -*REMOVED*Microsoft.Maui.Controls.Application.Properties.get -> System.Collections.Generic.IDictionary! \ No newline at end of file +*REMOVED*Microsoft.Maui.Controls.Application.Properties.get -> System.Collections.Generic.IDictionary! +Microsoft.Maui.Controls.IValueConverter.Convert(object? value, System.Type! targetType, object? parameter, System.Globalization.CultureInfo! culture) -> object? +Microsoft.Maui.Controls.IValueConverter.ConvertBack(object? value, System.Type! targetType, object? parameter, System.Globalization.CultureInfo! culture) -> object? \ No newline at end of file diff --git a/src/TestUtils/src/DeviceTests.Runners/VisualRunner/Converters/RunStatusToColorConverter.cs b/src/TestUtils/src/DeviceTests.Runners/VisualRunner/Converters/RunStatusToColorConverter.cs index f47e9e6a02c3..5c1eb9747cd1 100644 --- a/src/TestUtils/src/DeviceTests.Runners/VisualRunner/Converters/RunStatusToColorConverter.cs +++ b/src/TestUtils/src/DeviceTests.Runners/VisualRunner/Converters/RunStatusToColorConverter.cs @@ -8,7 +8,7 @@ namespace Microsoft.Maui.TestUtils.DeviceTests.Runners.VisualRunner { class RunStatusToColorConverter : IValueConverter { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) { if (value is not RunStatus status || Application.Current == null) return Colors.Red; @@ -24,7 +24,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn }; } - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => + public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) => throw new NotImplementedException(); } } \ No newline at end of file