Open uwantfries opened 6 years ago
Repo attached.
Launch the app. Click on the the Step 2 button a couple of times + back to see it work Click on Step 1 - wait for 7 seconds for the iOS modal to appear, the iOS embedded XF page to appear and disappear and the custom page to pop Click in Step 2 - Crash. TestGitIssue3865.zip
Looks like this has been known about for a while :(
FROM https://forums.xamarin.com/discussion/comment/285749/#Comment_285749
... Moreover, it still seems strange that I get exceptions (related to not being able to resolve a color resource from StaticResources) if I try to use new MyPage().CreateViewController() a second time.
DavidOrtinau DavidOrtinau July 2017 Thanks @ChrisBoyd.
StaticResources definitely needs work. Good feedback on the expected behavior of Page and the native view.
Reproduction throws an exception as described.
I guess that App.Current isn't set...
Description
When moving from XF Page > Native Custom page Renderer > Ebedded XF in native renderer XF cannot find App level style declarations.
I have arrived at this as my XF forms app opens a modal page with a custom native PDF renderer but we want the PDF renderer to be able to open additional docs (for which we have XF code and UI for)
After reading about Embedding here https://github.com/davidortinau/build2017-new-in-xamarin-forms I thought that I could display a XF page using the following code in the iOS renderer
var page = new MeetingDocListRelatedView(); relatedDocsVC = page.CreateViewController(); relatedDocsVC.ModalPresentationStyle = UIModalPresentationStyle.FormSheet; PresentModalViewController(relatedDocsVC, true);
Any XF pages that use global styles cannot be loaded as you get runtime errors about missing styles. If you add the styles or load a content page with no global styles; you can load and use the XF page but then returning out of the custom renderer to the xamarin forms page any subsequent pages that normally work using App level styles will fail with runtime errors about missing styles
Steps to Reproduce
Create an XForms app that launches a modal page with a custom page renderer
Make a custom native renderer that uses the following code to display another XF page var page = new MeetingDocListRelatedView(); relatedDocsVC = page.CreateViewController(); relatedDocsVC.ModalPresentationStyle = UIModalPresentationStyle.FormSheet; PresentModalViewController(relatedDocsVC, true);
Exit the XF Page back to the native page
Exit the Native renderer page back to the 1st page
Try to load another XF page from the 1st page
Expected Behavior
Everything works fine and all XF pages can see the global styles
Actual Behavior
A page with App styles or subsequent pages using App styles fail with a style not found error once an XF page has been shown by embedding.
Basic Information
Installed Version: Enterprise
Visual C++ 2017 00369-60000-00001-AA928 Microsoft Visual C++ 2017
Application Insights Tools for Visual Studio Package 8.13.10627.1 Application Insights Tools for Visual Studio
ASP.NET and Web Tools 2017 15.8.05085.0 ASP.NET and Web Tools 2017
ASP.NET Core Razor Language Services 15.8.31590 Provides languages services for ASP.NET Core Razor.
ASP.NET Web Frameworks and Tools 2017 5.2.60618.0 For additional information, visit https://www.asp.net/
Azure App Service Tools v3.0.0 15.8.05023.0 Azure App Service Tools v3.0.0
C# Tools 2.9.0-beta8-63208-01 C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
CleanCommand Extension 1.0 CleanCommand Visual Studio Extension Detailed Info
Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
Extensibility Message Bus 1.1.49 (remotes/origin/d15-8@ee674f3) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.
GorillaPlayerPackage Extension 1.0 GorillaPlayerPackage Visual Studio Extension Detailed Info
JavaScript Language Service 2.0 JavaScript Language Service
JavaScript Project System 2.0 JavaScript Project System
Microsoft Azure Tools 2.9 Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.10730.2
Microsoft Continuous Delivery Tools for Visual Studio 0.4 Simplifying the configuration of continuous build integration and continuous build delivery from within the Visual Studio IDE.
Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Microsoft Library Manager 1.0 Install client-side libraries easily to any web project
Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers
Microsoft Visual C++ Wizards 1.0 Microsoft Visual C++ Wizards
Microsoft Visual Studio Tools for Containers 1.1 Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.
Microsoft Visual Studio VC Package 1.0 Microsoft Visual Studio VC Package
MLGen Package Extension 1.0 MLGen Package Visual Studio Extension Detailed Info
Mono Debugging for Visual Studio 4.11.8-pre (009db7d) Support for debugging Mono processes with Visual Studio.
NuGet Package Manager 4.6.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.
Office Developer Tools for Visual Studio 2017 ENU 15.0.27907.01 Microsoft Office Developer Tools for Visual Studio 2017 ENU
ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info
ResourcePackage Extension 1.0 ResourcePackage Visual Studio Extension Detailed Info
ResourcePackage Extension 1.0 ResourcePackage Visual Studio Extension Detailed Info
Snapshot Debugging Extension 1.0 Snapshot Debugging Visual Studio Extension Detailed Info
SQL Server Data Tools 15.1.61808.07020 Microsoft SQL Server Data Tools
Syncfusion UWP Project Templates 16.2.0.41 Project to create an Universal Windows Application using Syncfusion Products.
Syncfusion Xamarin Project Templates 16.2.0.41 A multi-project template for building iOS, Android, and Windows apps using Syncfusion Xamarin components.
Syncfusion Xamarin Toolbox 16.2.0.41 Syncfusion Essential Studio for Xamarin Toolbox Visual Studio extension.
Syncfusion.VSExtension.Troubleshooter 16.2.0.41 Add-in for Troubleshooting the Syncfusion projects.
TypeScript Tools 15.8.20801.2001 TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 2.9.0-beta8-63208-01 Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 10.2 for F# 4.5 15.8.0.0. Commit Hash: c55dd2c3d618eb93a8d16e503947342b1fa93556. Microsoft Visual F# Tools 10.2 for F# 4.5
Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
Visual Studio Tools for Containers 1.0 Visual Studio Tools for Containers
Visual Studio Tools for Universal Windows Apps 15.0.28010.00 The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.
VisualStudio.Mac 1.0 Mac Extension for Visual Studio
Workflow Manager Tools 1.0 1.0 This package contains the necessary Visual Studio integration components for Workflow Manager.
Xamarin 4.11.0.756 (d15-8@b66ff7180) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer 4.14.221 (a73ca07f7) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin Templates 1.1.116 (9619170) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.
Xamarin.Android SDK 9.0.0.19 (HEAD/a8a3b0ec7) Xamarin.Android Reference Assemblies and MSBuild support.
Xamarin.iOS and Xamarin.Mac SDK 11.14.0.13 (373c313) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Screenshots
Reproduction Link