I am just trying to find out if is there a way to define different image sources based on page orientation in XAML.
Like:
<Image>
<Orientation is landscape>
<Image.Source = "landscape.png" />
</Orientation>
<Orientation is not landscape>
<Image.Source = "notlandscape.png" />
</Orientation>
</Image>
You can set a property of your ViewModel in the code behind of your Page and bind to that using a DataTrigger.
You will need to override the
OnSizeAllocated()method for that:Code behind
ViewModel
or
XAML
An alternative would be to use Visual States.