실버 라이트로 WP7 앱을 개발 중입니다. 거의 끝났지 만 새로운 사용자 컨트롤을 세로보기로 가로 루트 페이지의 자식 요소로 삽입해야합니다. 각 하위 요소 (이 항목 제외)는 가로 모드이며 변경할 수 없습니다.가로보기 페이지에 세로 자식 요소 추가
RootPage에서 SupportedOrientation을 PortrailorLandscape로 변경하고 에뮬레이터의 방향을 세로로 전환하면 가로 방향에있는 모든 하위 요소가 잘립니다.
페이지 루트 코드 :
이
내가 무슨 짓을<phone:PhoneApplicationPage
x:Class="app.Root"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Landscape" Orientation="LandscapeLeft"
mc:Ignorable="d" d:DesignHeight="480" d:DesignWidth="800" shell:SystemTray.IsVisible="False">
<Grid Width="800" Height="480" Loaded="RootGrid_Loaded">
<Popup x:Name="myPopup">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="480"/>
</Grid.RowDefinitions>
<Border x:Name="popupBorder"/>
</Grid>
</Popup>
<Canvas x:Name="ScreenRoot"
Visibility="Visible"
Width="800" Height="480">
<Canvas.Children/>
</Canvas>
</Grid>
</phone:PhoneApplicationPage>
그런 ScreenRoot의 자식으로 사용자 제어 :
<UserControl
x:Class="app.Settings"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
FontFamily="{StaticResource OCRAExt}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="WhiteSmoke"
mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480"
shell:SystemTray.IsVisible="False">
<Grid x:Name="SettingsRoot" Background="Black" Width="480" Height="800">
...
...
</Grid>
</UserControl>
사용자 제어 상태 머신에서 자신의 상태를 수신 그런 다음 RootPage의 Canvas to Canvas로 자신을 추가하십시오.
는