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

Adds UWP support to Shell #6015

Merged
merged 48 commits into from Sep 17, 2019

Conversation

@dotMorten
Copy link
Contributor

commented Apr 26, 2019

This is a replacement PR of #5936 (I messed up the rebase). There's some good discussions in that PR though.

Description of Change

This is the first stab at adding UWP renderers for Shell

Issues Resolved

#2415

API Changes

public class ShellRenderer : NavigationView, IVisualElementRenderer, IAppearanceObserver, IFlyoutBehaviorObserver
{
   public ShellRenderer();
   protected internal Shell Element { get; private set; }
   protected virtual void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e);
   protected virtual void OnElementSet(Shell shell);   
}
[EditorBrowsable(EditorBrowsableState.Never)]
public sealed class ShellSectionRenderer : NavigationView, IAppearanceObserver
{
}
public class ToolbarItemRenderer : Windows.UI.Xaml.Controls.Button
{
	public ToolbarItemRenderer();
	public ToolbarItem ToolbarItem { get; set; }
	public static readonly DependencyProperty ToolbarItemProperty;
}
public static class PageExtensions
{
   // Added overload that allows specifying the page transition animation
   public static bool Navigate(this Windows.UI.Xaml.Controls.Frame frame, ContentPage page, Windows.UI.Xaml.Media.Animation.NavigationTransitionInfo infoOverride);
}

Known issues while it's a draft-PR:

  • 1. Navigation isn't working fully working.
  • 2. Only FileImageSource are supported for icons (limitation of NavigationViewItem and AppBarItem - considering to use a different kind) Also see issue microsoft/microsoft-ui-xaml#601
  • 3. Release builds fail to render the side pane (this one got me stumped, as no errors are reported - it's just completely missing anything but the contents from the visual tree)
  • 4. Toolbar not implemented

It might be worth considering adding the WinUI dependency. This would mean 16299 can be continued to be used, but it does require one extra setup step to add a theme resource to App.xaml, as well as adding the dependency. In the future though, this library is where all new UWP components will be added, so sooner or later that's going to happen anyway.

Platforms Affected

  • UWP

Behavioral/Visual Changes

None

Before/After Screenshots

Before:
image

After (Gastropods, Default Shell Template, Xappy):

Shell_3apps_gif

Note:

  • Gallery app is dependent on this PR: #6000
  • Back navigation is also dependent on #5933 (merged into 4.0.0 branch but not yet in Master)

Testing Procedure

Use @davidortinau's Gastropods sample. It seems fully functional from what I can tell.
You can also use this repo: https://github.com/dotMorten/Xamarin.Forms.UWPShell.Sample
(the sub-module points to this PR) which includes 3 different Shell samples, as well as the gallery sample.

PR Checklist

  • Has automated tests
  • Rebased on top of the target branch at time of PR
  • Changes adhere to coding standard
@dotMorten dotMorten referenced this pull request Apr 26, 2019
0 of 7 tasks complete
@dotMorten

This comment has been minimized.

Copy link
Contributor Author

commented Apr 26, 2019

Not everything in the gallery sample app works. List below screenshot of progress so far.
To run, clone the repo https://github.com/dotMorten/Xamarin.Forms.UWPShell.Sample including the submodule and run the ShellSample.UWP project. Click Controls Gallery then SwapRoot - Store Shell.

If you want to help out, I'd like help with the below unchecked items.

image

Checked = it is working, message after with issue if it's not

  • Push Navigates, but navigation is different from Android

  • Pop

  • Pop to root

  • Insert

  • Remove

  • Add Search

  • Add Toolbar

  • Remove Toolbar

  • Remove Search

  • Add Tab

  • Remove Tab

  • Hide Tabs

  • Show Tabs

  • Hide Nav (thanks to @NicoVermeir)

  • Show Nav (thanks to @NicoVermeir)

  • Hide Search

  • Collapse Search Implementation handles this event, no OOB feature to expand/collapse (see microsoft/microsoft-ui-xaml#81))

  • Show Search

  • Set Back No-op

  • Clear Back No-op

  • Disable Tab No-op

  • Enable Tab No-op

  • Enable Search

  • Disable Search

  • Set Title

  • Set Tab Title No-op

  • Set Group Title No-op

  • New Tab Icon No-op

  • Flyout Disabled Flyout behavior change detected but value is always FlyOut - however Android does this too, so probably Shell bug in general)

  • Flyout Collapse See above

  • Flyout Locked See above

  • Add TitleView No-op

  • Null TitleView No-op

  • FH Fixed No-op

  • FH Scroll No-op

  • FH Collapse No-op

  • Add TopTab

  • Remove TopTab

  • Nav Visible Checkbox No-op

  • Tab Visible Checkbox No-op

  • Push Special

  • Show Alert

  • Navigate to 'demo' route

  • Go Back with Text

  • Navigate to [textbox] GO!

@samhouts samhouts added this to In Review in v4.1.0 Apr 26, 2019

@dotMorten dotMorten marked this pull request as ready for review Apr 29, 2019

@samhouts samhouts requested review from paymicro and rmarinho Apr 29, 2019

@dotMorten dotMorten referenced this pull request May 5, 2019
22 of 26 tasks complete

@samhouts samhouts added this to In Review in vCurrent (4.2.0) May 29, 2019

@samhouts samhouts removed this from In Review in v4.1.0 May 29, 2019

@mzhukovs

This comment has been minimized.

Copy link

commented Jun 6, 2019

Really glad to see that someone is making the effort to support to UWP, and I am sure many others are as well. Just wondering if there is any sense of when this would make it into a preview/release?

@dotMorten

This comment has been minimized.

Copy link
Contributor Author

commented Jun 6, 2019

We're hoping to do a live-streamed code-review next week

@dgerding

This comment has been minimized.

Copy link

commented Jun 11, 2019

Any updates? Really at a WAIT AND SEE attitude with Xamarin Forms until there is equal ground development footing for Windows platforms (UWP) alongside XF iOS and XF Android.

@sharpwood

This comment has been minimized.

Copy link

commented Jun 13, 2019

When can this project update this feature to the visual studio template?

@dotMorten

This comment has been minimized.

Copy link
Contributor Author

commented Jun 13, 2019

@dgerding sorry we're a little delayed. I'm overwhelmed and hard to find common time do the PR Review.
@sharpwood first it'll have to be merged, then probably a few more fixes here and there (this PR gets us ~80% there). I'm assuming you won't see it in the template until after this ships in a real release, but you can easily add it yourself afterwards.

@samhouts samhouts removed the request for review from paymicro Jun 17, 2019

@Spookenator

This comment has been minimized.

Copy link

commented Jun 27, 2019

Hey guys! Wondering what the status of this is.
Really excited about using the shell in UWP.

@SebastianKruseWago

This comment has been minimized.

Copy link

commented Jun 28, 2019

Is there any ETA for Shell in UWP?

@dotMorten

This comment has been minimized.

Copy link
Contributor Author

commented Jun 28, 2019

I'm sorry this haven't moved faster. I hit some regressions when syncing up with master, and I've been completely swamped with work and family-related stuff, so just haven't had much time to really sit down and try and address it. However I'm more than happy to take PRs for my branch.

@PureWeen PureWeen force-pushed the dotMorten:uwp-shell-2 branch from 59123df to be4397a Sep 13, 2019

@PureWeen PureWeen changed the base branch from master to 4.3.0 Sep 13, 2019

@PureWeen

This comment has been minimized.

Copy link
Contributor

commented Sep 13, 2019

@dotMorten Because I set that up to load from code based on your suggestion :-)

Windows.UI.Xaml.Application.Current.Resources.MergedDictionaries.Add(new Microsoft.UI.Xaml.Controls.XamlControlsResources());

@PureWeen

This comment has been minimized.

Copy link
Contributor

commented Sep 13, 2019

force pushed and rebased to 4.3.0

@dotMorten

This comment has been minimized.

Copy link
Contributor Author

commented Sep 13, 2019

based on your suggestion :-)

My memory sucks apparently. At least I still have good ideas :)

@dgerding

This comment has been minimized.

Copy link

commented Sep 13, 2019

@dotMorten dotMorten requested a review from StephaneDelcroix as a code owner Sep 13, 2019

@samhouts samhouts removed this from In Progress in vNext+1 (master) Sep 13, 2019

@samhouts samhouts added this to In Progress in vNext (4.3.0) Sep 13, 2019

@dotMorten
Copy link
Contributor Author

left a comment

Ugh! My dirty laundry!

@rmarinho
Copy link
Member

left a comment

A couple of small changes, it works fine locally.

Xamarin.Forms.Platform.UAP/PageExtensions.cs Outdated Show resolved Hide resolved
Xamarin.Forms.Platform.UAP/Shell/ShellRenderer.cs Outdated Show resolved Hide resolved
Xamarin.Forms.Platform.UAP/Shell/ShellRenderer.cs Outdated Show resolved Hide resolved
Xamarin.Forms.Platform.UAP/Shell/ShellRenderer.cs Outdated Show resolved Hide resolved

vNext (4.3.0) automation moved this from In Progress to In Review Sep 16, 2019

@samhouts samhouts moved this from In Review to In Progress in vNext (4.3.0) Sep 16, 2019

@PureWeen PureWeen requested a review from rmarinho Sep 16, 2019

@rmarinho rmarinho merged commit aeafec9 into xamarin:4.3.0 Sep 17, 2019

9 of 15 checks passed

DROID-API27-FR-ISSUES uitests
Details
iOS11-ISSUES uitests
Details
iOS12-ISSUES uitests
Details
xamarin-forms-uitests xamarin-forms-uitests failed
Details
DROID-API19-FR-ISSUES uitests
Details
DROID-API19-LR-ISSUES uitests
Details
DROID-API19-FR uitests
Details
DROID-API19-LR uitests
Details
DROID-API27-FR uitests
Details
DROID-API27-LR uitests
Details
DROID-API27-LR-ISSUES uitests
Details
iOS11 uitests
Details
iOS12 uitests
Details
license/cla All CLA requirements met.
Details
xamarin-forms-ci #4.3.0.2530+0-pr.6015-sha.0b608b95-azdo.7115 succeeded
Details

vNext (4.3.0) automation moved this from In Progress to Done Sep 17, 2019

@dotMorten

This comment has been minimized.

Copy link
Contributor Author

commented Sep 17, 2019

image

@samhouts samhouts added this to the 4.3.0 milestone Sep 18, 2019

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