Bug 44973 - UWP label disappeared in ListView if update from view model (resize window will show again)
Summary: UWP label disappeared in ListView if update from view model (resize window wi...
Status: RESOLVED DUPLICATE of bug 40139
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms (show other bugs)
Version: 2.3.4
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-10-03 10:19 UTC by Mike
Modified: 2017-07-08 18:40 UTC (History)
16 users (show)

Tags: AC
Is this bug a regression?: ---
Last known good build:


Attachments
Sample application (84.85 KB, application/x-rar)
2016-10-03 10:19 UTC, Mike
Details
Screenshot (55.71 KB, application/x-rar)
2016-10-03 10:21 UTC, Mike
Details
Labels gone after pressing ALT key (XF 2.3.4.247, UWP Win10 15063.296)) (21.85 KB, application/x-rar)
2017-06-12 18:56 UTC, Manuel
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 40139

Description Mike 2016-10-03 10:19:58 UTC
Created attachment 17844 [details]
Sample application

I have some Label in My ListViewItem.

There is a lot of product info in every List view item.  That looks like :

Product Name             Price             Count

Now I want to add 2 button for every row, if user click right side, the count will increase, if user click left side the count will decrease. For example:


Football          $10      0

I click right side of the row, I want to this result:

Football          $10      1

But currently result is:

Football          $10       

The count just disappeared, until I click the window border resize the window, and then the count label will render again.




I have too much that kind of problem, that's too series for me.  I really don't know Is there anyone using Xamarin.Forms on UWP in here, because that mistake too basic and cause too much problem. 


I also upload 2 attachment.  one is an example application, another one is a screenshot.
Comment 1 Mike 2016-10-03 10:21:21 UTC
Created attachment 17845 [details]
Screenshot
Comment 2 Andreas 2016-10-05 09:49:16 UTC
I have similiar problem. If having a label insida an absolute lautou, then updating the label text, the label dissappears...
Comment 3 Mike 2016-10-05 13:24:49 UTC
A disabled Entry cause same problem.
Comment 4 Mike 2016-10-11 15:20:18 UTC
A disabled Entry worked. But the label still not.  So I think someone should test that and confirm.
Comment 5 Matti Autio 2017-01-03 09:30:21 UTC
I have also similar problem. If I have a label inside StackLayout then the label text not updated and the label disappears so long that you resize the window.
Comment 6 Mike 2017-01-03 11:21:02 UTC
I replace the ListView to TemplateView, and all fine, looks like the problem is from ListView.
Comment 7 Rhussell 2017-01-17 16:37:50 UTC
In Windows 10,  right click desktop and select "Next desktop background" in the context menu, all labels in first listview will disappear. 

Here's the demo code.
/////////////////////
using System.Collections.Generic;
using Xamarin.Forms;

namespace Demo
{
    public class DemoPage : ContentPage
    {
        public DemoPage()
        {
            Content = new StackLayout
            {
                Orientation = StackOrientation.Vertical,
                Children =
                {
                    ListViewThatTextWillDisappearAfterChangeDesktopBackgroud,
                    ListViewThatWorksFine
                }
            };
        }

        private ListView ListViewThatTextWillDisappearAfterChangeDesktopBackgroud
        {
            get
            {
                var viewCellTemplate = new DataTemplate(() =>
                {
                    var label = new Label();
                    label.SetBinding(Label.TextProperty, ".");
                    return new ViewCell {View = label};
                });

                var listView = new ListView
                {
                    ItemTemplate = viewCellTemplate
                };

                listView.SetBinding(ListView.ItemsSourceProperty, nameof(Items));

                return listView;
            }
        }

        private ListView ListViewThatWorksFine
        {
            get
            {
                var textCellTemplate = new DataTemplate(() =>
                {
                    var cell = new TextCell();
                    cell.SetBinding(TextCell.TextProperty, ".");
                    return cell;
                });

                var listView = new ListView
                {
                    ItemTemplate = textCellTemplate
                };

                listView.SetBinding(ListView.ItemsSourceProperty, nameof(Items));

                return listView;
            }
        }

        private List<string> Items => new List<string>
        {
            "1st item",
            "2nd item",
            "3rd item"
        };
    }
}
Comment 8 David 2017-01-18 03:00:48 UTC
This is a serious bug. Most ListViews will have labels in them, and they are the most likely things to be updated. The only work around I have found is to use an ObservableCollection as the ItemSource and to replace any updated items directly in the collection, causing the list to be refreshed, however this causes flicker as the list is updated.

I have also noticed a similar effect, when altering the visibility of a View in a ViewCell Template in a ListView. For example, if the ViewCell contains a BoxView and its IsVisible property is bound to a bool in the ItemSource, then changing the bool value results in the BoxView always disappearing irrespective of the bool value, however if Opacity is bound via a ValueConverter, then the Opacity is altered correctly, so its not a case of any property being altered exhibiting the bug, just some. The two effects could be related. I will take a look through the XF source code when I have time.

The issue identified by @Rhussell is another problem (it is probably related) which has its own bug report: https://bugzilla.xamarin.com/show_bug.cgi?id=48428. This is an even more serious issue as it makes XF UWP apps unusable.
Comment 9 Keith Rome 2017-02-26 04:10:01 UTC
Adding a slight bit of extra info that might help troubleshoot -

When using the Live View Inspector of Visual Studio 2015, selecting any Label control (directly or by selecting the element's node in the Inspector window) will also cause the Label to disappear.
Comment 10 Jacob Ebey 2017-03-15 20:55:10 UTC
Has this been addressed or looked into? This is a SERIOUS issue. If there has been investigation, what were the findings?
Comment 11 Anonymous 2017-03-25 15:33:13 UTC
Just want to say that I, too, am affected by this, and that this is indeed a fairly serious issue. I'm using XF 2.3.4.214-pre5.
Comment 12 opantm2+git 2017-04-10 20:17:52 UTC
This is seriously ridiculous. This is a bug that completely prevents Xamarin Forms from being even remotely usable on UWP, yet hasn't even had a mention in the half a year since it's been reported. If Xamarin wants to claim that they actually support a platform, it would be nice to have the most basic functionality be supported.

I tried Xamarin Forms in a different app after not using it for a few months due to bugs, hoping maybe it improved. Clearly that was a mistake.
Comment 13 dpedrinha 2017-04-12 07:35:18 UTC
Same problem.
And the bug report I filled that was taken as FIXED disappeared... Interesting huh?
Comment 14 E.Z. Hart [MSFT] 2017-04-12 15:47:49 UTC

*** This bug has been marked as a duplicate of bug 40139 ***
Comment 15 E.Z. Hart [MSFT] 2017-04-12 15:56:10 UTC
This should be fixed in 2.3.5-pre1. If you want to see the fix before the next release, you can try the nightly builds: https://blog.xamarin.com/try-the-latest-in-xamarin-forms-with-nightly-builds/
Comment 16 dpedrinha 2017-04-13 17:32:30 UTC
Seems to work.
Comment 17 opantm2+git 2017-04-13 20:06:10 UTC
Awesome, the new prerelease does fix it.
Comment 18 Manuel 2017-06-12 18:51:57 UTC
FYI, I am getting the same issue with 2.3.4.247. 

I have a ListView in MasterDetailPage which gets populated with ItemsSource via DataBinding and as soon as I hit ALT key (left or right), all labels are gone.
Comment 19 Manuel 2017-06-12 18:56:41 UTC
Created attachment 22838 [details]
Labels gone after pressing ALT key (XF 2.3.4.247, UWP Win10 15063.296))

The XAML view having the issue along with screenshots
Comment 20 Shimmy 2017-07-06 05:43:28 UTC
Same here.

All labels inside ListViews disappear when pressing ALT.
UWP Win10, XF 2.3.4.247.

Breaking issue!
Comment 21 E.Z. Hart [MSFT] 2017-07-08 01:01:51 UTC
(In reply to Manuel from comment #18)
> FYI, I am getting the same issue with 2.3.4.247. 
> 
> I have a ListView in MasterDetailPage which gets populated with ItemsSource
> via DataBinding and as soon as I hit ALT key (left or right), all labels are
> gone.

Manuel,

This appears to be a different bug than the original - can you please open a new Bugzilla case and add your attachment to it? 

Thanks.
Comment 22 Shimmy 2017-07-08 18:40:46 UTC
@E.Z. Hart,

This bug has been posted separately here:
https://bugzilla.xamarin.com/show_bug.cgi?id=57432