开发者

How to get design time data in silverlight/wpf designer?

开发者 https://www.devze.com 2023-01-29 19:00 出处:网络
I want to have my user controls have design time data.If I add the data/datacontext using the constructor, I can see the data in the control from a different view that contains the control.

I want to have my user controls have design time data. If I add the data/datacontext using the constructor, I can see the data in the control from a different view that contains the control.

If I set the DataContext from xaml, I can see it when I'm designing the control, but I see nothing in a control that hosts the control.

So is there any example of how to get design time data to show up in a control if it is being edited, or it's parent is being edited? Or anything that lists the rules of then the constructor is run/not run from the designer? I'm trying to set a 开发者_StackOverflow中文版DesignViewModel with the data, and at runtime use the actual view model.


If I understand your question correctly then it's answered in this question

0

精彩评论

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