ページが切り替わったときにスライドしないように、パノラマ コントロールのタイトルをロックする方法はありますか? 代わりに、その場所に残りますか?
2 に答える
2
おそらく、2 行のグリッド内にパノラマを配置します。最初の行には、テキスト、画像、または静的にしたいものを含めることができます。次に、パノラマ コントロールを 2 行目の内側に配置します。これをチェックしてください:
<Grid x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition Height="60"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Image x:Name="Logo" Grid.Row="0"/>
<controls:Panorama Grid.Row="1" Margin="0,-60,0,0">
<controls:Panorama.Title><Rectangle Height="60"/></controls:Panorama.Title>
...
</controls:Panorama>
</Grid>
于 2012-05-29T00:21:47.163 に答える
0
私があなたを正しく理解していれば、パノラマの視差タイトルレイヤーは必要ありません。
もしそうなら、これを試してみてください:
public class NoParalaxTitleLayer : PanningTitleLayer
{
protected override double PanRate
{
get { return 0d; }
}
}
public class NoParalaxBackgroundLayer : PanningBackgroundLayer
{
protected override double PanRate
{
get { return 1d; }
}
}
そしてスタイルで:
<Style x:Key="NonParalaxPanorama" TargetType="controls:Panorama">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:Panorama">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<local:NoParalaxBackgroundLayer x:Name="BackgroundLayer"
HorizontalAlignment="Left" Grid.RowSpan="2">
<Border x:Name="background"
Background="{TemplateBinding Background}"
CacheMode="BitmapCache"/>
</local:NoParalaxBackgroundLayer>
<local:NoParalaxTitleLayer x:Name="TitleLayer"
CacheMode="BitmapCache"
ContentTemplate="{TemplateBinding TitleTemplate}"
Content="{TemplateBinding Title}"
FontSize="187"
FontFamily="{StaticResource PhoneFontFamilyLight}"
HorizontalAlignment="Left"
Margin="10,-76,0,9" Grid.Row="0"/>
<controlsPrimitives:PanningLayer x:Name="ItemsLayer"
HorizontalAlignment="Left" Grid.Row="1">
<ItemsPresenter x:Name="items"/>
</controlsPrimitives:PanningLayer>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<controls:Panorama Style="{StaticResource NonParalaxPanorama}">
</controls:Panorama>
于 2012-05-29T06:35:44.717 に答える