Data See, Data Do

Mike Hillberg's Blog on Wpf and Silverlight

Browse by Tags

Tagged Content List
  • Blog Post: TreeView and HierarchicalDataTemplate, Step-by-Step

    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 steps, though, there really is a pretty nice progression...
  • Blog Post: Why is it called a "DependencyProperty"?

    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 relates to other classes, future plans, etc. ...
  • Blog Post: ICommand is like a chocolate cake

    (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 it, and integrate it into the higher layers...
  • Blog Post: Of logical and visual trees in WPF

    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, and ElementName bindings, this may be interesting...
  • Blog Post: Model-see, Model-do, and the Poo is Optional

    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; bootstrappers; image processors; a debugger; a...
  • Blog Post: A look at stretchy elements

    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 being positioned in a 150x300 pixel cell in a Grid...
  • Blog Post: Namespaces in Xaml

    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”, so that I don’t get confused with WPF element...
  • Blog Post: Expandos in xaml

    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 = paragraph1.testing ' >...
  • Blog Post: Where does a Binding find its data?

    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 data come from? The rest of this...
  • Blog Post: Parameterized templates; and how to create reusable, custom-looking buttons without code

    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 you to part of an app. For example, in this picture...
  • Blog Post: A TreeView, a HierarchicalDataTemplate, and a 2D collection walk into a bar ...

    Bea has a handy post describing how to group items in a collection using a CollectionViewSource. I was looking at that, and a post on the WPF forum from markovuksanovic, and for fun created a version of Bea’s example that uses a 2D collection instead of the CollectionViewSource. (I found a bunch of HierarchicalDataTemplate...
  • Blog Post: Brief anatomy of a ListBox

    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 I’m trying to live a paper-free life, and posting...
  • Blog Post: Xaml Inspired Markup

    A lot has been written about how Xaml maps tags and attributes to objects and properties. (Here’s a standard Xaml overview .) But it’s not necessary that Xaml actually be used to create .Net objects. For example, XPS is markup that can be treated like Xaml and used to create/initialize objects, but it...
  • Blog Post: Sharing, and not sharing, Setter.Value in a Style or Template

    Setter values in a style or template get shared, which is good for performance, but impacts how some features work. Take this example with a Button style: < Page xmlns = " http://schemas.microsoft.com/winfx/2006/xaml/presentation " > < Page.Resources > < Style TargetType =...
  • Blog Post: The Loaded event and the Initialized event

    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...
  • Blog Post: Being written by XamlWriter

    A big part of WPF (Avalon) is the Xaml format for creating object trees. You can also go in the other direction – take an object tree and write it out to Xaml – with the XamlWriter class. It’s frequently easy for XamlWriter to convert an object into a good Xaml representation. Sometimes, though...
Page 1 of 1 (16 items)