WPF XAML designer showing bound property names instead of property values

后端 未结 4 1461
我寻月下人不归
我寻月下人不归 2021-01-06 06:31

One of my XAML files shows a strange behaviour in the XAML designer (but not during runtime):

public class MyDesignTimeViewModel
{

    public MyDesignTimeVi         


        
4条回答
  •  悲哀的现实
    2021-01-06 07:29

    Turns out the missing thing was the IsDesignTimeCreatable attribute:

    d:DataContext="{d:DesignInstance vm:MyDesignTimeViewModel, IsDesignTimeCreatable=true}"
    

    With that attribute, everything works as expected.

提交回复
热议问题