2014-07-24 199 views
0

我想打一個阿拉伯語的Windows Phone 8的應用程序,所以我需要讓我的全景視圖從左至右(在英語中相反的方向)刷卡我想這全景項向左或向右滑動

protected override void OnNavigatedTo(NavigationEventArgs e) 
    { 
     MainPanorama.DefaultItem = MainPanorama.Items[1]; 
     if (!App.ViewModel.IsDataLoaded) 
     { 
      App.ViewModel.LoadData(); 
     } 
    } 

但標題是相反的方向,任何人有一個想法?

+2

您也可以從左至右滑動全景模板中的默認是正確的你想實現什麼?清楚地說明。 –

+0

我想在默認的相反方向上滑動 –

回答

0

會解決的方法很簡單,有名爲全景控件的屬性「的FlowDirection」你改變它像

<phone:Panorama x:Name="MainPanorama" FlowDirection="RightToLeft"> 
0

如果您希望下一個全景圖項目顯示在左側,那麼您可以使用CompositeTransforms進行播放。事情是這樣的:

<phone:PhoneApplicationPage.Resources> 
    <DataTemplate x:Key="PanoramaTitleTemplate"> 
     <TextBlock Text="{Binding}" 
           FontSize="48" 
           Margin="12,24" 
           RenderTransformOrigin="0.5,0.5"> 
      <TextBlock.RenderTransform> 
       <CompositeTransform ScaleX="-1" /> 
      </TextBlock.RenderTransform> 
     </TextBlock> 
    </DataTemplate> 

    <DataTemplate x:Key="PanoramaItemHeaderTemplate"> 
     <TextBlock Text="{Binding}" 
        FontSize="52" 
        MinWidth="380" 
        TextAlignment="Right"> 
     </TextBlock> 
    </DataTemplate> 
</phone:PhoneApplicationPage.Resources> 

<!--LayoutRoot is the root grid where all page content is placed--> 
<Grid x:Name="LayoutRoot" Background="Transparent"> 

    <phone:Panorama Title="Panorama" 
        RenderTransformOrigin="0.5,0.5" 
        TitleTemplate="{StaticResource PanoramaTitleTemplate}"> 
     <phone:Panorama.RenderTransform> 
      <CompositeTransform ScaleX="-1" /> 
     </phone:Panorama.RenderTransform> 

     <phone:PanoramaItem Header="Header1" 
          RenderTransformOrigin="0.5,0.5" 
          HeaderTemplate="{StaticResource PanoramaItemHeaderTemplate}"> 

      <phone:PanoramaItem.RenderTransform> 
       <CompositeTransform ScaleX="-1" /> 
      </phone:PanoramaItem.RenderTransform> 

      <Grid Background="DarkBlue" /> 
     </phone:PanoramaItem> 

     <phone:PanoramaItem Header="Header2" 
          RenderTransformOrigin="0.5,0.5" 
          HeaderTemplate="{StaticResource PanoramaItemHeaderTemplate}"> 

      <phone:PanoramaItem.RenderTransform> 
       <CompositeTransform ScaleX="-1" /> 
      </phone:PanoramaItem.RenderTransform> 

      <Grid Background="DarkCyan" /> 
     </phone:PanoramaItem> 

     <phone:PanoramaItem Header="Header3" 
          RenderTransformOrigin="0.5,0.5" 
          HeaderTemplate="{StaticResource PanoramaItemHeaderTemplate}"> 

      <phone:PanoramaItem.RenderTransform> 
       <CompositeTransform ScaleX="-1" /> 
      </phone:PanoramaItem.RenderTransform> 

      <Grid Background="DarkGoldenrod" /> 
     </phone:PanoramaItem> 
    </phone:Panorama> 


</Grid>