-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WinUI 3.0 Alpha: ListView Issue #2154
Comments
@goh-chunlin Is this a build error or just what the editor is saying on hovering over ? In WinUI3 we are switching the namespaces from Windows to Microsoft, so both the Markup and Code should say Microsoft. This might be an issue with the Visual studio Xaml designer showing the incorrect type. |
Hi @ranjeshj , I have cleaned and rebuilt the solution but the problem is still there. The editor only shows correct namespace if I indicate the prefix, as shown in the code below.
Thanks for your time attending to this. |
@goh-chunlin You cannot mix Windows.UI.Xaml and Microsoft.UI.Xaml types in WinUI3. So using WUX.ListView will not work. The compositor might still be the system compositor which is expecting Windows types. @codendone Is there a way to make this work ? |
VisualExtensions.GetVisual() comes from the Windows Community Toolkit, which does not yet have a WinUI 3 compatible version. The current version expects a Windows.UI.Xaml element, which is why you're getting that error. A WinUI 3 version is currently in progress: see CommunityToolkit/WindowsCommunityToolkit#3106. Until then, you can replace this VisualExtensions.GetVisual(ImageList) call with its implementation: ElementCompositionPreview.GetElementVisual(ImageList). |
Thanks for the help, @codendone I think my doubts are well answered and I will wait for the updates. For now, I will proceed to close this Issue, @ranjeshj |
Describe the bug
In the following code, there is an exception saying "(Error CS1503) cannot convert from 'Microsoft.UI.Xaml.Controls.ListView' to 'Windows.UI.Xaml.UIElement'".
However, in fact, the ImageList is actually Windows.UI.Xaml.Controls.ListView, which should be inherting from Windows.UI.Xaml.UIElement.
So it is a bit confusing because XAML and code behind tell different story.
Expected behavior
The namespace of ListView in both XAML and code behind should be the same.
Version Info
NuGet package version:
NuGet: Microsoft.WinUI 3.0.0-alpha.200210.0
The text was updated successfully, but these errors were encountered: