gpt4 book ai didi

c# - LockablePivot 抛出 InvalidCastException

转载 作者:行者123 更新时间:2023-11-30 18:00:47 24 4
gpt4 key购买 nike

我正在尝试实现在 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com