标签:
DeviceFamily Veiws 可以为特定的设备(Mobile、Desktop等)制作特定的XAML视图,这种方式可以完全定制XMAL和共享后台代码。
以 Mobile 和 Desktop 为例:
1 Page 2 x:Class="_DeviceFamily.DeviceFamily_Mobile.MainPage" 3 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 4 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 5 xmlns:local="using:_DeviceFamily.DeviceFamily_Mobile" 6 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 7 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 8 mc:Ignorable="d"> 9 10 <Grid Background="Blue"> 11 <TextBlock Text="Hello DeviceFamily-Mobile" VerticalAlignment="Center" FontSize="24" /> 12 </Grid> 13 </Page>
1 <Page 2 x:Class="_DeviceFamily.DeviceFamily_Desktop.MainPage" 3 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 4 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 5 xmlns:local="using:_DeviceFamily.DeviceFamily_Desktop" 6 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 7 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 8 mc:Ignorable="d"> 9 10 <Grid Background="Red"> 11 <TextBlock VerticalAlignment="Center" Text="Hello DeviceFamily-Desktop" FontSize="56" /> 12 </Grid> 13 </Page>
<Page x:Class="_DeviceFamily.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:_DeviceFamily" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> <Grid Background="Yellow"> <TextBlock VerticalAlignment="Center" Text="Hello DeviceFamily-Desktop" FontSize="48" /> </Grid> </Page>
标签:
原文地址:http://www.cnblogs.com/Coderwei2016/p/5858011.html