MaterialDesignInXamlToolkit icon indicating copy to clipboard operation
MaterialDesignInXamlToolkit copied to clipboard

MaterialDesignActionToggleButton missing binding reference

Open uPloraX opened this issue 10 years ago • 1 comments

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">

uPloraX avatar Sep 02 '16 19:09 uPloraX

This appears to have already been resolved.

Keboo avatar Sep 23 '19 07:09 Keboo