2012-04-21 3 views
0

실버 라이트로 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로 자신을 추가하십시오.

답변

0

난 당신이 정말로 원하는 것을 이해하는 것이 확실하지 않다 : 제발 도와주세요,하지만 당신은 세로 모드로 유지하기 위해, 여러분의 UserControl에으로 RenderTransform을 적용하려고 할 수 있습니다.

http://msdn.microsoft.com/en-us/library/ms754009.aspx