views:

293

answers:

1

This is my first time using Sketchflow and I followed a video tutorial explaining how to use a DataGrid and a Sample Data Source within a SketchFlow project. Everything renders fine in Blend but when I attempt to run it within the SketchFlow player I get the following exception:

Message: Unhandled Error in Silverlight Application Exception has been thrown by the target of an invocation. at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Reflection.Assembly.CreateInstance(String typeName) at Microsoft.Expression.Prototyping.Workspace.PlayerWindow.InstantiateScreen(String screen, Boolean showImmediately) at Microsoft.Expression.Prototyping.Workspace.PlayerWindow.TransitionScreens(String from, String to) at Microsoft.Expression.Prototyping.Navigation.NavigationViewModel.NavigateToScreen(String name, Boolean record) Line: 1 Char: 1 Code: 0 URI: http://localhost:31327/TestPage.html

Here's the xaml for the user control containing the Grid. I should not that if I remove the data grid, top-level grid binding and ResourceDictionary, the page works fine in the player:

<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:local="clr-namespace:Admin_PrototypeScreens" xmlns:ps="clr-namespace:Microsoft.Expression.Prototyping.SketchControls;assembly=Microsoft.Expression.Prototyping.SketchControls" xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
x:Class="Admin_PrototypeScreens.Screen_1_1"
Width="980" Height="600">
<UserControl.Resources>
 <ResourceDictionary>
  <ResourceDictionary.MergedDictionaries>
   <ResourceDictionary Source="ProjectDataSources.xaml"/>
  </ResourceDictionary.MergedDictionaries>
 </ResourceDictionary>
</UserControl.Resources>

<Grid x:Name="LayoutRoot" Background="White" DataContext="{Binding Source={StaticResource RecentImportExports}}">
 <local:Header Margin="0,0,0,0" VerticalAlignment="Top" d:IsPrototypingComposition="True"/>
 <local:Navigation Margin="0,66,0,0" VerticalAlignment="Top" d:IsPrototypingComposition="True"/>
 <TextBlock Height="32" HorizontalAlignment="Left" Margin="8,120,0,0" Style="{StaticResource SubtitleLeft-Sketch}" VerticalAlignment="Top" Width="312" Text="Home" TextWrapping="Wrap"/>
 <ps:SketchRectangleSL Background="#FFE8E6E6" Margin="8,152,8,8" Style="{StaticResource Rectangle-Sketch}"/>
 <TextBlock Height="24" HorizontalAlignment="Left" Margin="40,176,0,0" Style="{StaticResource TextBlock-Sketch}" VerticalAlignment="Top" Width="216" Text="Recent Imports/Exports" TextWrapping="Wrap"/>
 <data:DataGrid Margin="40,216,420,200" AutoGenerateColumns="False" ItemsSource="{Binding ImportExportCollection, Mode=OneWay}">
  <data:DataGrid.Columns>
   <data:DataGridTextColumn Header="Repository" Binding="{Binding Repository}"/>
   <data:DataGridTextColumn Header="Partner" Binding="{Binding Partner}"/>
   <data:DataGridTextColumn Header="Type" Binding="{Binding Type}"/>
   <data:DataGridTextColumn Header="Date" Binding="{Binding Date}"/>
   <data:DataGridTextColumn Header="Rows" Binding="{Binding Rows}"/>
   <data:DataGridTextColumn Header="Errors" Binding="{Binding Errors}"/>
  </data:DataGrid.Columns>
 </data:DataGrid>
</Grid>

A: 

Can you zip up your project and post it someplace, or email it directly to me? I can take a look and see if I can help determine what is wrong.

I work on the team that developed SketchFlow.

My email address is Chuck (dot} Hays ignorethis at Microsoft {dot) com.

Chuck Hays