diff --git a/samples/CommunityToolkit.Maui.Sample/Pages/Views/Expander/ExpanderPageCS.cs b/samples/CommunityToolkit.Maui.Sample/Pages/Views/Expander/ExpanderPageCS.cs index 44b604e06d..71ee424832 100644 --- a/samples/CommunityToolkit.Maui.Sample/Pages/Views/Expander/ExpanderPageCS.cs +++ b/samples/CommunityToolkit.Maui.Sample/Pages/Views/Expander/ExpanderPageCS.cs @@ -9,6 +9,9 @@ public class ExpanderPageCS : ContentPage { public ExpanderPageCS() { + const string dotnetBotUrl = "https://avatars.githubusercontent.com/u/9011267?v=4"; + const string dotnetMauiUrl = "https://dot.net/maui"; + Title = "Expander Page, C# UI"; Content = new VerticalStackLayout() @@ -36,7 +39,7 @@ public ExpanderPageCS() Content = new VerticalStackLayout() { new Image() - .Source("https://avatars.githubusercontent.com/u/9011267?v=4") + .Source(dotnetBotUrl) .Size(120) .Aspect(Aspect.AspectFit), @@ -46,7 +49,7 @@ public ExpanderPageCS() new Button() .Text("Learn more") - .Invoke(button => button.Clicked += async (s, e) => await Launcher.OpenAsync("https://dot.net/maui")) + .Invoke(button => button.Clicked += static async (_, _) => await Launcher.OpenAsync(dotnetMauiUrl)) }.Padding(10) diff --git a/samples/CommunityToolkit.Maui.Sample/Pages/Views/LazyView/CustomLazyView.cs b/samples/CommunityToolkit.Maui.Sample/Pages/Views/LazyView/CustomLazyView.cs index 2a2fa8c2bb..8d1ef1e28f 100644 --- a/samples/CommunityToolkit.Maui.Sample/Pages/Views/LazyView/CustomLazyView.cs +++ b/samples/CommunityToolkit.Maui.Sample/Pages/Views/LazyView/CustomLazyView.cs @@ -4,7 +4,7 @@ namespace CommunityToolkit.Maui.Sample.Pages.Views.LazyView; public class CustomLazyView : Maui.Views.LazyView where TView : View, new() { - public override async ValueTask LoadViewAsync(CancellationToken token) + public override async ValueTask LoadViewAsync(CancellationToken token = default) { // display a loading indicator Content = new ActivityIndicator { IsRunning = true }.Center(); diff --git a/samples/CommunityToolkit.Maui.Sample/Pages/Views/LazyView/MyViewLazyView.cs b/samples/CommunityToolkit.Maui.Sample/Pages/Views/LazyView/MyViewLazyView.cs index e8d274ba83..c71ea68ae7 100644 --- a/samples/CommunityToolkit.Maui.Sample/Pages/Views/LazyView/MyViewLazyView.cs +++ b/samples/CommunityToolkit.Maui.Sample/Pages/Views/LazyView/MyViewLazyView.cs @@ -4,7 +4,7 @@ namespace CommunityToolkit.Maui.Sample.Pages.Views.LazyView; class MyViewLazyView : LazyView { - public override async ValueTask LoadViewAsync(CancellationToken token) + public override async ValueTask LoadViewAsync(CancellationToken token = default) { await base.LoadViewAsync(token); } diff --git a/samples/CommunityToolkit.Maui.Sample/Pages/Views/MediaElement/MediaElementPage.xaml.cs b/samples/CommunityToolkit.Maui.Sample/Pages/Views/MediaElement/MediaElementPage.xaml.cs index b910267cef..819e1c9441 100644 --- a/samples/CommunityToolkit.Maui.Sample/Pages/Views/MediaElement/MediaElementPage.xaml.cs +++ b/samples/CommunityToolkit.Maui.Sample/Pages/Views/MediaElement/MediaElementPage.xaml.cs @@ -10,12 +10,18 @@ namespace CommunityToolkit.Maui.Sample.Pages.Views; public partial class MediaElementPage : BasePage { readonly ILogger logger; + const string loadOnlineMp4 = "Load Online MP4"; const string loadHls = "Load HTTP Live Stream (HLS)"; const string loadLocalResource = "Load Local Resource"; const string resetSource = "Reset Source to null"; const string loadMusic = "Load Music"; + const string buckBunnyMp4Url = "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"; + const string botImageUrl = "https://lh3.googleusercontent.com/pw/AP1GczNRrebWCJvfdIau1EbsyyYiwAfwHS0JXjbioXvHqEwYIIdCzuLodQCZmA57GADIo5iB3yMMx3t_vsefbfoHwSg0jfUjIXaI83xpiih6d-oT7qD_slR0VgNtfAwJhDBU09kS5V2T5ZML-WWZn8IrjD4J-g=w1792-h1024-s-no-gm"; + const string hlsStreamTestUrl = "https://mtoczko.github.io/hls-test-streams/test-gap/playlist.m3u8"; + const string hal9000AudioUrl = "https://github.com/prof3ssorSt3v3/media-sample-files/raw/master/hal-9000.mp3"; + public MediaElementPage(MediaElementViewModel viewModel, ILogger logger) : base(viewModel) { InitializeComponent(); @@ -26,9 +32,9 @@ public MediaElementPage(MediaElementViewModel viewModel, ILogger void OnPositionChanged(object? sender, MediaPositionChangedEventArgs e) { - logger.LogInformation("Position changed to {position}", e.Position); + logger.LogInformation("Position changed to {Position}", e.Position); PositionSlider.Value = e.Position.TotalSeconds; } @@ -161,20 +167,17 @@ async void ChangeSourceClicked(Object sender, EventArgs e) { case loadOnlineMp4: MediaElement.MetadataTitle = "Big Buck Bunny"; - MediaElement.MetadataArtworkUrl = "https://lh3.googleusercontent.com/pw/AP1GczNRrebWCJvfdIau1EbsyyYiwAfwHS0JXjbioXvHqEwYIIdCzuLodQCZmA57GADIo5iB3yMMx3t_vsefbfoHwSg0jfUjIXaI83xpiih6d-oT7qD_slR0VgNtfAwJhDBU09kS5V2T5ZML-WWZn8IrjD4J-g=w1792-h1024-s-no-gm"; + MediaElement.MetadataArtworkUrl = botImageUrl; MediaElement.MetadataArtist = "Big Buck Bunny Album"; MediaElement.Source = - MediaSource.FromUri( - "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"); + MediaSource.FromUri(buckBunnyMp4Url); return; case loadHls: MediaElement.MetadataArtist = "HLS Album"; - MediaElement.MetadataArtworkUrl = "https://lh3.googleusercontent.com/pw/AP1GczNRrebWCJvfdIau1EbsyyYiwAfwHS0JXjbioXvHqEwYIIdCzuLodQCZmA57GADIo5iB3yMMx3t_vsefbfoHwSg0jfUjIXaI83xpiih6d-oT7qD_slR0VgNtfAwJhDBU09kS5V2T5ZML-WWZn8IrjD4J-g=w1792-h1024-s-no-gm"; + MediaElement.MetadataArtworkUrl = botImageUrl; MediaElement.MetadataTitle = "HLS Title"; - MediaElement.Source - = MediaSource.FromUri( - "https://mtoczko.github.io/hls-test-streams/test-gap/playlist.m3u8"); + MediaElement.Source = MediaSource.FromUri(hlsStreamTestUrl); return; case resetSource: @@ -185,7 +188,7 @@ async void ChangeSourceClicked(Object sender, EventArgs e) return; case loadLocalResource: - MediaElement.MetadataArtworkUrl = "https://lh3.googleusercontent.com/pw/AP1GczNRrebWCJvfdIau1EbsyyYiwAfwHS0JXjbioXvHqEwYIIdCzuLodQCZmA57GADIo5iB3yMMx3t_vsefbfoHwSg0jfUjIXaI83xpiih6d-oT7qD_slR0VgNtfAwJhDBU09kS5V2T5ZML-WWZn8IrjD4J-g=w1792-h1024-s-no-gm"; + MediaElement.MetadataArtworkUrl = botImageUrl; MediaElement.MetadataTitle = "Local Resource Title"; MediaElement.MetadataArtist = "Local Resource Album"; @@ -207,19 +210,25 @@ async void ChangeSourceClicked(Object sender, EventArgs e) case loadMusic: MediaElement.MetadataTitle = "HAL 9000"; MediaElement.MetadataArtist = "HAL 9000 Album"; - MediaElement.MetadataArtworkUrl = "https://lh3.googleusercontent.com/pw/AP1GczNRrebWCJvfdIau1EbsyyYiwAfwHS0JXjbioXvHqEwYIIdCzuLodQCZmA57GADIo5iB3yMMx3t_vsefbfoHwSg0jfUjIXaI83xpiih6d-oT7qD_slR0VgNtfAwJhDBU09kS5V2T5ZML-WWZn8IrjD4J-g=w1792-h1024-s-no-gm"; - MediaElement.Source = MediaSource.FromUri("https://github.com/prof3ssorSt3v3/media-sample-files/raw/master/hal-9000.mp3"); + MediaElement.MetadataArtworkUrl = botImageUrl; + MediaElement.Source = MediaSource.FromUri(hal9000AudioUrl); return; } } async void ChangeAspectClicked(object? sender, EventArgs e) { - var resultAspect = await DisplayActionSheet("Choose aspect ratio", - "Cancel", null, Aspect.AspectFit.ToString(), - Aspect.AspectFill.ToString(), Aspect.Fill.ToString()); + const string cancel = "Cancel"; + + var resultAspect = await DisplayActionSheet( + "Choose aspect ratio", + cancel, + null, + Aspect.AspectFit.ToString(), + Aspect.AspectFill.ToString(), + Aspect.Fill.ToString()); - if (resultAspect is null || resultAspect.Equals("Cancel")) + if (resultAspect is null or cancel) { return; } @@ -237,7 +246,7 @@ async void ChangeAspectClicked(object? sender, EventArgs e) void DisplayPopup(object sender, EventArgs e) { MediaElement.Pause(); - var popupMediaElement = new Maui.Views.MediaElement + var popupMediaElement = new MediaElement { Source = MediaSource.FromResource("AppleVideo.mp4"), HeightRequest = 600, diff --git a/samples/CommunityToolkit.Maui.Sample/ViewModels/Behaviors/TouchBehavior/TouchBehaviorCollectionViewMultipleSelectionViewModel.cs b/samples/CommunityToolkit.Maui.Sample/ViewModels/Behaviors/TouchBehavior/TouchBehaviorCollectionViewMultipleSelectionViewModel.cs index 9f362c391b..89178c70d3 100644 --- a/samples/CommunityToolkit.Maui.Sample/ViewModels/Behaviors/TouchBehavior/TouchBehaviorCollectionViewMultipleSelectionViewModel.cs +++ b/samples/CommunityToolkit.Maui.Sample/ViewModels/Behaviors/TouchBehavior/TouchBehaviorCollectionViewMultipleSelectionViewModel.cs @@ -11,6 +11,6 @@ public partial class TouchBehaviorCollectionViewMultipleSelectionViewModel : Bas [RelayCommand] void OnRowTapped(ContentCreator creatorTapped) { - Trace.WriteLine($"{creatorTapped.Name} Tapped"); + Trace.TraceInformation($"{creatorTapped.Name} Tapped"); } } \ No newline at end of file diff --git a/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/ByteArrayToImageSourceConverterViewModel.cs b/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/ByteArrayToImageSourceConverterViewModel.cs index 83b4b90529..d6cc7e7809 100644 --- a/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/ByteArrayToImageSourceConverterViewModel.cs +++ b/samples/CommunityToolkit.Maui.Sample/ViewModels/Converters/ByteArrayToImageSourceConverterViewModel.cs @@ -44,13 +44,14 @@ async Task DownloadDotNetBotImage(CancellationToken token) var maximumDownloadTime = TimeSpan.FromSeconds(5); var maximumDownloadTimeCTS = new CancellationTokenSource(maximumDownloadTime); - // Ensure Activity Indicator appears on screen for a minumum of 1.5 seconds when the user taps the Download Button + // Ensure Activity Indicator appears on screen for a minimum of 1.5 seconds when the user taps the Download Button var minimumDownloadTime = TimeSpan.FromSeconds(1.5); var minimumDownloadTimeTask = Task.Delay(minimumDownloadTime, maximumDownloadTimeCTS.Token).WaitAsync(token); try { - DotNetBotImageByteArray = await client.GetByteArrayAsync("https://user-images.githubusercontent.com/13558917/137551073-ac8958bf-83e3-4ae3-8623-4db6dce49d02.png", maximumDownloadTimeCTS.Token).WaitAsync(token).ConfigureAwait(false); + const string dotnetBotImageUrl = "https://user-images.githubusercontent.com/13558917/137551073-ac8958bf-83e3-4ae3-8623-4db6dce49d02.png"; + DotNetBotImageByteArray = await client.GetByteArrayAsync(dotnetBotImageUrl, maximumDownloadTimeCTS.Token).WaitAsync(token).ConfigureAwait(false); await minimumDownloadTimeTask.ConfigureAwait(false); @@ -58,7 +59,7 @@ async Task DownloadDotNetBotImage(CancellationToken token) } catch (Exception e) { - Trace.WriteLine(e); + Trace.TraceError("Error downloading image: {0}", e); OnImageDownloadFailed(e.Message); } finally diff --git a/samples/CommunityToolkit.Maui.Sample/ViewModels/Essentials/FileSaverViewModel.cs b/samples/CommunityToolkit.Maui.Sample/ViewModels/Essentials/FileSaverViewModel.cs index a21c51d494..e3d701bac3 100644 --- a/samples/CommunityToolkit.Maui.Sample/ViewModels/Essentials/FileSaverViewModel.cs +++ b/samples/CommunityToolkit.Maui.Sample/ViewModels/Essentials/FileSaverViewModel.cs @@ -48,7 +48,9 @@ async Task SaveFileStatic(CancellationToken cancellationToken) async Task SaveFileInstance(CancellationToken cancellationToken) { using var client = new HttpClient(); - await using var stream = await client.GetStreamAsync("https://www.nuget.org/api/v2/package/CommunityToolkit.Maui/5.0.0", cancellationToken); + + const string communityToolkitNuGetUrl = "https://www.nuget.org/api/v2/package/CommunityToolkit.Maui/5.0.0"; + await using var stream = await client.GetStreamAsync(communityToolkitNuGetUrl, cancellationToken); try { var fileSaverInstance = new FileSaverImplementation(); diff --git a/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/MediaElementCarouselViewViewModel.cs b/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/MediaElementCarouselViewViewModel.cs index 27ed35b468..a9715ebffd 100644 --- a/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/MediaElementCarouselViewViewModel.cs +++ b/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/MediaElementCarouselViewViewModel.cs @@ -3,11 +3,15 @@ namespace CommunityToolkit.Maui.Sample.ViewModels.Views; public partial class MediaElementCarouselViewViewModel : BaseViewModel { + const string buckBunnyMp4Url = "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"; + const string elephantsDreamMp4Url = "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4"; + const string sintelMp4Url = "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/Sintel.mp4"; + public ObservableCollection ItemSource { get; } = [ - new(new Uri("https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"), "Buck Bunny", 720, 1280), - new(new Uri("https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4"), "Elephants Dream", 720, 1280), - new(new Uri("https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/Sintel.mp4"), "Sintel", 546, 1280) + new(new Uri(buckBunnyMp4Url), "Buck Bunny", 720, 1280), + new(new Uri(elephantsDreamMp4Url), "Elephants Dream", 720, 1280), + new(new Uri(sintelMp4Url), "Sintel", 546, 1280) ]; } diff --git a/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/MediaElementCollectionViewViewModel.cs b/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/MediaElementCollectionViewViewModel.cs index c12760a12f..8df3f64fb4 100644 --- a/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/MediaElementCollectionViewViewModel.cs +++ b/samples/CommunityToolkit.Maui.Sample/ViewModels/Views/MediaElementCollectionViewViewModel.cs @@ -3,10 +3,14 @@ namespace CommunityToolkit.Maui.Sample.ViewModels.Views; public partial class MediaElementCollectionViewViewModel : BaseViewModel { + const string buckBunnyMp4Url = "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"; + const string elephantsDreamMp4Url = "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4"; + const string sintelMp4Url = "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/Sintel.mp4"; + public ObservableCollection ItemSource { get; } = [ - new(new Uri("https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"), "Buck Bunny", 720, 1280), - new(new Uri("https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4"), "Elephants Dream", 720, 1280), - new(new Uri("https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/Sintel.mp4"), "Sintel", 546, 1280) + new(new Uri(buckBunnyMp4Url), "Buck Bunny", 720, 1280), + new(new Uri(elephantsDreamMp4Url), "Elephants Dream", 720, 1280), + new(new Uri(sintelMp4Url), "Sintel", 546, 1280) ]; } \ No newline at end of file diff --git a/src/CommunityToolkit.Maui/Behaviors/AnimationBehavior.shared.cs b/src/CommunityToolkit.Maui/Behaviors/AnimationBehavior.shared.cs index fb50a1cdc1..87247e8ea2 100644 --- a/src/CommunityToolkit.Maui/Behaviors/AnimationBehavior.shared.cs +++ b/src/CommunityToolkit.Maui/Behaviors/AnimationBehavior.shared.cs @@ -115,7 +115,7 @@ async Task OnAnimate(CancellationToken token) } catch (Exception ex) when (Options.ShouldSuppressExceptionsInAnimations) { - Trace.WriteLine(ex); + Trace.TraceInformation("{0}", ex); } } } \ No newline at end of file diff --git a/src/CommunityToolkit.Maui/Behaviors/ICommunityToolkitBehavior.shared.cs b/src/CommunityToolkit.Maui/Behaviors/ICommunityToolkitBehavior.shared.cs index 0df155889f..05fcf3ce51 100644 --- a/src/CommunityToolkit.Maui/Behaviors/ICommunityToolkitBehavior.shared.cs +++ b/src/CommunityToolkit.Maui/Behaviors/ICommunityToolkitBehavior.shared.cs @@ -89,7 +89,7 @@ protected void OnViewPropertyChanged(object? sender, PropertyChangedEventArgs e) } catch (Exception ex) when (Options.ShouldSuppressExceptionsInBehaviors) { - Trace.WriteLine(ex); + Trace.TraceInformation("{0}", ex); } } diff --git a/src/CommunityToolkit.Maui/Behaviors/ImpliedOrderGridBehavior.shared.cs b/src/CommunityToolkit.Maui/Behaviors/ImpliedOrderGridBehavior.shared.cs index e86b5d4496..4ee8fd8cc8 100644 --- a/src/CommunityToolkit.Maui/Behaviors/ImpliedOrderGridBehavior.shared.cs +++ b/src/CommunityToolkit.Maui/Behaviors/ImpliedOrderGridBehavior.shared.cs @@ -34,7 +34,7 @@ protected override void OnDetachingFrom(Grid bindable) static void LogWarning(string warning, bool shouldThrowException) { - System.Diagnostics.Trace.WriteLine(warning); + System.Diagnostics.Trace.TraceWarning(warning); if (shouldThrowException) { diff --git a/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.methods.shared.cs b/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.methods.shared.cs index 026e9cc10b..5f85cd6811 100644 --- a/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.methods.shared.cs +++ b/src/CommunityToolkit.Maui/Behaviors/PlatformBehaviors/Touch/TouchBehavior.methods.shared.cs @@ -63,7 +63,7 @@ internal async Task ForceUpdateState(CancellationToken token, bool animated = tr } catch (TaskCanceledException ex) { - Trace.WriteLine(ex); + Trace.TraceInformation("{0}", ex); } } diff --git a/src/CommunityToolkit.Maui/Behaviors/Validators/MultiValidationBehavior.shared.cs b/src/CommunityToolkit.Maui/Behaviors/Validators/MultiValidationBehavior.shared.cs index 8296ab05cc..5275c32094 100644 --- a/src/CommunityToolkit.Maui/Behaviors/Validators/MultiValidationBehavior.shared.cs +++ b/src/CommunityToolkit.Maui/Behaviors/Validators/MultiValidationBehavior.shared.cs @@ -66,9 +66,9 @@ await Task.WhenAll(children.Select(c => return c.ValidateNestedAsync(token).AsTask(); })).ConfigureAwait(false); - var errors = children.Where(c => c.IsNotValid).Select(GetError).ToList(); + var errors = children.Where(static c => c.IsNotValid).Select(GetError).ToList(); - if (!errors.Any()) + if (errors.Count is 0) { Errors = null; return true; @@ -82,7 +82,7 @@ await Task.WhenAll(children.Select(c => return false; } - void OnChildrenCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) + static void OnChildrenCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) { if (e.NewItems is not null) { @@ -91,7 +91,7 @@ void OnChildrenCollectionChanged(object? sender, NotifyCollectionChangedEventArg var isSuccessful = ((ICommunityToolkitBehavior)child).TrySetBindingContextToAttachedViewBindingContext(); if (!isSuccessful) { - Trace.WriteLine($"Setting {nameof(BindingContext)} for {child.GetType()} failed"); + Trace.TraceInformation($"Setting {nameof(BindingContext)} for {child.GetType()} failed"); } } } diff --git a/src/CommunityToolkit.Maui/Behaviors/Validators/ValidationBehavior.shared.cs b/src/CommunityToolkit.Maui/Behaviors/Validators/ValidationBehavior.shared.cs index a9f324ad00..4a22bb6e4e 100644 --- a/src/CommunityToolkit.Maui/Behaviors/Validators/ValidationBehavior.shared.cs +++ b/src/CommunityToolkit.Maui/Behaviors/Validators/ValidationBehavior.shared.cs @@ -397,7 +397,7 @@ async ValueTask UpdateStateAsync(VisualElement? view, ValidationFlags flags, boo IsValid = false; IsRunning = false; - Trace.WriteLine(ex); + Trace.TraceInformation("{0}", ex); } } diff --git a/src/CommunityToolkit.Maui/Converters/BaseConverter.shared.cs b/src/CommunityToolkit.Maui/Converters/BaseConverter.shared.cs index 6bc8e7c9ca..cf020e530b 100644 --- a/src/CommunityToolkit.Maui/Converters/BaseConverter.shared.cs +++ b/src/CommunityToolkit.Maui/Converters/BaseConverter.shared.cs @@ -73,7 +73,7 @@ public abstract class BaseConverter<[DynamicallyAccessedMembers(DynamicallyAcces } catch (Exception ex) when (Options.ShouldSuppressExceptionsInConverters) { - Trace.WriteLine(ex); + Trace.TraceInformation("{0}", ex); return DefaultConvertBackReturnValue; } } @@ -92,7 +92,7 @@ public abstract class BaseConverter<[DynamicallyAccessedMembers(DynamicallyAcces } catch (Exception ex) when (Options.ShouldSuppressExceptionsInConverters) { - Trace.WriteLine(ex); + Trace.TraceInformation("{0}", ex); return DefaultConvertReturnValue; } } @@ -157,7 +157,7 @@ public abstract class BaseConverter<[DynamicallyAccessedMembers(DynamicallyAcces } catch (Exception ex) when (Options.ShouldSuppressExceptionsInConverters) { - Trace.WriteLine(ex); + Trace.TraceInformation("{0}", ex); return DefaultConvertBackReturnValue; } } @@ -175,7 +175,7 @@ public abstract class BaseConverter<[DynamicallyAccessedMembers(DynamicallyAcces } catch (Exception ex) when (Options.ShouldSuppressExceptionsInConverters) { - Trace.WriteLine(ex); + Trace.TraceInformation("{0}", ex); return DefaultConvertReturnValue; } }