The failed XAML attempt here - I obviously am doing something stupid with the Style / Setter syntax. I just want to flip an element based on some bindings by setting the ScaleX and ScaleY a ScaleTransform from a DataTrigger . Setter.Property does not explicitly support the property path, but how can I get around this? I cannot set the whole RenderTransform property because ScaleX and ScaleY are independent. Any ideas?
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <StackPanel> <TextBlock FontSize="50" RenderTransformOrigin=".5,.5"> <TextBlock.Style> <Style> <Style.Triggers> <DataTrigger Binding="{Binding IsChecked, ElementName=FlipX}" Value="True"> <Setter Property="RenderTransform.ScaleX" Value="-1"/> </DataTrigger> <DataTrigger Binding="{Binding IsChecked, ElementName=FlipY}" Value="True"> <Setter Property="RenderTransform.ScaleY" Value="-1"/> </DataTrigger> </Style.Triggers> </Style> </TextBlock.Style> <TextBlock.RenderTransform> <ScaleTransform/> </TextBlock.RenderTransform> Hello World </TextBlock> <CheckBox Name="FlipX">Flip x</CheckBox> <CheckBox Name="FlipY">Flip y</CheckBox> </StackPanel> </Page>
source share