Hi. I need to have WindowResponse.Immediate for my users, but I also need to detect changes to the visible portion of the chart (the WindowRect) so that I can preload data to the left or right of the chart in the background. In other words, if the user pans to the rightmost wxtent of the chart, I will spin off a thread to get some more data and append this to the series. Obviously, doing this in response to every ActualWindowRectChanged is going to be very expensive in terms of background processing.
So I need to be able to detect when the interaction is completed. In my case, since DefaultInteraction=DragPan, this could be as simple as detecting MouseUp, but this event is not fired if the user is dragging the zoombar.
So I would like to know (a) how do I detect all MouseUp events which relate to the user interaction, and (b) is there a better, more generic way to detect when the panning operation has completed.
Many thanks
HtD
Hello,
Thank you for your post. I have been looking into you requirement and I created a sample project for you with the functionality you want. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Thanks Stefan, this is useful. However what i was really hoping to be able to do is bind the WindowRect to a property on my view model.
e.g.
public class MyViewModel { public Rect Viewport { get {...} set {...} } }
And then in the XAML do:
<ig:XamDataChart WindowRect="{Binding Path=Viewport, UpdateSourceTrigger=PropertyChanged}">
Is this binding possible? Doesn;t seem to work for me.
Stefan, I adapted your sample and I am able to bind to WindowRect as required. I have no idea what I was doing wrong originally, but I now have my XamDataChart, XamZoomBar and view model perfectly synchronised and we're all the best of friends again!
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.