Skip to content

Commit 0393840

Browse files
committed
Revert "Used x:Reference in Button and ProgressBar ControlTemplates (#3868)"
This reverts commit 442f311.
1 parent 4de685b commit 0393840

File tree

2 files changed

+36
-38
lines changed

2 files changed

+36
-38
lines changed

src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Button.xaml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@
6868
Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(wpf:ButtonProgressAssist.Value)}">
6969
<ProgressBar.Clip>
7070
<MultiBinding Converter="{x:Static converters:BorderClipConverter.Instance}">
71-
<Binding Source="{x:Reference border}" Path="ActualWidth" />
72-
<Binding Source="{x:Reference border}" Path="ActualHeight" />
73-
<Binding Source="{x:Reference border}" Path="CornerRadius" />
74-
<Binding Source="{x:Reference border}" Path="BorderThickness" />
71+
<Binding ElementName="border" Path="ActualWidth" />
72+
<Binding ElementName="border" Path="ActualHeight" />
73+
<Binding ElementName="border" Path="CornerRadius" />
74+
<Binding ElementName="border" Path="BorderThickness" />
7575
</MultiBinding>
7676
</ProgressBar.Clip>
7777
</ProgressBar>
@@ -87,10 +87,10 @@
8787
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
8888
<wpf:Ripple.Clip>
8989
<MultiBinding Converter="{x:Static converters:BorderClipConverter.Instance}">
90-
<Binding Source="{x:Reference border}" Path="ActualWidth" />
91-
<Binding Source="{x:Reference border}" Path="ActualHeight" />
92-
<Binding Source="{x:Reference border}" Path="CornerRadius" />
93-
<Binding Source="{x:Reference border}" Path="BorderThickness" />
90+
<Binding ElementName="border" Path="ActualWidth" />
91+
<Binding ElementName="border" Path="ActualHeight" />
92+
<Binding ElementName="border" Path="CornerRadius" />
93+
<Binding ElementName="border" Path="BorderThickness" />
9494
</MultiBinding>
9595
</wpf:Ripple.Clip>
9696
</wpf:Ripple>
@@ -199,10 +199,10 @@
199199
Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(wpf:ButtonProgressAssist.Value)}">
200200
<ProgressBar.Clip>
201201
<MultiBinding Converter="{x:Static converters:BorderClipConverter.Instance}">
202-
<Binding Source="{x:Reference border}" Path="ActualWidth" />
203-
<Binding Source="{x:Reference border}" Path="ActualHeight" />
204-
<Binding Source="{x:Reference border}" Path="CornerRadius" />
205-
<Binding Source="{x:Reference border}" Path="BorderThickness" />
202+
<Binding ElementName="border" Path="ActualWidth" />
203+
<Binding ElementName="border" Path="ActualHeight" />
204+
<Binding ElementName="border" Path="CornerRadius" />
205+
<Binding ElementName="border" Path="BorderThickness" />
206206
</MultiBinding>
207207
</ProgressBar.Clip>
208208
</ProgressBar>
@@ -217,10 +217,10 @@
217217
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
218218
<wpf:Ripple.Clip>
219219
<MultiBinding Converter="{x:Static converters:BorderClipConverter.Instance}">
220-
<Binding Source="{x:Reference border}" Path="ActualWidth" />
221-
<Binding Source="{x:Reference border}" Path="ActualHeight" />
222-
<Binding Source="{x:Reference border}" Path="CornerRadius" />
223-
<Binding Source="{x:Reference border}" Path="BorderThickness" />
220+
<Binding ElementName="border" Path="ActualWidth" />
221+
<Binding ElementName="border" Path="ActualHeight" />
222+
<Binding ElementName="border" Path="CornerRadius" />
223+
<Binding ElementName="border" Path="BorderThickness" />
224224
</MultiBinding>
225225
</wpf:Ripple.Clip>
226226
</wpf:Ripple>
@@ -357,10 +357,10 @@
357357
Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(wpf:ButtonProgressAssist.Value)}">
358358
<ProgressBar.Clip>
359359
<MultiBinding Converter="{x:Static converters:BorderClipConverter.Instance}">
360-
<Binding Source="{x:Reference border}" Path="ActualWidth" />
361-
<Binding Source="{x:Reference border}" Path="ActualHeight" />
362-
<Binding Source="{x:Reference border}" Path="CornerRadius" />
363-
<Binding Source="{x:Reference border}" Path="BorderThickness" />
360+
<Binding ElementName="border" Path="ActualWidth" />
361+
<Binding ElementName="border" Path="ActualHeight" />
362+
<Binding ElementName="border" Path="CornerRadius" />
363+
<Binding ElementName="border" Path="BorderThickness" />
364364
</MultiBinding>
365365
</ProgressBar.Clip>
366366
</ProgressBar>
@@ -375,10 +375,10 @@
375375
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
376376
<wpf:Ripple.Clip>
377377
<MultiBinding Converter="{x:Static converters:BorderClipConverter.Instance}">
378-
<Binding Source="{x:Reference border}" Path="ActualWidth" />
379-
<Binding Source="{x:Reference border}" Path="ActualHeight" />
380-
<Binding Source="{x:Reference border}" Path="CornerRadius" />
381-
<Binding Source="{x:Reference border}" Path="BorderThickness" />
378+
<Binding ElementName="border" Path="ActualWidth" />
379+
<Binding ElementName="border" Path="ActualHeight" />
380+
<Binding ElementName="border" Path="CornerRadius" />
381+
<Binding ElementName="border" Path="BorderThickness" />
382382
</MultiBinding>
383383
</wpf:Ripple.Clip>
384384
</wpf:Ripple>
@@ -802,10 +802,10 @@
802802
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
803803
<wpf:Ripple.Clip>
804804
<MultiBinding Converter="{x:Static converters:BorderClipConverter.Instance}">
805-
<Binding Source="{x:Reference border}" Path="ActualWidth" />
806-
<Binding Source="{x:Reference border}" Path="ActualHeight" />
807-
<Binding Source="{x:Reference border}" Path="CornerRadius" />
808-
<Binding Source="{x:Reference border}" Path="BorderThickness" />
805+
<Binding ElementName="border" Path="ActualWidth" />
806+
<Binding ElementName="border" Path="ActualHeight" />
807+
<Binding ElementName="border" Path="CornerRadius" />
808+
<Binding ElementName="border" Path="BorderThickness" />
809809
</MultiBinding>
810810
</wpf:Ripple.Clip>
811811
</wpf:Ripple>

src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ProgressBar.xaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,26 +184,26 @@
184184
StrokeThickness="3">
185185
<Path.Data>
186186
<PathGeometry>
187-
<PathFigure StartPoint="{Binding Source={x:Reference PathGrid}, Path=ActualWidth, Converter={x:Static circularProgressBarConverters:StartPointConverter.Instance}, Mode=OneWay}">
188-
<ArcSegment Size="{Binding Source={x:Reference PathGrid}, Path=ActualWidth, Converter={x:Static circularProgressBarConverters:ArcSizeConverter.Instance}, Mode=OneWay}" SweepDirection="Clockwise">
187+
<PathFigure StartPoint="{Binding ElementName=PathGrid, Path=ActualWidth, Converter={x:Static circularProgressBarConverters:StartPointConverter.Instance}, Mode=OneWay}">
188+
<ArcSegment Size="{Binding ElementName=PathGrid, Path=ActualWidth, Converter={x:Static circularProgressBarConverters:ArcSizeConverter.Instance}, Mode=OneWay}" SweepDirection="Clockwise">
189189
<ArcSegment.Point>
190190
<MultiBinding Converter="{x:Static circularProgressBarConverters:ArcEndPointConverter.Instance}" ConverterParameter="{x:Static circularProgressBarConverters:ArcEndPointConverter.ParameterMidPoint}">
191-
<Binding Source="{x:Reference PathGrid}" Path="ActualWidth" />
191+
<Binding ElementName="PathGrid" Path="ActualWidth" />
192192
<Binding Path="Value" RelativeSource="{RelativeSource TemplatedParent}" />
193193
<Binding Path="Minimum" RelativeSource="{RelativeSource TemplatedParent}" />
194194
<Binding Path="Maximum" RelativeSource="{RelativeSource TemplatedParent}" />
195-
<Binding Source="{x:Reference FullyIndeterminateGridScaleTransform}" Path="ScaleX" />
195+
<Binding ElementName="FullyIndeterminateGridScaleTransform" Path="ScaleX" />
196196
</MultiBinding>
197197
</ArcSegment.Point>
198198
</ArcSegment>
199-
<ArcSegment Size="{Binding Source={x:Reference PathGrid}, Path=ActualWidth, Converter={x:Static circularProgressBarConverters:ArcSizeConverter.Instance}, Mode=OneWay}" SweepDirection="Clockwise">
199+
<ArcSegment Size="{Binding ElementName=PathGrid, Path=ActualWidth, Converter={x:Static circularProgressBarConverters:ArcSizeConverter.Instance}, Mode=OneWay}" SweepDirection="Clockwise">
200200
<ArcSegment.Point>
201201
<MultiBinding Converter="{x:Static circularProgressBarConverters:ArcEndPointConverter.Instance}">
202-
<Binding Source="{x:Reference PathGrid}" Path="ActualWidth" />
202+
<Binding ElementName="PathGrid" Path="ActualWidth" />
203203
<Binding Path="Value" RelativeSource="{RelativeSource TemplatedParent}" />
204204
<Binding Path="Minimum" RelativeSource="{RelativeSource TemplatedParent}" />
205205
<Binding Path="Maximum" RelativeSource="{RelativeSource TemplatedParent}" />
206-
<Binding Source="{x:Reference FullyIndeterminateGridScaleTransform}" Path="ScaleX" />
206+
<Binding ElementName="FullyIndeterminateGridScaleTransform" Path="ScaleX" />
207207
</MultiBinding>
208208
</ArcSegment.Point>
209209
</ArcSegment>
@@ -212,9 +212,7 @@
212212
</Path.Data>
213213
<Path.RenderTransform>
214214
<TransformGroup>
215-
<RotateTransform x:Name="RotateTransform"
216-
CenterX="{Binding Source={x:Reference PathGrid}, Path=ActualWidth, Converter={x:Static circularProgressBarConverters:RotateTransformCentreConverter.Instance}, Mode=OneWay}"
217-
CenterY="{Binding Source={x:Reference PathGrid}, Path=ActualWidth, Converter={x:Static circularProgressBarConverters:RotateTransformCentreConverter.Instance}, Mode=OneWay}" />
215+
<RotateTransform x:Name="RotateTransform" CenterX="{Binding ElementName=PathGrid, Path=ActualWidth, Converter={x:Static circularProgressBarConverters:RotateTransformCentreConverter.Instance}, Mode=OneWay}" CenterY="{Binding ElementName=PathGrid, Path=ActualWidth, Converter={x:Static circularProgressBarConverters:RotateTransformCentreConverter.Instance}, Mode=OneWay}" />
218216
</TransformGroup>
219217
</Path.RenderTransform>
220218
</Path>

0 commit comments

Comments
 (0)