의 새로운 아이콘 Segoe MDL2 자산의 크기와 위치는 동일합니다. 세부 사항은 Segoe MDL2 icons을 참조하십시오. 그리고 SymbolIcon
에는 글꼴 크기 상대 속성이 없습니다.
그러나 쿼리 아이콘의 크기를 변경하려면 다음과 같은 두 가지 해결 방법이 있습니다.
SymbolIcon
은 CompositeTransform
입니다. 코드는 다음과 같습니다 :
<AutoSuggestBox>
<AutoSuggestBox.QueryIcon>
<SymbolIcon Symbol="Find" Foreground="Green" >
<SymbolIcon.RenderTransform>
<CompositeTransform ScaleX="2" ScaleY="2"/>
</SymbolIcon.RenderTransform>
</SymbolIcon>
</AutoSuggestBox.QueryIcon>
</AutoSuggestBox>
현재 수행 한 것과 같은 템플릿을 업데이트하는 또 다른 방법입니다. 쿼리 단추 스타일은 AutoSuggestBox
스타일 및 템플릿 중 QueryButtonStyle
에 정의되어 있습니다. 그것을 찾아서 업데이트해야합니다. 속성 하나를 변경하는 대신 을 ButtonLayoutGrid
외부에 추가하고 ViewBox
의 높이와 너비를 설정하여 아이콘의 크기를 제어해야 할 수 있습니다. 코드는 다음과 같습니다 :
<Style x:Name="QueryButtonStyle" TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Viewbox Height="50" Width="50">
<Grid x:Name="ButtonLayoutGrid" BorderBrush="{ThemeResource TextControlButtonBorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{ThemeResource TextControlButtonBackground}">
<VisualStateManager.VisualStateGroups>
...
</VisualStateManager.VisualStateGroups>
<ContentPresenter x:Name="ContentPresenter" AutomationProperties.AccessibilityView="Raw" ContentTemplate="{TemplateBinding ContentTemplate}" ContentTransitions="{TemplateBinding ContentTransitions}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid></Viewbox>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>