.net - WPF Is it legal to invoke another event from within an event-invocation-method -


the following code part of answer have received solve probem have posted in so. works fine, i'm curious if allowed manually invoke event within invocation-method eventargs of original event:

protected override void onmouseleftbuttonup( mousebuttoneventargs e )   {        base.onmouseleftbuttondown( e );    }   

i have seen pattern never used because feared lead sideeffects or problems in future versions of wpf. has insight tell me if such redirected event-invocations save?

i careful doing this. if event data contains stuff relevant original event other event handler can confused data. when comes events external devices mouse.

maybe example posted ok, don't know. can see problem doing other way around, raising mouse down when mouse - mouse down handler (potentially, have no idea if this) query input device actual status of mouse , wouldn't match. or perhaps operation on mouse works when pressed etc.

so in summary: may work, not rely on unless 100% sure won't break under conditions


Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -