microsoft / xaml-standard

XAML Standard : a set of principles that drive XAML dialect alignment
Other
804 stars 50 forks source link

Support Layout Transform #80

Open zbamstudio opened 7 years ago

zbamstudio commented 7 years ago

Layout transform is not included in Uwp and Xamarin.Forms since it's defined as a performance heavy operation. But I think this decision needs to be left to the developer. I encountered couple use cases that can't be achieved by render transform and I had to (probably more performance heavy) work around to achieve the result.

<Button Grid.Row="0" Grid.Column="1" Background="LightCoral" Content="RotateTransform Applied">
  <Button.LayoutTransform>
    <RotateTransform CenterX="25" CenterY="25" Angle="45" />
  </Button.LayoutTransform>
</Button>
MovGP0 commented 7 years ago

My current method to do this is to create custom controls that render in OpenGL, which allows for fast matrix transformations and works everywhere.

However, doing everything in OpenGL means that we would ignore all native existing controls and have to restyle everything when a new Mobile OS version releases. So this approach is currently only used in games where a native look-and-feel is not important.

Having the option to provide layout transformations when needed, but recommend to avoid them for performance constraints, might be a good middle ground.

Odonno commented 7 years ago

Can't you do this with Xamarin.Forms animations? https://developer.xamarin.com/guides/xamarin-forms/user-interface/animation/simple/

jassmith commented 7 years ago

Limited support for this would be possible but honestly very difficult on all platforms.

zbamstudio commented 7 years ago

@Odonno https://wpf.2000things.com/tag/layouttransform/