Validate data binding in XAML in compile time

后端 未结 6 1740
说谎
说谎 2020-12-08 22:44

I’m working on WPF based application. Environment is VS2008 SP1 with .NET 3.5 SP 1. In our development we are using MVVM pattern widely.

I.e. application developer

6条回答
  •  清歌不尽
    2020-12-08 23:21

    If you install ReSharper, one of the (many) features you will get is "code inspection". One of the things this inspection will detect is cases where your binding does not resolve to a property on your data context. You can easily filter the "Inspection Results" window to only show these issues.

    Note that you must explicitly state the type of your view model in your XAML resources for this to work.

    Example of ReSharper inspections

提交回复
热议问题