Do not throw exceptions in code which can be written in XAML #448
Closed
VladislavAntonyuk
started this conversation in
General
Replies: 2 comments
-
To provide some follow up here, issue #540 was raised highlighting this issue We see this because we actively support NRT but I think we are coming to realise that not all devs using the toolkit are. I would like to propose that we enhance the Sample options class definitionpublic class MauiCommunityToolkitOptions
{
public bool EnableNullReferenceTypeSupport { get; set; } = true;
} Sample usage scenariobuilder
.UseMauiApp<App>()
.UseMauiCommunityToolkit(options =>
{
options.EnableNullReferenceTypeSupport = false;
}); With the aim that the existing method will behave as it currently does if no options are defined. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Closed as answered |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It's hard to catch exception in XAML, so in most cases application crashes.
It mostly happens in Converters if some value has invalid type.
So I propose to return default value instead.
In 99% (It's just my opinion) it won't break existing code.
If you assume it's a breaking change we can create a settings flag "ThrowException" which is True by default.
Beta Was this translation helpful? Give feedback.
All reactions