I am using Visual Studio 2008, I am writing a WPF application. I am new to WPF and would like to see the contents of my list at design time so that I can see what I am doing in xaml but am attached to my real data at runtime.
My data is an observable collection of a simple object such as a model, which provides several properties, such as Id, Title, Description, etc.
At runtime, I need to access the data source collection from the code in order to dynamically change the contents
I currently have:
<Window x:Class="EktronDataUI.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:EktronDataUI"
Title="Window1" Height="300" Width="300">
<Window.Resources>
<ObjectDataProvider ObjectType="{x:Type local:SmartFormDefinitionProvider}" x:Key="formsProvider" MethodName="GetMockData" />
</Window.Resources>
<Grid>
<DockPanel>
<TextBlock DockPanel.Dock="Top">Hello WPF</TextBlock>
<ListView Name="myListView" ItemsSource="{Binding Source={StaticResource formsProvider}}">
<ListView.View>
<GridView>
<GridViewColumn Header="Id" DisplayMemberBinding="{Binding Id}" />
<GridViewColumn Header="Title" DisplayMemberBinding="{Binding Title}" />
</GridView>
</ListView.View>
</ListView>
</DockPanel>
</Grid>
</Window>
Which shows me my layout data at runtime, but not at design time. The list is just an empty rectangle in the designer, although I see the text "Hello WPF"
?
Edit:
? , xaml, , , , . , ,