Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » Styles and Templates   (RSS)

How do I programmatically interact with template-generated elements? Part II

This post shows you how to find a named element within a DataTemplate. In Part I , we discussed how to find a named element within a ControlTemplate. That was fairly simple; you’d call Template.FindName on the control that the ControlTemplate has been

How do I programmatically interact with template-generated elements? Part I

You may have a scenario that requires you to find an element within a ControlTemplate. To do that, you use Template.FindName. Say you have a simple ControlTemplate for a Button, like the following: < Style TargetType = " {x:Type Button} " > <

"Styling" the content of a ContentControl

People have occasionally asked about using a Style to set the content of a control. For example, suppose you want all of your buttons in an application to have the same content. You can do something like this (As usual, this doesn’t make sense for a real

Are You My Mother? A look into how property inheritance works with the logical and visual element trees.

I was recently working on an article for the SDK and noticed some unexpected behavior in one of my examples. After a long discussion with a developer on the team, I caught onto some concepts that weren’t readily obvious to me. I’m going to share my findings

Styles and Templates - How's everything related?

People who are new to the platform often have these questions about styles and templates (and a related concept, resources): What is a Resource? In the simplest terms, a resource is a reusable object. For example, the following SolidColorBrush is declared
 
Page view tracker