ASP.NET controls like ListView allows providing a custom template by setting the ListView.EmptyDataTemplate property, this template will be rendered in case of empty data source.
How to do the same in WPF (XAML only preferrable) for ItemsControl based controls like ListView and DataGrid? So I want to show my custom DataTemplate in case when ItemsSource is empty.
You can use set the Template property based on a DataTrigger
For example,
In Resources:
Control itself:
There might be an simplier way of doing the binding, but I don’t have a compiler on me right now to figure out what it would be 🙂