Cool trick with Dependency Properties

One of the cool things about dependency properties is that they allow other things to be dependent on them and notified of changes to them (hence their name). However, one thing that people will sometimes stumble upon is that they want to know about a change to a particular property value but WPF does not…

3

IScrollInfo tutorial part IV

After our last installment, which was written many moons ago (literally), the only remaining thing left to do (apart from clean up the code a bit) was to implement the IScrollInfo.MakeVisible method. Somebody has requested that I address this, so I am going to attempt to fulfill that. The idea of MakeVisible is that it…

8

More advanced attached property use: the Ramora pattern

I like to think of the technique I am about to demonstrate as the Ramora pattern – it allows you to attach a chunk of logic to any existing element that you have. The RadialPanel example showed an example of storing information on an element using attached properties. In that example, we did not need…

7

Attached properties – the basics

One of the coolest features in Avalon is the property subsystem. While it might seem difficult for some that Avalon has a property system built on top of the normal CLR properties, the power that this system gives you is incredible and is part of why a lot of scenarios in Avalon require less code…

2

IValueConverter in WPF data binding

One of the handy things that you can do with data binding in WPF is that you convert the data as you pull it from the data source. The mechanism for this is the IValueConverter interface. Let’s say that you have a list of numbers representing positions in a race, and you want to display this…

6

Spring Blog cleaning

Whatever tiny readership I have has probably noticed that I have tried to clean up the blog a bit, fix up some links and post some new content. I even picked a spiffy new blog template. Hopefully the momentum can be kept up this time. My post count is woeful, and I always procrastinate writing…

1

ItemsControl Customization

One of the cool things about ItemsControls is that you get to separate the data binding and item control logic from the layout logic by specifying the Panel that you want to lay items out. There are two ways of specifying a Panel for an ItemsControl. One of them is to use the ItemsPanel property,…

3

The ItemsControl paradigm

So what is an ItemsControl anyway? I think that this might be one of the steeper learning curves coming from Win32 like I did, so I thought that I would write about it. An ItemsControl is a control that owns items, whether through a collection of them that it owns or through data binding. The…

2

Responding to comments

I just noticed that somebody asked an IScrollInfo question and I did not notice. I need to learn how to use the blogging software a little better 🙁 The question was basically about when ScrollOwner is set and why there are so many duplicated properties between the Panel and the ScrollViewer. The reason why the…


IScrollInfo in Avalon part III

When we last left the application it had the appearance of something that could scroll, but exceptions were being thrown from unimplemented members left and right. This posting will help out with that. Let’s look at the SetVerticalOffset method as the first case. This method is called when the user drags the thumb on the vertical…

8