Browse by Tags
All Tags »
Anatomy (RSS)
I’ve never found TreeView to be terribly confusing by itself. But usually I want to data bind a TreeView to a collection with some hierarchy, which leads me to HierarchicalDataTemplate, which didn’t always just write itself for me. If you look at it in
Read More...
Attachment(s): TreeViewStepByStep.zip
When we create new classes and members we spend a lot of time and effort to make them as usable, understandable, and discoverable as possible. We follow the .Net Design Guidelines in general, and in particular we constantly look at how this new class
Read More...
(This has been updated with some information about the origin of a routed command’s route, and of focus scopes.) ICommand in WPF is a pretty simple thing at its core. But it gets more interesting and complicated as you build up functionality on top of
Read More...
This post is about the “logical tree” in WPF, and how it differs from the visual tree. For the most part you don’t need to understand this. But if you want to understand some of the nit-like details of property inheritance, {DynamicResource} references,
Read More...
Like a lot of people, I’ve developed software professionally for a lot of different environments: PC systems and embedded systems; high- and low-level languages; kernel mode, user mode, real mode, and protected mode; system services; domain controllers;
Read More...
There are several elements in Wpf that have a "Stretch" property. The basic idea of these properties is to allow you to specify how an element adapts itself to a layout container, such as a Grid. For example, if you have a 100x200 pixel image, and it's
Read More...
If you’re really into Xml conformance, and you’ve really wondered how Xaml uses Xml namespaces, read on; I can cover the most relevant details in 1160 words or less … Namespaces on tags (I’m using the term “tag” here instead of the more correct term “element”,
Read More...
This post has a couple of suggestions on ways to accomplish expandos in Xaml. F irst some background … On an HTML page you can define your own new “expando” properties on the fly, such as in this example: < HTML > < BODY onload = ' paragraph1.innerText
Read More...
If you’ve look at much WPF Xaml you’ve probably seen bindings like this: < TextBlock Text = " {Binding Name " /> … which binds the Text property of the TextBlock to the Name property of some data object. The question that begets is: where does the
Read More...
Attachment(s): barrow.jpg
I’ve talked to a few people recently about parameterized templates, and so I wanted to write some of it down. Here’s the scenario … I want to create an application that has a main window with several buttons on it. Clicking one of the buttons navigates
Read More...
Attachment(s): pt1.jpg
An example of a TreeView and HierarchicalDataTemplate being used to display a collection of collections.
Read More...
Attachment(s): hdt.jpg
ListBox has properties on it that allow you to control how the items in the list box get displayed. Those properties make sense if you understand some basic concepts of the ListBox, but sometimes I forget, so I wanted to post a picture on my wall. Except
Read More...
Attachment(s): ListBox.jpg
A lot has been written about how Xaml maps tags and attributes to objects and properties. But it’s not necessary that Xaml actually be used to create .Net objects. Maybe you don’t plan to for your markup to be mapped to objects, at least not today. But if you already work with Xaml, following the same syntax conventions as Xaml for your other markup provides some nice consistency and readability, and a possible future path to intuitive code manipulation.
Read More...
Attachment(s): OrgChart.JPG
Setter values in a style or template get shared, which is good for performance, but impacts how some features work, especially elements and Freezables.
Read More...
In WPF, controls have both a Loaded even and an Initialized event. Initializing and loading a control tend to happen at about the same time, and consequently these events fire at roughly the same time. But they have slightly – though important – different meanings, and the differences can be a source of confusion. So here’s some background on how we designed these events.
Read More...