| Server IP : 180.180.241.3 / Your IP : 216.73.216.216 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Program Files (x86)/Microsoft Visual Studio 10.0/VB/Snippets/1033/WPF/ |
Upload File : |
<?xml version="1.0" encoding="UTF-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Add a RoutedEvent Registration</Title>
<Author>Microsoft Corporation</Author>
<Description>Adds code to register a RoutedEvent. This snippet must be added to a class that derives from UIElement.</Description>
<Shortcut>wpfre</Shortcut>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<References>
<Reference>
<Assembly>WindowsBase</Assembly>
</Reference>
<Reference>
<Assembly>PresentationCore</Assembly>
</Reference>
<Reference>
<Assembly>PresentationFramework</Assembly>
</Reference>
</References>
<Imports>
<Import>
<Namespace>System.Windows</Namespace>
</Import>
</Imports>
<Declarations>
<Literal>
<ID>eventHandlerType</ID>
<ToolTip>Replace with the type of the event handler delegate.</ToolTip>
<Default>RoutedEventHandler</Default>
</Literal>
<Literal>
<ID>eventName</ID>
<ToolTip>Replace with the name of the event.</ToolTip>
<Default>Event1</Default>
</Literal>
<Object>
<ID>ownertype</ID>
<Type>Control</Type>
<ToolTip>Replace with the name of the class this snippet is being added to.</ToolTip>
<Default>Window1</Default>
</Object>
</Declarations>
<Code Language="VB">
<![CDATA[
Public Custom Event $eventName$ As $eventHandlerType$
AddHandler(ByVal value As $eventHandlerType$)
Me.AddHandler($eventName$Event, value)
End AddHandler
RemoveHandler(ByVal value As $eventHandlerType$)
Me.RemoveHandler($eventName$Event, value)
End RemoveHandler
RaiseEvent(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs)
Me.RaiseEvent(e)
End RaiseEvent
End Event
Public Shared ReadOnly $eventName$Event As RoutedEvent = _
EventManager.RegisterRoutedEvent("$eventName$", _
RoutingStrategy.Bubble, _
GetType($eventHandlerType$), GetType($ownerType$))
]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>