RenderTransform Compilation Error
-
I have a SpinningIndicator in a USERCONTROL. It works fine with no problems. Now, I want to move it to a CUSTOMCONTROL. But it fails to compile on this line:
DoubleAnimation Storyboard.TargetProperty="RenderTransform.Angle"
The error message is
Cannot resolve all property references in the property path 'RenderTransform.Angle'. Verify that applicable objects support the properties.
Here's my XAML
<Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ctrl:SpinningIndicator}"> <Border Background="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{Binding BorderBrush, RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}}" Margin="{Binding Margin, RelativeSource={RelativeSource TemplatedParent}}" Padding="{Binding Padding, RelativeSource={RelativeSource TemplatedParent}}"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="\*"/> </Grid.RowDefinitions> <Canvas Grid.Row="0" Name="Canvas1" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Center" VerticalAlignment="Center" Width="120" Height="120"> <Canvas.RenderTransform> <RotateTransform Angle="0" /> </Canvas.RenderTransform> <Canvas.Style> <Style TargetType="Canvas"> <Style.Triggers> <Trigger Property="IsVisible" Value="True"> </x-turndown>
-
I have a SpinningIndicator in a USERCONTROL. It works fine with no problems. Now, I want to move it to a CUSTOMCONTROL. But it fails to compile on this line:
DoubleAnimation Storyboard.TargetProperty="RenderTransform.Angle"
The error message is
Cannot resolve all property references in the property path 'RenderTransform.Angle'. Verify that applicable objects support the properties.
Here's my XAML
<Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ctrl:SpinningIndicator}"> <Border Background="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{Binding BorderBrush, RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource TemplatedParent}}" Margin="{Binding Margin, RelativeSource={RelativeSource TemplatedParent}}" Padding="{Binding Padding, RelativeSource={RelativeSource TemplatedParent}}"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="\*"/> </Grid.RowDefinitions> <Canvas Grid.Row="0" Name="Canvas1" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Center" VerticalAlignment="Center" Width="120" Height="120"> <Canvas.RenderTransform> <RotateTransform Angle="0" /> </Canvas.RenderTransform> <Canvas.Style> <Style TargetType="Canvas"> <Style.Triggers> <Trigger Property="IsVisible" Value="True"> </x-turndown>
Try changing the TargetProperty to just "Angle" instead of "RenderTransform.Angle" - no guarantees, but it might work.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013