WPF Bootcamp
Bootcamp Final Walkthrough
This final walkthrough ties the core pieces together in one screen: layout, a view model, commands, collection rendering, validation-aware input, and reusable styling.
The point is not to memorize this exact sample. The point is to see how the WPF systems cooperate when the screen is built coherently.
What you'll learn
- How the same screen can use layout, templates, bindings, and commands without leaking concerns across layers.
- How to reason about the flow from state to visuals to user interaction and back again.
- How to review a WPF screen and identify where each responsibility belongs.
- How all the major WPF subsystems you just learned reinforce each other inside one realistic composition.
<Grid Margin="24">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ListBox ItemsSource="{Binding Tasks}"
SelectedItem="{Binding SelectedTask}" />
<Button Grid.Row="2"
Content="Save changes"
Command="{Binding SaveCommand}" />
</Grid>
Even this short sample already uses several framework ideas at once: layout negotiation, collection rendering, selected-item binding, and a command-driven action.
The mental model in one sentence
A coherent WPF screen is a collaboration between the tree, property system, layout engine, binding engine, command system, collection controls, and template/style layer, all coordinated around one bounded screen state.
What you should see now
Not just "a list and a button", but a set of interacting framework contracts that each own part of the behavior.
Why this matters
If you can read a screen through those contracts, you can debug it, extend it, and review it much more reliably.
A fuller sample screen
<Grid Margin="24">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="3*" />
</Grid.ColumnDefinitions>
<TextBlock Grid.ColumnSpan="2"
Text="Task Editor"
FontSize="28" />
<ListBox Grid.Row="1"
ItemsSource="{Binding Tasks}"
SelectedItem="{Binding SelectedTask}" />
<StackPanel Grid.Row="1"
Grid.Column="1"
Margin="24,0,0,0">
<TextBox Text="{Binding SelectedTask.Title, Mode=TwoWay}" />
<TextBox Text="{Binding SelectedTask.Notes, Mode=TwoWay}" />
<TextBlock Text="{Binding ValidationMessage}" />
</StackPanel>
<Button Grid.Row="2"
Grid.ColumnSpan="2"
HorizontalAlignment="Right"
Content="Save changes"
Command="{Binding SaveCommand}" />
</Grid>
This is still small, but it is now representative enough to show how the main WPF subsystems cooperate inside one realistic editing workflow.
Read it subsystem by subsystem
- Tree and composition: the grid is the host, the list and editor are sibling feature areas, and the button sits in the command area.
- Layout: rows and columns divide the screen into a header, content region, and action row.
- Binding: the list binds to
Tasks, the editor binds to the currently selected task, and the text block binds to validation-facing status. - Collections: the list box renders a collection and synchronizes selected item state back to the view model.
- Commands: the save button expresses intent through
SaveCommandinstead of a direct click handler. - Validation and input: editable fields can surface invalid state while the validation message and command availability reflect whether the screen is ready to save.
This is the real payoff of the bootcamp: you can now inspect the screen through a set of stable conceptual lenses instead of treating it like one indivisible blob of XAML.
How the state flow works
- The view model exposes a
Taskscollection, aSelectedTask, editable properties, and aSaveCommand. - The list box shows the collection and pushes selection back through binding.
- The editor fields read and write the selected task's editable state.
- Validation runs as input changes or when editing is committed, depending on the binding configuration.
- The save command evaluates whether the current state can be persisted.
- When saving succeeds, the view model updates any status properties and the bindings refresh the visible UI.
That is a full loop from data to visuals to user input and back to state. If you can explain that loop, you understand the screen.
How to review a WPF screen
Start with layout
Which panel owns sizing and placement? Are rows, columns, alignment, and spacing expressing the intended structure clearly?
Then inspect bindings
What is the data context? Which properties are one-way, two-way, or command bindings? Is state living in the right layer?
Then inspect control choice
Is a list actually using an items control? Is selection modeled declaratively? Are templates doing visual work rather than behavioral work?
Then inspect reuse and validation
Are styles and resources centralizing design decisions? Do validation and commands produce a usable editing flow?
This review order is practical because it follows the same architectural layering you learned across the bootcamp.
How to read the sample
- The
Griddefines structure and resizing behavior. - The list renders a collection with selection bound back to the view model.
- The editor area uses two-way input and command-driven actions.
- The save action is exposed as a command, so it can be reused from a toolbar, menu, or shortcut later.
Each decision maps back to an earlier lesson. That is the real goal of the bootcamp: not isolated facts, but a stable design instinct.
How the lessons connect
- The application mental model taught you that the screen is a collaboration of systems, not a bag of controls.
- XAML fundamentals taught you how the object graph is declared.
- Layout taught you why the grid and stack panel behave the way they do.
- Controls, content, and collections taught you why the list box is the right abstraction for repeated items.
- Dependency properties, binding, and commands explained how state and actions move through the UI.
- MVVM, styling, validation, and composition taught you how to keep the whole thing maintainable as it grows.
The final walkthrough matters because it proves these topics are not isolated chapters. They are all parts of one design language.
Common mistakes
- Collapsing all responsibilities into the view model and calling it architecture.
- Building the right screen with the wrong abstractions, such as manual list rendering instead of an item control.
- Styling late and ad hoc rather than using resources and templates from the beginning.
- Reviewing a complex screen only visually instead of tracing layout, data flow, commands, and validation separately.
- Treating the final sample as a recipe to copy verbatim rather than a model to reason from.
InkkSlinger parity note: This is the bridge point back into the repository. Once you understand the WPF side of the design, the existing InkkSlinger docs become much easier to use because you can map each screen concern onto the corresponding framework primitive.
The next practical step is to jump into the project-specific docs and apply this model inside InkkSlinger.