Skip to content

Instantly share code, notes, and snippets.

@ChaseFlorell
Created March 3, 2019 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChaseFlorell/fd32063eb9cc496fc7dc65727cfa9981 to your computer and use it in GitHub Desktop.
Save ChaseFlorell/fd32063eb9cc496fc7dc65727cfa9981 to your computer and use it in GitHub Desktop.
trying to adjust FlexLayout.Basis on orientation changed
<Grid.Triggers>
<DataTrigger TargetType="Grid" Binding="{Binding CurrentOrientation, Source={x:Static Device.Info}}" Value="{x:Static internals:DeviceOrientation.Portrait}" >
<Setter Property="FlexLayout.Basis" Value="50%" />
</DataTrigger>
<DataTrigger TargetType="Grid" Binding="{Binding CurrentOrientation, Source={x:Static Device.Info}}" Value="{x:Static internals:DeviceOrientation.Landscape}" >
<Setter Property="FlexLayout.Basis" Value="33%" />
</DataTrigger>
</Grid.Triggers>
@ChaseFlorell
Copy link
Author

So we can observe the "CurrentOrientationChanged" property, but FlexLayout.Basis doesn't update values once set. :(

@ChaseFlorell
Copy link
Author

The idea here was to try and have Landscape show 3 items whereby Portrait only showing 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment