CommunityToolkit icon indicating copy to clipboard operation
CommunityToolkit copied to clipboard

LazyView Documentation Doesn't Reflect Reality

Open realchrisparker opened this issue 2 years ago • 2 comments

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.

realchrisparker avatar Sep 21 '23 16:09 realchrisparker

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.

bijington avatar Sep 22 '23 05:09 bijington

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" />

realchrisparker avatar Sep 22 '23 14:09 realchrisparker