LockablePivot throws InvalidCastException

I am trying to implement the locklockPivot element found in the August 2011 release of the Windows Phone Toolkit (7.1 SDK).

When I add the itemtemplate to the control every time I change the isLocked property at runtime, it throws InvalidCastException. Are there any workarounds for this?

Help is needed. Thanks to


<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>

      

FROM#:

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;
    }

      

+3


source to share


1 answer


There is an open ticket for this error. See http://silverlight.codeplex.com/workitem/10793 . Please don't forget to vote.



+1


source







All Articles