Windowscommunitytoolkit: DataGrid for Xaml Islands

Created on 26 Sep 2019  路  7Comments  路  Source: windows-toolkit/WindowsCommunityToolkit

Is it possible to have the DataGrid in Xaml Islands and is there a sample? If not, when will it be available if ever?

DataGrid XamlIslands help wanted question

Most helpful comment

@marb2000,

In an attempt to create a DataGrid example, I implemented the walk-through as you suggested, but couldn't get that to work.

Runtime

image

Using x64 configuration, everything compiles fine, but the user control doesn't show up. There are exceptions being thrown, as can be seen from the output window, but the information is minimal.

Exception thrown: 'System.InvalidCastException' in PresentationCore.dll
Exception thrown: 'Windows.UI.Xaml.Markup.XamlParseException' in ClassLibrary1.dll
Exception thrown: 'System.Reflection.TargetInvocationException' in System.Private.CoreLib.dll
'WpfApp1.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.0.0\System.Buffers.dll'. 
'WpfApp1.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App\3.0.0\System.Windows.Controls.Ribbon.dll'. 
The thread 0x364 has exited with code 0 (0x0).
'WpfApp1.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.0.0\System.Diagnostics.Tools.dll'. 

Design time

Still getting IXamlMetadataContainer issue even though it should have been resolved in The 6.0.0-preview6.4

app.manifest

An exception was being thrown before I added app.manifest

Questions

  • The tutorial doesn't mention the reason for including UWP app project. Other then referencing it in the WPF app, it is not being used. What's the purpose?
  • Does it matter if references be added as project reference or DLL reference? Only asking because you added as DLLs in the .NET Community Standup.

Thanks for your help!

All 7 comments

@marb2000 If you have the sample available and can showcase that to @virzak that would be great.

No. I don't have a sample. This is great request for the community: Can someone help us to create a sample?

Hi @marb2000,

I tried doing that but hit the wall because DataGrid is not a part of Windows.UI.Xaml.Controls.

I described the issue here earlier.

@marb2000,

In an attempt to create a DataGrid example, I implemented the walk-through as you suggested, but couldn't get that to work.

Runtime

image

Using x64 configuration, everything compiles fine, but the user control doesn't show up. There are exceptions being thrown, as can be seen from the output window, but the information is minimal.

Exception thrown: 'System.InvalidCastException' in PresentationCore.dll
Exception thrown: 'Windows.UI.Xaml.Markup.XamlParseException' in ClassLibrary1.dll
Exception thrown: 'System.Reflection.TargetInvocationException' in System.Private.CoreLib.dll
'WpfApp1.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.0.0\System.Buffers.dll'. 
'WpfApp1.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App\3.0.0\System.Windows.Controls.Ribbon.dll'. 
The thread 0x364 has exited with code 0 (0x0).
'WpfApp1.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.0.0\System.Diagnostics.Tools.dll'. 

Design time

Still getting IXamlMetadataContainer issue even though it should have been resolved in The 6.0.0-preview6.4

app.manifest

An exception was being thrown before I added app.manifest

Questions

  • The tutorial doesn't mention the reason for including UWP app project. Other then referencing it in the WPF app, it is not being used. What's the purpose?
  • Does it matter if references be added as project reference or DLL reference? Only asking because you added as DLLs in the .NET Community Standup.

Thanks for your help!

@virzak I took a look to your sample and I observed two things:

  1. The UWP app doesn't reference the ClassLibrary. You need to do it to make the UWP App project generates the IXamlMetadataProvider for the Class Library.
  2. You should avoid AnyCPU and compile in x64,

Excellent, thanks @marb2000 .

Fixed, checked in and pushed. Runs fine now.

Still getting the Design Time error. Obviously not as critical, but do you know a solution off the top of your head?

image

I think that this will be out with the VS2019 update 4. @diverdan92 and @LyalinDotCom should take care of it. No workarounds available :(

Was this page helpful?
0 / 5 - 0 ratings