mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-04 09:06:04 +02:00
* Reset branch for WPF changes * Convert BMP to PNG; fix link-out-of-scope err * Add snippets for WPF... 6794 files!!!! * Add missing snippets * update file updated between migration * Fix paths to include * update breadcrumb and toc * fix index links * fix index links * fix index links * fix markdown
1.5 KiB
1.5 KiB
title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
| title | ms.date | dev_langs | helpviewer_keywords | ms.assetid | ||||
|---|---|---|---|---|---|---|---|---|
| How to: Find the Source Element in an Event Handler | 03/30/2017 |
|
|
85f71c5a-b714-4c65-9711-7d905c2bbe98 |
How to: Find the Source Element in an Event Handler
This example shows how to find the source element in an event handler.
Example
The following example shows a xref:System.Windows.Controls.Primitives.ButtonBase.Click event handler that is declared in a code-behind file. When a user clicks the button that the handler is attached to, the handler changes a property value. The handler code uses the xref:System.Windows.RoutedEventArgs.Source%2A property of the routed event data that is reported in the event arguments to change the xref:System.Windows.FrameworkElement.Width%2A property value on the xref:System.Windows.RoutedEventArgs.Source%2A element.
[!code-xamlRoutedEventSource#XAMLHandler]
[!code-csharpRoutedEventSource#Handler] [!code-vbRoutedEventSource#Handler]