Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to drag a listboxitem in WP7?
    primarykey
    data
    text
    <p>As the codes below, I have a listboxitem. I want to drag the listboxitem horizontally to right and disappear. but when drag it, this error pops up,</p> <p>transform.X += e.HorizontalChange;<strong>[NullReferenceException]</strong></p> <p>I check the Watch, found that the e.HorizontalChange has a value of 65.0, why it shows error? and How I accomplish my goal?</p> <pre><code>&lt;DataTemplate x:Key="TasksListDataTemplate"&gt; &lt;StackPanel x:Name="stackPanel" Margin="0,0,0,10" RenderTransformOrigin="0.5,0.5"&gt; &lt;toolkit:GestureService.GestureListener&gt; &lt;toolkit:GestureListener DragDelta="taskitem_DragDelta" &lt;/toolkit:GestureService.GestureListener&gt; &lt;TextBlock x:Name="textBlock" TextWrapping="Wrap" Text="{Binding Title}" FontSize="{StaticResource PhoneFontSizeLarge}" HorizontalAlignment="Left" Width="432" RenderTransformOrigin="0.5,0.5"&gt; &lt;/TextBlock&gt; &lt;StackPanel x:Name="stackPanel1" Orientation="Horizontal" HorizontalAlignment="Left"&gt; &lt;TextBlock x:Name="textBlock1" TextWrapping="Wrap" Text="due:" d:LayoutOverrides="Width" FontSize="{StaticResource PhoneFontSizeMedium}" RenderTransformOrigin="0.5,0.5"&gt; &lt;/TextBlock&gt; &lt;TextBlock x:Name="textBlock2" TextWrapping="Wrap" Text="{Binding DueDate}" d:LayoutOverrides="Width" FontSize="{StaticResource PhoneFontSizeMedium}" RenderTransformOrigin="0.5,0.5"&gt; &lt;/TextBlock&gt; &lt;/StackPanel&gt; &lt;/StackPanel&gt; &lt;/DataTemplate&gt; </code></pre> <p>and the code behind file is </p> <pre><code> private void taskitem_DragDelta(object sender, DragDeltaGestureEventArgs e) { TranslateTransform transform = (sender as StackPanel).RenderTransform as TranslateTransform; transform.X += e.HorizontalChange; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload