WPF data context for design time and run time

后端 未结 2 1794
南方客
南方客 2021-02-06 18:33

I\'m learning WPF, MVVM Light and the ViewModelLocator pattern and running into difficulties with my main window\'s data context.

public class ViewModelLocator
          


        
2条回答
  •  孤独总比滥情好
    2021-02-06 18:44

    The last line will work nicely if you remove the comma after d:DesignInstance:

    d:DataContext="{d:DesignInstance Type=viewModels:MainViewModel,
    IsDesignTimeCreatable=True}">
    

提交回复
热议问题