Bug 53381 - Templated views no longer rendering (as of pre3)
Summary: Templated views no longer rendering (as of pre3)
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms (show other bugs)
Version: 2.3.4
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Stephane Delcroix
URL:
Depends on:
Blocks:
 
Reported: 2017-03-16 08:42 UTC by Philipp Sumi
Modified: 2017-04-01 12:44 UTC (History)
5 users (show)

Tags: bug, ios, android, uwp, controltemplate, ac
Is this bug a regression?: Yes
Last known good build: 2.3.4-pre2


Attachments
repro project (294.07 KB, application/x-zip-compressed)
2017-03-17 17:55 UTC, Jimmy [MSFT]
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 FIXED

Description Philipp Sumi 2017-03-16 08:42:47 UTC
Upgrading from pre2 to pre5 (or pre3) causes my UI not to be rendered again on both Android and iOS.

My view's contents were wrapped in a custom control that I use to display overlays, like this:

    <MyWrapper>
        <!-- rendered screen contents -->
        <Grid x:Name="LayoutRoot">
            ...
        </Grid>
    </MyWrapper>


The wrapper control inherits ContentView, and is rendered through a control template. As of pre3, the content of my wrapper is no longer rendered. As a result, I'm ending up with just a blank page.


I reduced the control template to this as a repro:

        <ControlTemplate x:Key="MyWrapperTemplate">
            <StackLayout>
                <!-- this should render the contents of my wrapper control -->
                <ContentPresenter  />
            </StackLayout>
        </ControlTemplate>


        <Style TargetType="controls:MyWrapper">
            <Setter Property="ControlTemplate" Value="{DynamicResource MyWrapperTemplate}" />
        </Style>


And this results in just an empty screen, because the ContentPresenter didn't render anything. Adding other controls than the ContentPresenter to the StackLayout in the control template above causes those to be rendered. It's really just the ContentPresenter.
Comment 1 Jimmy [MSFT] 2017-03-17 17:55:17 UTC
Created attachment 20443 [details]
repro project

I was able to reproduce this issue with the project I am attaching. This is occurring on iOS, Android, and UWP with Forms 2.3.4-pre5. On UWP the issue is worse in that entire control template is not rendered, not just the ContentPresenter. 

This also appears to be a regression in the recent 2.3.4 pre-releases. I am confirming this bug so the team can investigate further.


### Regression Test
2.3.4-pre5  BAD
2.3.4-pre2  GOOD
2.3.3.193   GOOD
Comment 2 Samantha Houts [MSFT] 2017-03-29 18:46:31 UTC
Should be fixed in 2.3.4=pre6. Thank you!

https://github.com/xamarin/Xamarin.Forms/pull/831
Comment 3 Philipp Sumi 2017-04-01 12:44:27 UTC
Hi Samantha and Jimmy

Thanks for the note! I can't verify unfortunately, since the CarouselView still crahes with DivideByZeroException on pre6. See here:
https://bugzilla.xamarin.com/show_bug.cgi?id=53382

Any word on this, btw? I'm stuck on pre2 still. This is starting to make me really nervous, also because I can't test the new releases anymore.