New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Content ActualWidth & Height zero #1
Comments
It's zero initially, before the animation is loaded; it should change as soon as the control starts showing the images. When are you calling |
On Image_Loaded
|
The problem is that when the |
@ChuckSavage, I added the event mentioned above; please let me know if it solves your problem |
Thank you - yes it works. It doesn't fire on a normal image, but I could still use my old Image_Loaded method. |
It's an oversight; for consistency, it would probably be better to fire it for a non-animated image too. I'll fix it. Thanks for reporting the issue! |
Actually, there seems to be a problem. I had by accident left in my Image.Source binding, when I said it worked. When I removed it, the You'd think, this is all I would need:
But it turns out I still need the
|
Oh, I see... that's because the layout of the So the |
Can't use LayoutUpdated because the content hasn't been set for the Zoom control yet. There has to be something going on, with the I have a hack, and it is working - though I have to call my converter twice, and load the bitmap twice. |
OK, another option (that was actually my first idea) is to force the layout pass when the |
At this point, it is too low level WPF code for me. I'll stick with my hack, and try to figure out a way to use the same |
I'm using a control called, ZoomAndPanControl - http://www.codeproject.com/Articles/85603/A-WPF-custom-control-for-zooming-and-panning - I added my branch of his work here at GibHub - https://github.com/ChuckSavage/ZoomAndPanControl
The xaml looks like this
ScrollViewer
ZoomAndPanControl
Grid
Image
When I use the Image's Source, ZoomAndPanControl can use its content.ActualWidth & content.ActualHeight
But when I use gif:ImageBehavoir.AnimatedSource content.ActualWidth & content.ActualHeight (https://github.com/ChuckSavage/ZoomAndPanControl/blob/master/ZoomAndPanControl.cs#L522) are zero. Any idea what could be causing this?
Otherwise, this is a really cool libary - thanks for the hard work
The text was updated successfully, but these errors were encountered: