作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试实现在 Windows Phone 工具包 - 2011 年 8 月 (7.1 SDK) 版本中找到的 lockablePivot 控件。
当我每次在运行时更改 isLocked 属性时将项目模板添加到控件时,它会抛出 InvalidCastException。对此有任何解决方法吗?
需要帮助。谢谢
<Grid x:Name="LayoutRoot" Background="Transparent">
<toolkit:LockablePivot Name="Pages" SelectionChanged="Pivot_Changed" ItemsSource="{Binding}">
<toolkit:LockablePivot.ItemTemplate>
<DataTemplate>
<Grid VerticalAlignment="Stretch">
<Button Content="Lock" Click="Button_Click"/>
<Image Stretch="Uniform" local:WP7ImageZoomer.IsZoomingEnabled="True" ManipulationStarted="Image_ManipulationStarted" ManipulationCompleted="Image_ManipulationCompleted" ManipulationDelta="Image_ManipulationDelta" CacheMode="BitmapCache">
<Image.Source>
<BitmapImage x:Name="Bit" UriSource="{Binding Img}" DownloadProgress="BitmapImage_DownloadProgress" CreateOptions="BackgroundCreation"/>
</Image.Source>
</Image>
</Grid>
</DataTemplate>
</toolkit:LockablePivot.ItemTemplate>
</toolkit:LockablePivot>
</Grid>
C#:
private void Image_ManipulationStarted(object sender, System.Windows.Input.ManipulationStartedEventArgs e)
{
this.Pages.IsLocked = true;// Throws InvalidCastException here
}
private void Image_ManipulationCompleted(object sender, System.Windows.Input.ManipulationCompletedEventArgs e)
{
this.Pages.IsLocked = false;
}
private void Image_ManipulationDelta(object sender, System.Windows.Input.ManipulationDeltaEventArgs e)
{
//this.Pages.IsLocked = true;
}
最佳答案
该错误有一个开放的票证。参见 http://silverlight.codeplex.com/workitem/10793 .请不要忘记投票。
关于c# - LockablePivot 抛出 InvalidCastException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9731553/
我正在尝试实现在 Windows Phone 工具包 - 2011 年 8 月 (7.1 SDK) 版本中找到的 lockablePivot 控件。 当我每次在运行时更改 isLocked 属性时将项
我是一名优秀的程序员,十分优秀!