design-time-data

Set d:DataContext to an internal class of another assembly

别等时光非礼了梦想. 提交于 2020-06-17 03:40:30
问题 Consider the following scenario: WPF view: d:DataContext="{d:DesignInstance vm:DesignViewModel, IsDesignTimeCreatable=True}" ViewModel is located in a separate c# project: internal class DesignViewModel : ViewModel { /* create demo data in ctor */ } ViewModel has this entry in AssemblyInfo: [assembly: InternalsVisibleTo("WPF.Demo.View")] Error message in XAML Designer: The name "DesignViewModel" does not exist in the namespace "WPF.Demo.View". Observations: Everything works fine if I make

DesignInstance not working in VS2012

喜你入骨 提交于 2019-12-18 14:45:12
问题 I just spent several hours on an issue when using VS2012, WPF 4.5 and design-time data, specifically the DesignInstance attribute. Goal : I wanted to have design-time data support in my WPF project (MVVM-based), both in VS2012 and Blend, and I could not for the life of me make the MVVMLight approach work consistently . So I tried to change to "just" using the built-in support for design-time data, using the markup extension provided with Blend. Problem : Consider the following code: <Window x

can anyone think of why using this particular class in a design time data source will break all design time bindings?

微笑、不失礼 提交于 2019-12-11 19:23:23
问题 I generated this class using SQLMetal.exe. It is very bindable at runtime, but if I use this class at design time, all of my design time blend bindings are busted. I am using the MVVM-Light framework and I am building an app for WP7. If I extract an interface for this class, and create a simple POCO that implements this interface and I use my simple poco in my design time data source, all of the bindings come alive. Here is the class that was generated by SQLMetal.exe. [Table(Name=

DesignInstance not working in VS2012

。_饼干妹妹 提交于 2019-11-30 11:37:28
I just spent several hours on an issue when using VS2012, WPF 4.5 and design-time data, specifically the DesignInstance attribute. Goal : I wanted to have design-time data support in my WPF project (MVVM-based), both in VS2012 and Blend, and I could not for the life of me make the MVVMLight approach work consistently . So I tried to change to "just" using the built-in support for design-time data, using the markup extension provided with Blend. Problem : Consider the following code: <Window x:Class="Nova.View.AlertsView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x