抑制列表框项目 wp7 的倾斜效果
我有一个包含数据模板的列表框,我想禁用其中一个数据模板的倾斜效果,但它不起作用...这就是我一直在尝试的:
<ListBox ScrollViewer.VerticalScrollBarVisibility="Disabled" x:Name="MainListBox" Margin="0,10,0,0" SelectionChanged="MainListBoxSelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<local:Datatemplates Content="{Binding}">
<local:Datatemplates.ThirdItem>
<DataTemplate>
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="0,10" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="1" toolkit:TiltEffect.SuppressTilt="True">
<TextBlock Text="{Binding Title}" TextWrapping="NoWrap" FontSize="{StaticResource PhoneFontSizeExtraLarge}" Style="{StaticResource PhoneTextGroupHeaderStyle}" toolkit:TiltEffect.SuppressTilt="True"/>
<TextBlock Text="{Binding SubTitle1}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSmallStyle}" toolkit:TiltEffect.SuppressTilt="True"/>
<TextBlock Text="{Binding SubTitle2}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSmallStyle}" toolkit:TiltEffect.SuppressTilt="True"/>
</StackPanel>
</Grid>
</DataTemplate>
</local:Datatemplates.ThirdItem>
</local:ProfileSetupDatatemplates>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
我已经尝试过放置抑制倾斜效果到处都不起作用。
我缺少什么
I have a listbox with for data templates, and I want to disable the tilt effect on one of the data templates, but it is not working... this is what I've been trying:
<ListBox ScrollViewer.VerticalScrollBarVisibility="Disabled" x:Name="MainListBox" Margin="0,10,0,0" SelectionChanged="MainListBoxSelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<local:Datatemplates Content="{Binding}">
<local:Datatemplates.ThirdItem>
<DataTemplate>
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="0,10" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="1" toolkit:TiltEffect.SuppressTilt="True">
<TextBlock Text="{Binding Title}" TextWrapping="NoWrap" FontSize="{StaticResource PhoneFontSizeExtraLarge}" Style="{StaticResource PhoneTextGroupHeaderStyle}" toolkit:TiltEffect.SuppressTilt="True"/>
<TextBlock Text="{Binding SubTitle1}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSmallStyle}" toolkit:TiltEffect.SuppressTilt="True"/>
<TextBlock Text="{Binding SubTitle2}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSmallStyle}" toolkit:TiltEffect.SuppressTilt="True"/>
</StackPanel>
</Grid>
</DataTemplate>
</local:Datatemplates.ThirdItem>
</local:ProfileSetupDatatemplates>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
I already tried to put the suppress tilt effect everywhere it wasn't working.
What am I missing
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
TiltEffect 仅适用于按钮控件(Button、CheckBox 等)和 ListBoxItems,因此尝试在 Stackpanel 上抑制它是行不通的。
所以:
你应该能够像这样调整你的模板:
TiltEffect is only applied to button controls (Button, CheckBox, etc.) and ListBoxItems, so trying to suppress it on a Stackpanel won't work.
So:
you should be able to tweak your template like so: