Skip to content

How to rotate a element with a binding? #19759

Closed Answered by Omega596
Omega596 asked this question in Q&A
Discussion options

You must be logged in to vote

To rotate a element you need to add a RenderTransform to the element and then a composite transform, then change the rotation value.
Example:

<Page x:Class="Shturman.Presentation.MainPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      mc:Ignorable="d"

    <Grid>
          <Image Width="220" Height="220" Source="Whatever">
                <Image.RenderTransform>
                    <RotateTransform Angle="{Binding whatever.whatever}"/>
                </Im…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Omega596
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants