Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions src/Controls/src/Core/IValueConverter.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#nullable disable
#nullable enable
using System;
using System.Globalization;

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);
}
}
6 changes: 3 additions & 3 deletions src/Controls/src/Core/Platform/Tizen/IconConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<string!, object!>!
*REMOVED*Microsoft.Maui.Controls.Application.Properties.get -> System.Collections.Generic.IDictionary<string!, object!>!
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?
Original file line number Diff line number Diff line change
Expand Up @@ -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<string!, object!>!
*REMOVED*Microsoft.Maui.Controls.Application.Properties.get -> System.Collections.Generic.IDictionary<string!, object!>!
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?
Original file line number Diff line number Diff line change
Expand Up @@ -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<string!, object!>!
*REMOVED*Microsoft.Maui.Controls.Application.Properties.get -> System.Collections.Generic.IDictionary<string!, object!>!
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?
Original file line number Diff line number Diff line change
Expand Up @@ -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<string!, object!>!
*REMOVED*Microsoft.Maui.Controls.Application.Properties.get -> System.Collections.Generic.IDictionary<string!, object!>!
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?
Original file line number Diff line number Diff line change
Expand Up @@ -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<string!, object!>!
*REMOVED*Microsoft.Maui.Controls.Application.Properties.get -> System.Collections.Generic.IDictionary<string!, object!>!
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?
4 changes: 3 additions & 1 deletion src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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<string!, object!>!
*REMOVED*Microsoft.Maui.Controls.Application.Properties.get -> System.Collections.Generic.IDictionary<string!, object!>!
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?
Original file line number Diff line number Diff line change
Expand Up @@ -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<string!, object!>!
*REMOVED*Microsoft.Maui.Controls.Application.Properties.get -> System.Collections.Generic.IDictionary<string!, object!>!
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?
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}
}