xamarin / XamarinCommunityToolkit

The Xamarin Community Toolkit is a collection of Animations, Behaviors, Converters, and Effects for mobile development with Xamarin.Forms. It simplifies and demonstrates common developer tasks building iOS, Android, and UWP apps with Xamarin.Forms.
MIT License
1.59k stars 471 forks source link

[Bug] Sample doesn't show items for pages after WelcomePage #606

Open pictos opened 3 years ago

pictos commented 3 years ago

Description

This happens just for UWP and WPF (so far).

Steps to Reproduce

  1. Target the sample app to UWP or WPF
  2. When the app is running click Views, Behavior, etc
  3. You will see an empty page

Expected Behavior

See the samples cards

Actual Behavior

I can't see the sample cards image

image

Basic Information

Workaround

Change the CollectionView to ListView.

Reproduction imagery

Reproduction Link

VladislavAntonyuk commented 3 years ago

as for UWP you have to resize the app (as workaround) as for WPF. it is XF issue. We use ControlTemplate and CollectionView which are not implemented in XF for WPF as for GTK. similar to WPF. But I also updated PancakeView in my PR, which fixes build issue

bmacombe commented 3 years ago

https://github.com/xamarin/Xamarin.Forms/pull/11394 might fix this issue when merged...for uwp

pictos commented 3 years ago

So for now the workaround will be to not use ContentTemplates for the list pages.

VladislavAntonyuk commented 3 years ago

XF 5.0.1 should fix it for WPF: https://github.com/xamarin/Xamarin.Forms/pull/7728

pictos commented 3 years ago

@VladislavAntonyuk, maybe this can take more time, it's a too old PR and is targeting the wrong branch there.

VladislavAntonyuk commented 3 years ago

@pictos I am not sure, but I think you are a bit closer to the Xamarin Forms owners. It would be nice if you ping them to review the PR. Because mostly developers create apps for Android and iOS, it is less risky to break something by fixing this PR for WPF.

pictos commented 3 years ago

@VladislavAntonyuk sure, I'll ping them later today.

jfversluis commented 3 years ago

Still happening with all the latest code on main today

MichaelStgt commented 3 years ago

The easiest workaround for this issue I found is to replace the CollectionView with a ListView in the App.xaml Control Template:

        \
           \
               \
                   \...

This issue looks for me like the same I encountered earlier, if a CollectionView is not wrapped in a RefreshView, it will not show anything in UWP when the page is Initialized.

jfversluis commented 3 years ago

The easiest workaround for this issue I found is to replace the CollectionView with a ListView in the App.xaml Control Template:

                                                       ...

This issue looks for me like the same I encountered earlier, if a CollectionView is not wrapped in a RefreshView, it will not show anything in UWP when the page is Initialized.

Great find @MichaelStgt thanks! So either make it a ListView or wrap it in a RefreshView then?

jfversluis commented 3 years ago

Wrapping in a RefreshView doesn't seem to work. Making it a ListView does seem to show the thing but causes some other issues. Thanks though, this seems workable!

jfversluis commented 3 years ago

Turns out the workaround was here all along... 😅

Workaround Change the CollectionView to ListView.

Got it working with the ListView, but yeah WPF and GTK still nothing because of the templates...

jfversluis commented 2 years ago

WPF has support for ControlTemplates as of the next service release for Forms 🎉