开发者

IDialogService in design time

开发者 https://www.devze.com 2023-03-02 14:29 出处:网络
I was fallowing Mix 2011 MVVM Deep dive talk and try to implement IDialogService interface to display messages and common loading bars... etc, but I found bit troubling assignment DialogService to Vie

I was fallowing Mix 2011 MVVM Deep dive talk and try to implement IDialogService interface to display messages and common loading bars... etc, but I found bit troubling assignment DialogService to ViewModel thru Views constructor. like this

((MasterViewModel) 开发者_Python百科DataContext).DialogService = (IDialogService) App.Current;

This causing InvalidCastException in designg time, do you have any idea how to fix this?

Thanks


Tried using an 'as' instead of a cast?

0

精彩评论

暂无评论...
验证码 换一张
取 消