My UI have to change with the orientation of the screen. Especially i have to change the grid.rows/columns-property and the allignment of my Controls. An animation of the position-change from my Controls would be nice but it doesn't have to. Much more important for me is that i have an short and clearly arranged code.
I have some approaches but may be there are some more or better ways.
May be with an Example.
Thx Stefan
For example, you can use RotateTransform in order to rotate your view when the orientation changes.
Another approach: Since you were trying to work with Grid.Row
and Grid.Column
swapping, I'd rather recommend to use StackPanel
, where you'd just need to set the Orientation
dependency property to Horizontal
or Vertical
.
Note: You are right, I do not recommend either to use C# code in order to solve this, since it's a situation on the View
side, not on the Model
one. (Separation of Concerns.)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.