PvdG42 wrote:
"Alun Harford" <de*****@alunharford.co.ukwrote in message
news:uD**************@TK2MSFTNGP03.phx.gbl...
>>
You don't. :-)
Events are generally used in WPF when you're writing custom controls.
Look into WPF commands for more information.
Really? Perhaps you could enlighten me further by providing a link or
two to articles on the subject, and explain why the events button was
put back in the properties window as part of SP1?
The MSDN documentation is pretty good, at:
http://msdn.microsoft.com/en-us/library/ms752308.aspx
In WinForms, if you want 'button-like' behaviour, you would attach to
the click event. In WPF, you re-template a button and set its command
property. This prevents coupling between the UI and the business logic
that runs when you click the button.
Unfortunately, a lot of the stuff in the VS designer (Cider) appears to
be in there because MSFT is very reluctant to make massive sweeping
changes to their programming model. Now that they have, somebody seems
to want to make the commercial decision to try to make it work 'like
WinForms' (much as they did with the webforms designer). For the same
reason, UserControls exist in WPF (and the designer somewhat encourages
their use) but you *really* don't want to use them.
I really hope MSFT will refocus Cider more towards helping developers
make a UI representation of their model and less towards trying to
bridge the gap between WinForms and WPF.
Alun Harford