You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dotnet-desktop-guide/wpf/events/how-to-add-an-event-handler-using-code.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,7 @@ The `ButtonCreatedByCode_Click` event handler obtains the following information
72
72
> [!NOTE]
73
73
> A key difference between a routed event and a CLR event is that a routed event traverses the element tree, looking for handlers, whereas a CLR event doesn't traverse the element tree and handlers can only attach to the source object that raised the event. As a result, a routed event `sender` can be any traversed element in the element tree.
74
74
75
-
For more information on how to create and handle routed events, see [How to create a custom routed event](how-to-create-a-custom-routed-event.md) and [Handle a routed event](/dotnet/desktop/wpf/advanced/how-to-handle-a-routed-event?view=netframeworkdesktop-4.8&preserve-view=true).
75
+
For more information on how to create and handle routed events, see [How to create a custom routed event](how-to-create-a-custom-routed-event.md) and [Handle a routed event](../advanced/how-to-handle-a-routed-event.md)
Copy file name to clipboardExpand all lines: dotnet-desktop-guide/wpf/events/object-lifetime-events.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -96,16 +96,16 @@ When the `Unloaded` event is raised on an element, it's [parent](<xref:System.Wi
96
96
97
97
From the lifetime events perspective, there are four main types of WPF objects: elements in general, window elements, navigation hosts, and application objects. The <xref:System.Windows.FrameworkElement.Initialized>, <xref:System.Windows.FrameworkElement.Loaded>, and <xref:System.Windows.FrameworkElement.Unloaded> lifetime events apply to all framework-level elements. Other lifetime events specifically apply to window elements, navigation hosts, or application objects. For information about those other lifetime events, see:
98
98
99
-
-[Application management overview](/dotnet/desktop/wpf/app-development/application-management-overview?view=netframeworkdesktop-4.8&preserve-view=true) for <xref:System.Windows.Application> objects.
-[Overview of WPF windows](../windows/index.md) for <xref:System.Windows.Window> elements.
101
-
-[Navigation overview](/dotnet/desktop/wpf/app-development/navigation-overview?view=netframeworkdesktop-4.8&preserve-view=true) for <xref:System.Windows.Controls.Page>, <xref:System.Windows.Navigation.NavigationWindow>, and <xref:System.Windows.Controls.Frame> elements.
Copy file name to clipboardExpand all lines: dotnet-desktop-guide/wpf/events/property-change-events.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -70,7 +70,7 @@ When the "if" condition of a property trigger has a wide variety of possible val
70
70
71
71
Property triggers are useful for scenarios where one or more appearance properties should change based on the state of another property on the same element.
72
72
73
-
To learn more about property triggers, see [Styling and Templating](/dotnet/desktop/wpf/controls/styles-templates-overview?view=netframeworkdesktop-4.8&preserve-view=true).
73
+
To learn more about property triggers, see [Styling and Templating](../controls/styles-templates-overview.md)
Copy file name to clipboardExpand all lines: dotnet-desktop-guide/wpf/events/routed-events-overview.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -123,7 +123,7 @@ The signature of the event handler method in code-behind must match the delegate
123
123
124
124
Although <xref:System.Windows.RoutedEventHandler> is the basic routed event handler delegate, some controls or implementation scenarios require different delegates that support more specialized event data. As an example, for the <xref:System.Windows.UIElement.DragEnter> routed event, your handler should implement the <xref:System.Windows.DragEventHandler> delegate. By doing so, your handler code can access the <xref:System.Windows.DragEventArgs.Data?displayProperty=nameWithType> property in event data, which contains the clipboard payload from the drag operation.
125
125
126
-
The XAML syntax for adding routed event handlers is the same as for standard CLR event handlers. For more information about adding event handlers in XAML, see [XAML in WPF](../xaml/index.md). For a complete example of how to attach an event handler to an element using XAML, see [How to handle a routed event](/dotnet/desktop/wpf/advanced/how-to-handle-a-routed-event?view=netframeworkdesktop-4.8&preserve-view=true).
126
+
The XAML syntax for adding routed event handlers is the same as for standard CLR event handlers. For more information about adding event handlers in XAML, see [XAML in WPF](../xaml/index.md). For a complete example of how to attach an event handler to an element using XAML, see [How to handle a routed event](../advanced/how-to-handle-a-routed-event.md)
127
127
128
128
To attach an event handler for a routed event to an element using code, you generally have two options:
129
129
@@ -195,11 +195,11 @@ The `<owner type>.<event name>` syntax qualifies an event name with the name of
In the example, the parent element listener to which the event handler is added is a <xref:System.Windows.Controls.StackPanel>. However, the <xref:System.Windows.Controls.Primitives.ButtonBase.Click> routed event is implemented and raised on the <xref:System.Windows.Controls.Primitives.ButtonBase> class, and available to the <xref:System.Windows.Controls.Button> class through inheritance. Although the <xref:System.Windows.Controls.Button> class "owns" the `Click` event, the routed event system permits handlers for any routed event to be attached to any <xref:System.Windows.UIElement> or <xref:System.Windows.ContentElement> instance listener that could otherwise have handlers for a CLR event. The default `xmlns` namespace for these qualified event attribute names is typically the default WPF `xmlns` namespace, but you can also specify prefixed namespaces for custom routed events. For more information about `xmlns`, see [XAML namespaces and namespace mapping for WPF XAML](/dotnet/desktop/wpf/advanced/xaml-namespaces-and-namespace-mapping-for-wpf-xaml?view=netframeworkdesktop-4.8&preserve-view=true).
198
+
In the example, the parent element listener to which the event handler is added is a <xref:System.Windows.Controls.StackPanel>. However, the <xref:System.Windows.Controls.Primitives.ButtonBase.Click> routed event is implemented and raised on the <xref:System.Windows.Controls.Primitives.ButtonBase> class, and available to the <xref:System.Windows.Controls.Button> class through inheritance. Although the <xref:System.Windows.Controls.Button> class "owns" the `Click` event, the routed event system permits handlers for any routed event to be attached to any <xref:System.Windows.UIElement> or <xref:System.Windows.ContentElement> instance listener that could otherwise have handlers for a CLR event. The default `xmlns` namespace for these qualified event attribute names is typically the default WPF `xmlns` namespace, but you can also specify prefixed namespaces for custom routed events. For more information about `xmlns`, see [XAML namespaces and namespace mapping for WPF XAML](../advanced/xaml-namespaces-and-namespace-mapping-for-wpf-xaml.md)
199
199
200
200
## WPF input events
201
201
202
-
One frequent application of routed events within the WPF platform is for [input events](/dotnet/desktop/wpf/advanced/input-overview?view=netframeworkdesktop-4.8&preserve-view=true). By convention, WPF routed events that follow a tunneling route have a name that's prefixed with "Preview". The Preview prefix signifies that the preview event completes before the paired bubbling event starts. Input events often come in pairs, with one being a preview event and the other a bubbling routed event. For example, <xref:System.Windows.ContentElement.PreviewKeyDown> and <xref:System.Windows.ContentElement.KeyDown>. The event pairs share the same instance of event data, which for `PreviewKeyDown` and `KeyDown` is of type <xref:System.Windows.Input.KeyEventArgs>. Occasionally, input events only have a bubbling version, or only a direct routed version. In the API documentation, routed event topics cross-reference routed event pairs and clarify the routing strategy for each routed event.
202
+
One frequent application of routed events within the WPF platform is for [input events](../advanced/input-overview.md)
203
203
204
204
WPF input events that come in pairs are implemented so that a single user action from an input device, such as a mouse button press, will raise the preview and bubbling routed events in sequence. First, the preview event is raised and completes its route. On completion of the preview event, the bubbling event is raised and completes its route. The <xref:System.Windows.UIElement.RaiseEvent%2A> method call in the implementing class that raises the bubbling event reuses the event data from the preview event for the bubbling event.
205
205
@@ -226,7 +226,7 @@ The concept of preview and bubbling event pairs, with shared event data and sequ
226
226
227
227
If you're implementing your own composite control that responds to input events, consider using preview events to suppress and replace input events raised on subcomponents with a top-level event that represents the complete control. For more information, see [Marking routed events as handled, and class handling](marking-routed-events-as-handled-and-class-handling.md).
228
228
229
-
For more information about the WPF input system and how inputs and events interact in typical application scenarios, see [Input overview](/dotnet/desktop/wpf/advanced/input-overview?view=netframeworkdesktop-4.8&preserve-view=true).
229
+
For more information about the WPF input system and how inputs and events interact in typical application scenarios, see [Input overview](../advanced/input-overview.md)
230
230
231
231
## EventSetters and EventTriggers
232
232
@@ -236,7 +236,7 @@ In markup styles, you can include pre-declared XAML event handling syntax by usi
236
236
237
237
It's likely that the `Style` node already contains other style information that pertains to controls of the specified type, and having the <xref:System.Windows.EventSetter> be part of those styles promotes code reuse even at the markup level. Also, an `EventSetter` abstracts method names for handlers away from the general application and page markup.
238
238
239
-
Another specialized syntax that combines the routed event and animation features of WPF is an <xref:System.Windows.EventTrigger>. As with the `EventSetter`, you can only declare an `EventTrigger` for a routed event. Typically, an `EventTrigger` is declared as part of a style, but an `EventTrigger` can be declared on page-level elements as part of the <xref:System.Windows.FrameworkElement.Triggers%2A> collection, or in a <xref:System.Windows.Controls.ControlTemplate>. An `EventTrigger` enables you to specify a <xref:System.Windows.Media.Animation.Storyboard> that runs whenever a routed event reaches an element in its route that declares an `EventTrigger` for that event. The advantage of an `EventTrigger` over just handling the event and causing it to start an existing storyboard is that an `EventTrigger` provides better control over the storyboard and its run-time behavior. For more information, see [Use event triggers to control a storyboard after it starts](/dotnet/desktop/wpf/graphics-multimedia/how-to-use-event-triggers-to-control-a-storyboard-after-it-starts?view=netframeworkdesktop-4.8&preserve-view=true).
239
+
Another specialized syntax that combines the routed event and animation features of WPF is an <xref:System.Windows.EventTrigger>. As with the `EventSetter`, you can only declare an `EventTrigger` for a routed event. Typically, an `EventTrigger` is declared as part of a style, but an `EventTrigger` can be declared on page-level elements as part of the <xref:System.Windows.FrameworkElement.Triggers%2A> collection, or in a <xref:System.Windows.Controls.ControlTemplate>. An `EventTrigger` enables you to specify a <xref:System.Windows.Media.Animation.Storyboard> that runs whenever a routed event reaches an element in its route that declares an `EventTrigger` for that event. The advantage of an `EventTrigger` over just handling the event and causing it to start an existing storyboard is that an `EventTrigger` provides better control over the storyboard and its run-time behavior. For more information, see [Use event triggers to control a storyboard after it starts](../graphics-multimedia/how-to-use-event-triggers-to-control-a-storyboard-after-it-starts.md)
240
240
241
241
## More about routed events
242
242
@@ -248,8 +248,8 @@ You can use the concepts and guidance in this article as a starting point when c
248
248
-<xref:System.Windows.RoutedEvent>
249
249
-<xref:System.Windows.RoutedEventArgs>
250
250
-[Marking routed events as handled, and class handling](marking-routed-events-as-handled-and-class-handling.md)
Copy file name to clipboardExpand all lines: dotnet-desktop-guide/wpf/properties/attached-properties-overview.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -81,7 +81,7 @@ Creating an attached property is useful when:
81
81
- You need a property setting mechanism available to classes other than the defining class. A common scenario is for UI layout, for instance <xref:System.Windows.Controls.DockPanel.Dock%2A?displayProperty=nameWithType>, <xref:System.Windows.Controls.Panel.ZIndex%2A?displayProperty=nameWithType>, and <xref:System.Windows.Controls.Canvas.Top%2A?displayProperty=nameWithType> are all examples of existing layout properties. In the layout scenario, child elements of a layout-controlling element are able to express layout requirements to their layout parent and to set a value for an attached property defined by the parent.
82
82
83
83
- One of your classes represents a service, and you want other classes to integrate the service more transparently.
84
-
- You want Visual Studio WPF Designer support, such as the ability to edit a property through the **Properties** window. For more information, see [Control authoring overview](/dotnet/desktop/wpf/controls/control-authoring-overview?view=netframeworkdesktop-4.8&preserve-view=true).
84
+
- You want Visual Studio WPF Designer support, such as the ability to edit a property through the **Properties** window. For more information, see [Control authoring overview](../controls/control-authoring-overview.md)
0 commit comments