@@ -137,18 +137,31 @@ public ResourceDictionary GetResourceDictionary()
137
137
var dict = CurrentThemeResourceDictionary ( ) ;
138
138
139
139
Style queryBoxStyle = dict [ "QueryBoxStyle" ] as Style ;
140
- if ( queryBoxStyle != null )
140
+ Style querySuggestionBoxStyle = dict [ "QuerySuggestionBoxStyle" ] as Style ;
141
+
142
+ if ( queryBoxStyle != null && querySuggestionBoxStyle != null )
141
143
{
142
- queryBoxStyle . Setters . Add ( new Setter ( TextBox . FontFamilyProperty , new FontFamily ( Settings . QueryBoxFont ) ) ) ;
143
- queryBoxStyle . Setters . Add ( new Setter ( TextBox . FontStyleProperty , FontHelper . GetFontStyleFromInvariantStringOrNormal ( Settings . QueryBoxFontStyle ) ) ) ;
144
- queryBoxStyle . Setters . Add ( new Setter ( TextBox . FontWeightProperty , FontHelper . GetFontWeightFromInvariantStringOrNormal ( Settings . QueryBoxFontWeight ) ) ) ;
145
- queryBoxStyle . Setters . Add ( new Setter ( TextBox . FontStretchProperty , FontHelper . GetFontStretchFromInvariantStringOrNormal ( Settings . QueryBoxFontStretch ) ) ) ;
144
+ var fontFamily = new FontFamily ( Settings . QueryBoxFont ) ;
145
+ var fontStyle = FontHelper . GetFontStyleFromInvariantStringOrNormal ( Settings . QueryBoxFontStyle ) ;
146
+ var fontWeight = FontHelper . GetFontWeightFromInvariantStringOrNormal ( Settings . QueryBoxFontWeight ) ;
147
+ var fontStretch = FontHelper . GetFontStretchFromInvariantStringOrNormal ( Settings . QueryBoxFontStretch ) ;
148
+
149
+ queryBoxStyle . Setters . Add ( new Setter ( TextBox . FontFamilyProperty , fontFamily ) ) ;
150
+ queryBoxStyle . Setters . Add ( new Setter ( TextBox . FontStyleProperty , fontStyle ) ) ;
151
+ queryBoxStyle . Setters . Add ( new Setter ( TextBox . FontWeightProperty , fontWeight ) ) ;
152
+ queryBoxStyle . Setters . Add ( new Setter ( TextBox . FontStretchProperty , fontStretch ) ) ;
146
153
147
154
var caretBrushPropertyValue = queryBoxStyle . Setters . OfType < Setter > ( ) . Any ( x => x . Property . Name == "CaretBrush" ) ;
148
155
var foregroundPropertyValue = queryBoxStyle . Setters . OfType < Setter > ( ) . Where ( x => x . Property . Name == "Foreground" )
149
156
. Select ( x => x . Value ) . FirstOrDefault ( ) ;
150
157
if ( ! caretBrushPropertyValue && foregroundPropertyValue != null ) //otherwise BaseQueryBoxStyle will handle styling
151
158
queryBoxStyle . Setters . Add ( new Setter ( TextBox . CaretBrushProperty , foregroundPropertyValue ) ) ;
159
+
160
+ // Query suggestion box's font style is aligned with query box
161
+ querySuggestionBoxStyle . Setters . Add ( new Setter ( TextBox . FontFamilyProperty , fontFamily ) ) ;
162
+ querySuggestionBoxStyle . Setters . Add ( new Setter ( TextBox . FontStyleProperty , fontStyle ) ) ;
163
+ querySuggestionBoxStyle . Setters . Add ( new Setter ( TextBox . FontWeightProperty , fontWeight ) ) ;
164
+ querySuggestionBoxStyle . Setters . Add ( new Setter ( TextBox . FontStretchProperty , fontStretch ) ) ;
152
165
}
153
166
154
167
Style resultItemStyle = dict [ "ItemTitleStyle" ] as Style ;
0 commit comments