Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Evolution] Add RetainsRenderer option for page, improve page performance #647

Closed
wants to merge 30 commits into from

Conversation

@huangjinshe
Copy link

commented Dec 15, 2016

Description of Change

The feature based on ACCEPTED - Configurable retention of ContentPage renderers, I've had update my old code from Pull634.

Currently I improve performance only for UWP, improve performance of page types:
ContentPage, NavigationPage, MasterDetailPage in these situations:


App.MainPage = page;
Navigation.Push(page);
MasterDetailPage.Detail = page;

I need other developers help add other platform or other page types.

API Changes

Added:

RetainsRendererExtentions class in Xamarin.Forms.Core:

namespace Xamarin.Forms
{
    public static class RetainsRendererExtentions
    {
        public static Xamarin.Forms.Page SetRetainsRendererValue(this Xamarin.Forms.Page page, bool value)
        {
            SetRetainsRenderer(page, value);
            return page;
        }

        public static bool GetRetainsRendererValue(this Xamarin.Forms.Page page)
        {
            return GetRetainsRenderer(page);
        }


        public static readonly BindableProperty RetainsRendererProperty = BindableProperty.CreateAttached("RetainsRenderer", typeof(bool), typeof(RetainsRendererExtentions), false);

        public static bool GetRetainsRenderer(BindableObject view)
        {
            return (bool)view.GetValue(RetainsRendererExtentions.RetainsRendererProperty);
        }

        public static void SetRetainsRenderer(BindableObject view, bool value)
        {
            view.SetValue(RetainsRendererExtentions.RetainsRendererProperty, value);
        }
    }

}

For access or change it in code:

anyPage.SetRetainsRendererValue(true);
bool value = anypage.GetRetainsRendererValue();

For access or change it in XAML:
xmlns:forms="clr-namespace:Xamarin.Forms;assembly=Xamarin.Forms.Core" forms:RetainsRendererExtentions.RetainsRenderer="False"




### PR Checklist ###

- [ ] Has tests (if omitted, state reason in description)
- [ ] Rebased on top of master at time of PR
- [ ] Changes adhere to coding standard
- [ ] Consolidate commits as makes sense
huangjinshe added 9 commits Dec 10, 2016
Fix navigate or switch exist page slow problem and lost page last sta…
…te problem

When we navigate to some page and navigate to other page and back or
switch exist Details page, or change App.MainPage to exist page, the
page last state fill lost, like ScrollViewer, and also the
navigate/switch speed still very slow. This will fix that problem.
(Note: Navigate animation can't use currently after apply this, but I
think temporarity it's fine, the navigate animation too ugly, I think no
one will use animation for now)
Fix bug: SEHException
This bug will cause : System.Runtime.InteropServices.SEHException
Fix when phone orientation changed, the page not display correctly
Because the new design, sometimes when the phone changed the
orientation, the last page and currently page will display together,
also the width and height not recalculate again.
Another orientation change fix
I don't know why, but every time phone orientation changed to Landscape
mode, after changed to another exist page, use:
App.MainPage = exist page;   but the width not current, So we need
layout it every time switch pages.
Fix when Master split panel close the content not resize
Fix When the split not displayed, the content width not calculate back.
Navigate back and Master Split Button not show problem on UWP
In this, I fixed when App.MainPage = old exist navigation page, the back
button will not show.

Also I fixed when on UWP desktop version the Master split button not
display problem.
@dnfclas

This comment has been minimized.

Copy link

commented Dec 15, 2016

Hi @huangjinshe, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

The agreement was validated by .NET Foundation and real humans are currently evaluating your PR.

TTYL, DNFBOT;

@huangjinshe huangjinshe changed the title Add RetainsRenderer property for page, improve page performance Add RetainsRenderer option for page, improve page performance Dec 15, 2016

huangjinshe and others added 8 commits Dec 21, 2016
Merge remote-tracking branch 'refs/remotes/xamarin/master'
# Conflicts:
#	Xamarin.Forms.Platform.WinRT/Platform.cs
Merge remote-tracking branch 'xamarin/XmlnsUsing'
# Conflicts:
#	Xamarin.Forms.Core/VisualElement.cs
#	Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
#	Xamarin.Forms.Platform.UAP/MasterDetailControl.cs
#	Xamarin.Forms.Platform.UAP/MasterDetailControlStyle.xaml
#	Xamarin.Forms.Platform.UAP/MasterDetailPageRenderer.cs
#	Xamarin.Forms.Platform.WinRT/NavigationPageRenderer.cs
#	Xamarin.Forms.Platform.WinRT/Platform.cs

@huangjinshe huangjinshe force-pushed the huangjinshe:master branch from 82234a1 to ed6cc13 Apr 3, 2017

@hartez hartez self-assigned this May 2, 2017

@samhouts samhouts changed the title Add RetainsRenderer option for page, improve page performance [Evolution] Add RetainsRenderer option for page, improve page performance Aug 23, 2017

@rmarinho

This comment has been minimized.

Copy link
Member

commented Dec 6, 2017

Hi @huangjinshe we are now ready to go ahead with this feature. do you mind rebase with master so we can run UITests ?

Thanks

@huangjinshe

This comment has been minimized.

Copy link
Author

commented Dec 6, 2017

Hi @rmarinho , I'm really sorry I'm too much busy for another business right now, also after this half year I don't know what is going on in Xamarin of UWP version, could you guys let some Xamarin developer do this job please? he could contact with me any time for any discussion.

@huangjinshe

This comment has been minimized.

Copy link
Author

commented Dec 6, 2017

I think currently there will be too much conflicting files, I worry if don't take some times to merge and check, It will affect other feature.

@pauldipietro

This comment has been minimized.

Copy link
Member

commented Dec 6, 2017

We'll revisit this PR when we can assign someone from the Forms team.

@hartez hartez removed their assignment Dec 6, 2017

@huangjinshe

This comment has been minimized.

Copy link
Author

commented Dec 6, 2017

@pauldipietro .Sure, but I think this is a huge performance problem, I hope you guys more serious on it.

@samhouts samhouts modified the milestone: 2.3.0 Jun 27, 2018

@samhouts samhouts modified the milestone: 3.2.0 Sep 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.