How to see design-time data-binding in XAML editor (it works in runtime)?

Make sure that you have these definitions at the root tag of your xaml file (in your case the Window tag):

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"

Then, anywhere in the xaml (including the root tag) you can add this:

d:DataContext="{d:DesignInstance myNamespace:MyViewModel, IsDesignTimeCreatable=True}"

Now you just need to make sure that you initialize the values in a constructor or have default values for properties.

If you need to run a special logic for design mode, look at this answer.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)