Visually Located


Creating different page views for Windows Apps based on the device

Windows 10 has released the new Universal App Platform that brings new “Windows Apps”. These apps offer the ability to use one Visual Studio project to create apps for any platform/device. This offers the ability to have one XAML file for all of your views. This works much like the web does with responsive design. If you want your page to look different on a smaller device you can change the layout based on the width of the device. You can do this with StateTriggers. <VisualStateManager.VisualStateGroups> <VisualStateGroup> <VisualState x:Name="wideState"> <VisualState.StateTriggers> <AdaptiveTrigger MinWindowWidth="600"/> </VisualState.StateTriggers> <VisualState.Setters> <Setter Target="MyTextBlock.Text" Value="BIGGER!" /> </VisualState.Setters> </VisualState> <VisualState x:Name="narrowState"> <VisualState... [More]