From fcaccd62f7c1274369f605b2160debb946fd159c Mon Sep 17 00:00:00 2001 From: Andres Pineda Date: Wed, 2 Feb 2022 22:16:16 -0500 Subject: [PATCH] feat(macOS): Add SelectedRange on TextBox --- .../UI/Xaml/Controls/TextBox/TextBoxView.macOS.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Uno.UI/UI/Xaml/Controls/TextBox/TextBoxView.macOS.cs b/src/Uno.UI/UI/Xaml/Controls/TextBox/TextBoxView.macOS.cs index d15cda937f44..cf9477abd812 100644 --- a/src/Uno.UI/UI/Xaml/Controls/TextBox/TextBoxView.macOS.cs +++ b/src/Uno.UI/UI/Xaml/Controls/TextBox/TextBoxView.macOS.cs @@ -148,7 +148,17 @@ public Brush Foreground public NSRange MarkedRange => throw new NotImplementedException(); - public NSRange SelectedRange => throw new NotImplementedException(); + public NSRange SelectedRange + { + get => CurrentEditor?.SelectedRange ?? new NSRange(start: 0, len: 0); + set + { + if (CurrentEditor != null) + { + CurrentEditor.SelectedRange = value; + } + } + } public NSString[] ValidAttributesForMarkedText => null;