diff --git a/samples/CommunityToolkit.Maui.Sample/ViewModels/Essentials/OfflineSpeechToTextViewModel.cs b/samples/CommunityToolkit.Maui.Sample/ViewModels/Essentials/OfflineSpeechToTextViewModel.cs index e4d2b90f4d..e02718a8cc 100644 --- a/samples/CommunityToolkit.Maui.Sample/ViewModels/Essentials/OfflineSpeechToTextViewModel.cs +++ b/samples/CommunityToolkit.Maui.Sample/ViewModels/Essentials/OfflineSpeechToTextViewModel.cs @@ -10,11 +10,6 @@ public partial class OfflineSpeechToTextViewModel : BaseViewModel { readonly ISpeechToText speechToText; - public SpeechToTextState? State => speechToText.CurrentState; - - [ObservableProperty] - string? recognitionText = "Welcome to .NET MAUI Community Toolkit!"; - public OfflineSpeechToTextViewModel() { // For demo purposes. You can resolve dependency from the DI container, @@ -24,6 +19,11 @@ public OfflineSpeechToTextViewModel() speechToText.RecognitionResultCompleted += HandleRecognitionResultCompleted; } + public SpeechToTextState? State => speechToText.CurrentState; + + [ObservableProperty] + public partial string? RecognitionText { get; set; } = "Welcome to .NET MAUI Community Toolkit!"; + [RelayCommand] async Task StartListen() { diff --git a/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.windows.cs b/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.windows.cs index 694eae374b..26477c60ed 100644 --- a/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.windows.cs +++ b/src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.windows.cs @@ -83,7 +83,7 @@ void ResultGenerated(SpeechContinuousRecognitionSession sender, SpeechContinuous } Task InternalStopListeningAsync(CancellationToken cancellationToken) => StopRecording(cancellationToken); - + async Task StopRecording(CancellationToken cancellationToken) { try diff --git a/src/CommunityToolkit.Maui.Core/Views/DrawingView/Service/DrawingViewService.windows.cs b/src/CommunityToolkit.Maui.Core/Views/DrawingView/Service/DrawingViewService.windows.cs index 3c17ce07de..560fe67eb5 100644 --- a/src/CommunityToolkit.Maui.Core/Views/DrawingView/Service/DrawingViewService.windows.cs +++ b/src/CommunityToolkit.Maui.Core/Views/DrawingView/Service/DrawingViewService.windows.cs @@ -133,7 +133,7 @@ static void DrawStrokes(CanvasDrawingSession session, static CanvasRenderTarget? GetImageInternal(IList lines, Size size, Paint? background, bool scale = false) { var points = lines.SelectMany(x => x.Points).ToList(); - if(points.Count is 0) + if (points.Count is 0) { return null; }