LazyView Documentation Doesn't Reflect Reality
The documentation reads as if you can use the LazyView like any other view, but the sample reflects a different implementation.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: d91098bd-14a2-85ef-5e05-af612cdba673
- Version Independent ID: d91098bd-14a2-85ef-5e05-af612cdba673
- Content: LazyView - .NET MAUI Community Toolkit - Community Toolkits for .NET
- Content Source: docs/maui/views/LazyView.md
- Product: dotnet-communitytoolkit
- GitHub Login: @kphillpotts
- Microsoft Alias: joverslu
You can use LazyView like a normal control however you need to supply the x:TypeArguments attribute to determine which type of view you will be setting as the content once loaded. I believe the examples create their own classes to avoid having to supply the x:TypeArguments.
We can provide some clearer explanation around this in the samples/docs though as it sounds like it might be unclear.
Hi @bijington
I made this post because the sample is the only way it appears to work. If you setup the lazyview like the documentation Visual Studio gives you the following error XLS0507 "Type 'LazyView' is not usable as an object element because it is not public or does not define a public parameterless constructor or a type converter."
Maybe I'm doing something wrong but the following code produces that error.
<toolkit:LazyView x:Name="LazyOrgGeneral" x:TypeArguments="viewsOrgPartials:OrgGeneralLazyView" />