Posts Tagged ‘OnApplyTemplate’
Handling events from within a ControlTemplate in WPF
Posted by richard in C#, Software Development, WPF on February 13th, 2010
Here’s an interesting one that had me stumped for a few hours.
Following on from my previous post, where I explained how to create a ControlTemplate to style a TextBox in WPF, I’ve got an object, TextEntryBox, which dervies from a TextBox (it provides some custom event handlers when text is entered, but to all intents and purposes, it’s a regular TextBox).
I wanted to style my TextEntryBox, this time including a button within my ControlTemplate (this will eventually toggle an on-screen keyboard pop-up, but that’s another blog post!). I came up with this:
Read the rest of this entry »
Tags: button, c#, event, events, events inside a ControlTemplate, events within a ControlTemplate, GetTemplateChild, OnApplyTemplate, programming, RoutedEvent, RoutedEventhandler, WPF



















