Checkbox have about extra 80 pixels. I'm guess it because of ContentPresenter. I have tried to set width for content 0 or Auto or 1, but in any case checkbox have an extra space at right from glyph. Here is checkbox in usercontrol:
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<CheckBox Style="{StaticResource JagermasterCheckSettingsActivation}" />
Here is part of checkbox style:
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid VerticalAlignment="Top" Background="{StaticResource JagermasterBackgroundBrush}">
<Rectangle x:Name="NormalRectangle"
Fill="{StaticResource JagermasterBackgroundBrush}"
StrokeThickness="{ThemeResource CheckBoxBorderThemeThickness}"
UseLayoutRounding="False"
Height="30"
Width="30"
Margin="5"/>
<Path Style="{StaticResource CogweelPath}" Opacity="0.5" x:Name="MoreAboutTargetsCogweel">
<Path.Data>
<GeometryGroup FillRule="EvenOdd">
<Geometry>M109.801714032956,0.481527332780307A100,100,0,0,0,90.1982859670439,0.481527332780307L78.2286492059153,28.2294748200843 64.6452447380502,33.8559051738734 36.5606715836355,22.6989546637263A100,100,0,0,0,22.6989546637263,36.5606715836355L33.8559051738734,64.6452447380502 28.2294748200843,78.2286492059153 0.481527332780318,90.1982859670439A100,100,0,0,0,0.481527332780307,109.801714032956L28.2294748200843,121.771350794085 33.8559051738734,135.35475526195 22.6989546637263,163.439328416365A100,100,0,0,0,36.5606715836354,177.301045336274L64.6452447380502,166.144094826127 78.2286492059153,171.770525179916 90.1982859670439,199.51847266722A100,100,0,0,0,109.801714032956,199.51847266722L121.771350794085,171.770525179916 135.35475526195,166.144094826127 163.439328416365,177.301045336274A100,100,0,0,0,177.301045336274,163.439328416365L166.144094826127,135.35475526195 171.770525179916,121.771350794085 199.51847266722,109.801714032956A100,100,0,0,0,199.51847266722,90.1982859670439L171.770525179916,78.2286492059153 166.144094826127,64.6452447380502 177.301045336274,36.5606715836354A100,100,0,0,0,163.439328416365,22.6989546637263L135.35475526195,33.8559051738734 121.771350794085,28.2294748200843z</Geometry>
<EllipseGeometry RadiusX="40" RadiusY="40" Center="100,100"/>
</GeometryGroup>
</Path.Data>
</Path>
<Rectangle x:Name="IndeterminateGlyph"
Width="9"
Height="9"
Fill="{ThemeResource CheckBoxForegroundThemeBrush}"
Opacity="0"
UseLayoutRounding="False" />
<Rectangle x:Name="FocusVisualWhite"
Stroke="{StaticResource JagermasterBackgroundBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1,1"
Opacity="0"
StrokeDashOffset="0.5"
Width="27"
Height="27"/>
<Rectangle x:Name="FocusVisualBlack"
Stroke="{ThemeResource FocusVisualBlackStrokeThemeBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1,1"
Opacity="0"
StrokeDashOffset="1.5"
Width="27"
Height="27" />
</Grid>
<ContentPresenter x:Name="ContentPresenter"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTransitions="{TemplateBinding ContentTransitions}"
Content="{TemplateBinding Content}"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Grid.Column="1"
AutomationProperties.AccessibilityView="Raw"/>
</Grid>
Here is screenshot
Aucun commentaire:
Enregistrer un commentaire