How to fill DataContext when you don’t have one

Since Visual Studio 2010 (long time ago), is’s possible to set design time values to DataContext. It can be either loading data from Xaml file (with d:DesignData, Source and build action of xaml file set to DesignData explained here) or provides a real design type (with d:DesignInstance, Type and IsDesignTimeCreatable as explained here).

Complete documentation is provided here in MSDN and some more details on IsDesignTimeCreatable and CreateList here.

Implementing a virtualized panel in WPF

If you need UI virtualization with other layout thanVirtualizingStackPanel, one solution can be a new implementation. To do so, these series of blogs can help you:

  1. Implementing a virtualized panel in WPF
  2. Implementing a VirtualizingPanel part 2: IItemContainerGenerator
  3. Implementing a VirtualizingPanel part 3: MeasureCore
  4. Implementing a VirtualizingPanel part 4: the goods!

It can also be usefull to better understand how virtialization works.