Validate data binding in XAML in compile time

后端 未结 6 1728
说谎
说谎 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条回答
  •  萌比男神i
    2020-12-08 23:39

    I agree with the previous answer. This is "by design" and there is no way to check it at compile time.

    I've also found it a pain.

    The best and only way I found is to check the Visual Studio debug output at runtime. Any binding error will be printed as soon as you open the window containing it.

    I agree if you think it's a crappy and unreliable method, but it should work if you don't have a huge number of windows. You could create a semi-formal test practice where once in a while you open any window looking specifically for binding errors.

提交回复
热议问题