Create Event in WPF

I want to rise an event to zoom in and zoom out the image once the gesture is recognized that it is valid (gesture recognized by Kinect). my image is shown in different user control loaded in a frame present in main window.

<Frame Name="currentFrame" NavigationUIVisibility="Hidden"></Frame>

and frame source is set like this.

 currentFrame.Source = new Uri("Images.xaml", UriKind.RelativeOrAbsolute);

How can i create the custom event? and which one is the best ? tunnel or bubble?

Answers


I think in your case it's better to use tunel event, as what you need is immediate feedback from the user interaction and execute a single action on that: zooming. So there is no sence of notifying other controls between your usecontrol canvas (if any) and actual handling code.

For concrete implementation of the event, can have a look on:

Routed Events


Need Your Help

How to split the css file on tokens using C++11 regex?

c++ regex c++11

I'd like to know how to split the css file on tokens using C11++ regex and insert into std::map as key/value?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.