This project is read-only.

Simple issue

Aug 19, 2008 at 10:18 AM
i'm trying this simple code but the transition is never triggered


Window x:Class="NoteSearch.TransitionWindow"















Title="TransitionWindow" Height="300" Width="300">






<Image x:Name="img1" x:Key="img11" Source="Resources\Splash.png"></Image>



<Image x:Name="img2" x:Key="img22" Source="Resources\Splash.png"></Image>










<tranc:TransitionElement x:Name="TransitionBox">






<trant:PageTransition />









<Button Click="Button_Click" Height="21" Canvas.Left="34" Canvas.Top="214" Width="56">Transition</Button>



<Button Click="Button2_Click" Height="21" Canvas.Left="34" Canvas.Top="280" Width="56">Transition2</Button>








Aug 21, 2008 at 2:08 PM
You didn't include the contents of the Button_Click or Button2_Click handlers.

Also, if you could remove some of the whitespace from your sample it would be greatly appreciated.
Aug 21, 2008 at 4:07 PM

 This is the code, however i dont know how to remove the space since it is anhtml paragraph

partial class TransitionWindow : Window





public TransitionWindow()




private void Button_Click(object sender, RoutedEventArgs e)



TransitionBox.Content = (Image)FindResource("img11"); }



private void Button2_Click(object sender, RoutedEventArgs e)


 {TransitionBox.Content = (

Image)FindResource("img22"); }




Sep 30, 2008 at 8:03 PM
Hey Jon,

Sorry it took me so long to reply, I don't know how I missed the notification.

I can only see to potential causes as to why the transition isn't firing. One, you should verify that in both button click handlers you're actually getting an image from FindResource rather than null. This can happen if your resource path names are incorrect in the xaml.

If you're actually getting the images, the next problem I see is that both resource names point at the same resource file ("Splash.png"). You might not notice the transition since the content isn't really changing. In fact, if FindResource("img11") and FindResource("img22") return the exact same object reference the transition won't fire. Transitionals will ignore a request to transition to the same piece of content.

Hope that helps,