Its time again for the Charlotte Developers GUILD Code Camp. This Code Camp will be one for the books!
I’ll be doing two presentations at Code Camp, Taste The Power and a code walk through of a WPF business application.
You can download the Taste The Power Presentation below. Instead of PowerPoint slides, the presentation is a WPF application that I’ll be using.
YOU MUST - after using the below link to download the file, you MUST change the extenstion to .zip. This is a requirement of WordPress.com.
Taste The Power covers User Controls, Routed Events and Dependency Properties.
The application makes liberal use of UserControls demonstrating one method of structuring a WPF application by building the entire application with UserControls.
The RoutedEvent routing strategies are demonstrated visually and many RoutedEvents are implmented, some using custom RoutedEventHandler delegates. Several UserControls demonstrate handling RoutedEvents at the class level as well as handling Attached Routed Events. One UserControl also demonstrates how to handle a RoutedEvent even after its been marked as handled. After the presentation and or studying this code, the developer will understand how RoutedEvents work and how to implement their own RoutedEvents.
Included are two custom controls that teach how to declare and consume of Dependency Properties.
Study the HyperLinkCustomControl control and see how easy it is to create and consume a control that does exactly what you want and need. I wanted my Hyperlink to be able to display text or images and text, have some cool mouse over, mouse down behaviors and provide a ToolTip with the URL. Actually, since HyperLinkCustomControl derives from ContentControl, the developer can stick just about anything inside the hyperlink. It works very similar to an HTML hyperlink. WPF does come with a Hyperlink control but it must be a child of either a Page, FlowDocument or TextBlock control. Well, I needed one inside a UserControl so I wrote my own.
I’ll be writting a Code Project article on the included ListBoxSelectedItemIndicator custom control soon. This control was inspired by Josh Smith and his awesome teaching and code provided the means for this control to be authored. You can view Josh’s article here. This control demonstrates how to listen in to what a child control is doing, attach events to the child and act upon those events, without the knowledge of the child control. Take a look at the tab in the application entitled, “High Octane Custom Control.” Before you dive into the code, think about how this can be accomplished. I spent two days just thinking about this before I wrote this control. Josh also showed me how to derive from ContentControl instead of Control which saved code and made the control better. It was a lot of fun to write.
One of the UserControls is a password entry control. The control measure the strength of the password as the user types it in and provides nice visual feedback. This control demonstrates Dependency Property databinding.
I hope you like this code and can learn a lot from it.
Almost forgot, the code is all VB.NET!
Have a great day,
Karl
Just a grain of sand on the worlds beaches.


