Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
swdev:dotnet:wpf:user_controls_and_intercommunication [2011/05/25 09:44] smayr |
swdev:dotnet:wpf:user_controls_and_intercommunication [2011/05/25 09:48] (current) smayr |
||
---|---|---|---|
Line 10: | Line 10: | ||
< | < | ||
< | < | ||
- | < | + | < |
</ | </ | ||
</ | </ | ||
</ | </ | ||
- | Or programmatically (in C#): | + | Attach menu event programmatically (in C#): |
<code csharp> | <code csharp> | ||
using System; | using System; | ||
Line 42: | Line 42: | ||
InitializeComponent(); | InitializeComponent(); | ||
| | ||
+ | // Attach menu event handler | ||
popupmnu1.MenuItemSelected += new RoutedEventHandler(ucPopupMnu_MenuItemSelected); | popupmnu1.MenuItemSelected += new RoutedEventHandler(ucPopupMnu_MenuItemSelected); | ||
} | } | ||
Line 62: | Line 63: | ||
</ | </ | ||
- | If defined with XAML, then the '' | + | If the event is defined with XAML ('' |
+ | <code xml> | ||
+ | <Window x: | ||
+ | xmlns=" | ||
+ | xmlns: | ||
+ | xmlns: | ||
+ | Title=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | The code-behind looks like ('' | ||
<code csharp> | <code csharp> | ||
using System; | using System; |