Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
65 lines (59 sloc) 2.5 KB
<UserControl
x:Class="TestApp.Samples.DeviceFamilySample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:TestApp.Samples"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:triggers="using:WindowsStateTriggers"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup >
<VisualState x:Name="desktop">
<VisualState.StateTriggers>
<triggers:DeviceFamilyStateTrigger DeviceFamily="Desktop" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="greeting.Text" Value="Hello Windows Desktop!" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="mobile">
<VisualState.StateTriggers>
<triggers:DeviceFamilyStateTrigger DeviceFamily="Mobile" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="greeting.Text" Value="Hello Windows Mobile!" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="team">
<VisualState.StateTriggers>
<triggers:DeviceFamilyStateTrigger DeviceFamily="Team" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="greeting.Text" Value="Hello Windows Team!" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="iot">
<VisualState.StateTriggers>
<triggers:DeviceFamilyStateTrigger DeviceFamily="IoT" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="greeting.Text" Value="Hello Windows IoT Core!" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="xbox">
<VisualState.StateTriggers>
<triggers:DeviceFamilyStateTrigger DeviceFamily="Xbox" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="greeting.Text" Value="Hello Xbox!" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<TextBlock x:Name="greeting" Foreground="Black"
Text="Unknown Platform"
HorizontalAlignment="Center" VerticalAlignment="Center" />
</Grid>
</UserControl>