From 25e49f8133203d86977e5aaf3611be4f53f590f1 Mon Sep 17 00:00:00 2001 From: Mahdi Hosseini Date: Wed, 4 May 2022 19:02:44 +0430 Subject: [PATCH 1/2] Fix SuggestionForeground for Dark Mode #5 --- .../AutoCompleteTextBox.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/WinUI3/AK.Toolkit.WinUI3.AutoCompleteTextBox/AutoCompleteTextBox.cs b/WinUI3/AK.Toolkit.WinUI3.AutoCompleteTextBox/AutoCompleteTextBox.cs index 19442a2..56b0ff3 100644 --- a/WinUI3/AK.Toolkit.WinUI3.AutoCompleteTextBox/AutoCompleteTextBox.cs +++ b/WinUI3/AK.Toolkit.WinUI3.AutoCompleteTextBox/AutoCompleteTextBox.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Linq; using Windows.System; +using Windows.UI; namespace AK.Toolkit.WinUI3; @@ -142,10 +143,11 @@ protected override void OnApplyTemplate() { base.OnApplyTemplate(); - if (Resources.TryGetValue("extControlPlaceholderForeground", out var value) is true) + if (Resources.TryGetValue("SystemColorGrayTextColor", out var value) is true) { - if (value is Brush defaultBrush) + if (value is Color defaultColor) { + var defaultBrush = new SolidColorBrush(defaultColor); SuggestionForegroundDefaultBrush = defaultBrush; } } @@ -304,4 +306,4 @@ private void ShowSuggestion() DismissSuggestion(); } } -} \ No newline at end of file +} From d824635d4542e7d24c410ddbe8c966ad07117426 Mon Sep 17 00:00:00 2001 From: Mahdi Hosseini Date: Wed, 4 May 2022 19:17:13 +0430 Subject: [PATCH 2/2] Fix Margin Issue --- .../AutoCompleteTextBox.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WinUI3/AK.Toolkit.WinUI3.AutoCompleteTextBox/AutoCompleteTextBox.cs b/WinUI3/AK.Toolkit.WinUI3.AutoCompleteTextBox/AutoCompleteTextBox.cs index 56b0ff3..1ea2e48 100644 --- a/WinUI3/AK.Toolkit.WinUI3.AutoCompleteTextBox/AutoCompleteTextBox.cs +++ b/WinUI3/AK.Toolkit.WinUI3.AutoCompleteTextBox/AutoCompleteTextBox.cs @@ -183,7 +183,7 @@ private void InitializeSuggestionControl() SuggestionControl.VerticalScrollBarVisibility = ScrollViewer.GetVerticalScrollBarVisibility(this); SuggestionControl.VerticalScrollMode = ScrollViewer.GetVerticalScrollMode(this); SuggestionControl.ZoomMode = ZoomMode.Disabled; - SuggestionControl.Margin = new Thickness(0, 0, 0, 0); + SuggestionControl.Margin = new Thickness(0, -1, 0, 0); if (SuggestionForeground is null && SuggestionForegroundDefaultBrush is not null) {