Skip to content

Commit

Permalink
(MahAppsGH-3136) DoubleToGridLengthConverter is not necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
punker76 committed Sep 2, 2019
1 parent 49673aa commit a408373
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 30 deletions.
24 changes: 0 additions & 24 deletions src/MahApps.Metro/Converters/DoubleToGridLengthConverter.cs

This file was deleted.

9 changes: 3 additions & 6 deletions src/MahApps.Metro/Styles/Controls.CheckBox.xaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls"
xmlns:Converter="clr-namespace:MahApps.Metro.Converters">
xmlns:Controls="clr-namespace:MahApps.Metro.Controls">

<Converter:DoubleToGridLengthConverter x:Key="DoubleToGridLengthConverter" />

<!-- ********************************** CheckBoxStyle ********************************** -->
<!-- adapted from http://brianlagunas.com/free-metro-light-and-dark-themes-for-wpf-and-silverlight-microsoft-controls/ -->
<Style x:Key="MahApps.Styles.CheckBox" TargetType="CheckBox">
Expand All @@ -29,7 +26,7 @@
<ControlTemplate TargetType="CheckBox">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="LeftCol" Width="{TemplateBinding Controls:CheckBoxHelper.CheckBoxSize,Converter={StaticResource DoubleToGridLengthConverter}}" />
<ColumnDefinition x:Name="LeftCol" Width="Auto" />
<ColumnDefinition x:Name="RightCol" Width="*" />
</Grid.ColumnDefinitions>
<Grid x:Name="PART_CHECKBOX">
Expand Down Expand Up @@ -179,7 +176,7 @@
<Setter Property="Padding" Value="0 0 6 0" />
<Setter TargetName="LeftCol" Property="Width" Value="*" />
<Setter TargetName="PART_CHECKBOX" Property="Grid.Column" Value="1" />
<Setter TargetName="RightCol" Property="Width" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=CheckBox}, Path=(Controls:CheckBoxHelper.CheckBoxSize), Converter={StaticResource DoubleToGridLengthConverter}}" />
<Setter TargetName="RightCol" Property="Width" Value="Auto" />
<Setter TargetName="contentPresenter" Property="Grid.Column" Value="0" />
</Trigger>
</ControlTemplate.Triggers>
Expand Down

0 comments on commit a408373

Please sign in to comment.