@@ -137,18 +137,31 @@ public ResourceDictionary GetResourceDictionary()
137137 var dict = CurrentThemeResourceDictionary ( ) ;
138138
139139 Style queryBoxStyle = dict [ "QueryBoxStyle" ] as Style ;
140- if ( queryBoxStyle != null )
140+ Style querySuggestionBoxStyle = dict [ "QuerySuggestionBoxStyle" ] as Style ;
141+
142+ if ( queryBoxStyle != null && querySuggestionBoxStyle != null )
141143 {
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 ) ) ;
146153
147154 var caretBrushPropertyValue = queryBoxStyle . Setters . OfType < Setter > ( ) . Any ( x => x . Property . Name == "CaretBrush" ) ;
148155 var foregroundPropertyValue = queryBoxStyle . Setters . OfType < Setter > ( ) . Where ( x => x . Property . Name == "Foreground" )
149156 . Select ( x => x . Value ) . FirstOrDefault ( ) ;
150157 if ( ! caretBrushPropertyValue && foregroundPropertyValue != null ) //otherwise BaseQueryBoxStyle will handle styling
151158 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 ) ) ;
152165 }
153166
154167 Style resultItemStyle = dict [ "ItemTitleStyle" ] as Style ;
0 commit comments