MaterialDesignInXamlToolkit
MaterialDesignInXamlToolkit copied to clipboard
MaterialDesignActionToggleButton missing binding reference
I have a simple ToggleButton with the MaterialDesignActionToggleButton in a UserControl which is displayed permanently and set like this:
<ToggleButton Style="{DynamicResource MaterialDesignActionToggleButton}"
IsChecked="{Binding SomeBoolProperty,
RelativeSource={RelativeSource Mode=FindAncestor,
AncestorType={x:Type UserControl}}}">
<ToggleButton.Content>
<materialDesign:PackIcon Width="24"
Height="24"
Kind="HeartOutline" />
</ToggleButton.Content>
<materialDesign:ToggleButtonAssist.OnContent>
<materialDesign:PackIcon Width="24"
Height="24"
Kind="Heart" />
</materialDesign:ToggleButtonAssist.OnContent>
</ToggleButton>
But when the application starts the output console prints following (Defenetly coming from the ToggleButton):
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=UncheckedEllipse'. BindingExpression:Path=RenderedGeometry; DataItem=null; target element is 'Grid' (Name=''); target property is 'Clip' (type 'Geometry')
Edit
So I looked into the Style and found the UncheckedEllipse as a ElementBinding, but not where the Element could actually be...
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid Clip="{Binding ElementName=UncheckedEllipse, Path=RenderedGeometry}"
ClipToBounds="True">
This appears to have already been resolved.