WPF has been around for a long time. It is no longer a novelty, yet it still has real vitality — plenty of people still build UIs with it.
Learning WPF often starts fast. Then you get stuck on the deeper bits: after you can draw a screen, you keep grinding on styles, custom controls, and other small details.
That grind often comes from one misunderstanding.
Overview
WPF (Windows Presentation Foundation) is Microsoft's graphics engine from the .NET 3.0 era — a managed wrapper over Direct3D. In the marketing it always shows up with XAML: drag things in the designer, write a few lines of markup, and the UI appears. Many people stop there and think: oh, another HTML-like thing.
Easy to start, hard to go deep
WPF's "HTML" (XAML) looks like this:
<Window x:Class="WpfApplication7.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
Title="Window1" Height="300" Width="300">
<Grid>
<TextBlock Text="Hello WPF" Margin="20"/>
<Button Content="Rename" Width="80" Height="30"/>
</Grid>
</Window>
Writing UI from that description feels easy. But WPF is not a handy little knife. It is a full-scale mammoth. Borrowing numbers from LearnWPF, here is the scale:
| Framework | public types | classes |
|---|---|---|
| ASP.NET 2.0 | 1098 | 1551 |
| WinForms 2.0 | 777 | 1500 |
| WPF | 1577 | 3592 |
That is the beast we have to face.
Microsoft's pitch
In the official story, only XAML usually walks on stage. Microsoft put almost all of the "simplicity" into it, and invented two hooks:
Hook 1: declarative programming. Web UIs were already declarative; not really new. XAML with IntelliSense did raise UI description one level — for 2006.
Hook 2: design and development separation. Designers draw in Blend; developers write logic in VS; they meet in XAML.
Those two hooks stacked into one misunderstanding: WPF = XAML.
Charles Petzold wrote Applications = Code + Markup in 2006. The first half of the book never uses XAML — pure C# UI. He peels UI description open and reasons from code. At the end of that reasoning, WPF's center of gravity sits on code. And the heaviest idea in the code is:
Dependency properties.
What is a dependency property?
Depend on what? And where does the property come from?
A dependency property looks like this:
public static readonly DependencyProperty IsSpinningProperty =
DependencyProperty.Register("IsSpinning", typeof(bool));
public bool IsSpinning
{
get { return (bool)GetValue(IsSpinningProperty); }
set { SetValue(IsSpinningProperty, value); }
}
Still a familiar property shape: get/set are there. Inside, though, there is another world — GetValue / SetValue.
Where does that "Value" live? In a dependency object. DependencyObject is WPF's core base class. Think of it as a sublet landlord that lives on an information gap.
The gap: when a property is not modified — say FontSize — the value lives outside, shared, one copy for everyone. Only when you set it (obj.FontSize = 14) does the value move into that object's EffectiveValueEntry array. Outside it looks like "yours"; inside there is another ledger.
Put another way, dependency properties play games in space and time.
In space, a property value no longer has to live only on the object itself: it can come from a style, a binding, an animation, or inheritance from a parent. The property space expands outside the object body.
In time, EffectiveValueEntry holds a string of candidates at once — baseValue, animatedValue, coercedValue, expressionValue — and priority decides the final winner.
With both dimensions open, the rest of the framework falls into line: around dependency properties, WPF grows logical tree, visual tree, routed events, Style, Template — and MVVM as a design pattern.
Back to the question: how do you learn WPF?
Learning path
WPF is complex. It is also extremely simple.
- First learn to draw UIs — XAML, layout, basic controls — until you can paint a screen.
- Then basic events, Style, and so on — until you can ship a usable WPF app.
Those two steps cover "usable". Next is engineering:
- Learn MVVM, ICommand, and an MVVM framework — what production work needs.
- Study dependency properties, routed events, custom controls — go one level deeper.
After that, frameworks:
- Study Prism, MVVM Light, and other application frameworks.
- Browse open-source projects and see how they are used in the real world.
Looking ahead
In the AI era, AI can write the XAML and tune the UI; getting started can be faster. The learning map barely changes: paint the UI, build the engineering, study the frameworks.
Wish you a smooth and pleasant ride with WPF.




Top comments (0)