summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls
diff options
context:
space:
mode:
authorSamantha Houts <samantha@teamredwall.com>2016-10-06 10:17:51 -0700
committerJason Smith <jason.smith@xamarin.com>2016-10-06 10:17:51 -0700
commitba6caad23ed7abdb1661cc61114c24eb3ae09da1 (patch)
treeb37f5e071b8e73cee49a56d53483b6600fb819c9 /Xamarin.Forms.Controls
parent5727172ba8bb98391e023f208b747e6f193e8693 (diff)
downloadxamarin-forms-ba6caad23ed7abdb1661cc61114c24eb3ae09da1.tar.gz
xamarin-forms-ba6caad23ed7abdb1661cc61114c24eb3ae09da1.tar.bz2
xamarin-forms-ba6caad23ed7abdb1661cc61114c24eb3ae09da1.zip
[A] Prevent blank page from appearing when MainPage is switched (#421)
* repro * [A]Add horrible hack to prevent background flashing when swapping MainPage * cleanup repro * Revert "[A]Add horrible hack to prevent background flashing when swapping MainPage" This reverts commit d0fdc3856d0eaa5ec781f790d524ad7624a26560. * [A] E.Z.'s less magical but just as effective solution
Diffstat (limited to 'Xamarin.Forms.Controls')
-rw-r--r--Xamarin.Forms.Controls/App.cs13
-rw-r--r--Xamarin.Forms.Controls/Bugzilla44596SplashPage.cs25
-rw-r--r--Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj3
3 files changed, 40 insertions, 1 deletions
diff --git a/Xamarin.Forms.Controls/App.cs b/Xamarin.Forms.Controls/App.cs
index c6480040..3af36ee3 100644
--- a/Xamarin.Forms.Controls/App.cs
+++ b/Xamarin.Forms.Controls/App.cs
@@ -8,6 +8,7 @@ using Xamarin.Forms.PlatformConfiguration.WindowsSpecific;
namespace Xamarin.Forms.Controls
{
+
public class App : Application
{
public const string AppName = "XamarinFormsControls";
@@ -31,6 +32,18 @@ namespace Xamarin.Forms.Controls
Master = new ContentPage { Title = "Master", BackgroundColor = Color.Red },
Detail = CoreGallery.GetMainPage()
};
+
+ //// Uncomment to verify that there is no gray screen displayed between the blue splash and red MasterDetailPage.
+ //MainPage = new Bugzilla44596SplashPage(() =>
+ //{
+ // var newTabbedPage = new TabbedPage();
+ // newTabbedPage.Children.Add(new ContentPage { BackgroundColor = Color.Red, Content = new Label { Text = "yay" } });
+ // MainPage = new MasterDetailPage
+ // {
+ // Master = new ContentPage { Title = "Master", BackgroundColor = Color.Red },
+ // Detail = newTabbedPage
+ // };
+ //});
}
protected override void OnAppLinkRequestReceived(Uri uri)
diff --git a/Xamarin.Forms.Controls/Bugzilla44596SplashPage.cs b/Xamarin.Forms.Controls/Bugzilla44596SplashPage.cs
new file mode 100644
index 00000000..ba7cdc46
--- /dev/null
+++ b/Xamarin.Forms.Controls/Bugzilla44596SplashPage.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Threading.Tasks;
+
+namespace Xamarin.Forms.Controls
+{
+ public class Bugzilla44596SplashPage : ContentPage
+ {
+ Action FinishedLoading { get; set; }
+
+
+ public Bugzilla44596SplashPage(Action finishedLoading)
+ {
+ BackgroundColor = Color.Blue;
+ FinishedLoading = finishedLoading;
+ }
+
+
+ protected async override void OnAppearing()
+ {
+ base.OnAppearing();
+ await Task.Delay(2000);
+ FinishedLoading?.Invoke();
+ }
+ }
+}
diff --git a/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj b/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj
index 200e5f8a..b85020ba 100644
--- a/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj
+++ b/Xamarin.Forms.Controls/Xamarin.Forms.Controls.csproj
@@ -84,6 +84,7 @@
<ItemGroup>
<Compile Include="App.cs" />
<Compile Include="AppLifeCycle.cs" />
+ <Compile Include="Bugzilla44596SplashPage.cs" />
<Compile Include="ControlGalleryPages\CellForceUpdateSizeGalleryPage.cs" />
<Compile Include="ControlGalleryPages\LayoutAddPerformance.xaml.cs">
<DependentUpon>LayoutAddPerformance.xaml</DependentUpon>
@@ -312,4 +313,4 @@
<Copy SourceFiles="@(ConfigFile)" DestinationFiles="controlgallery.config" Condition="!Exists('controlgallery.config')" />
</Target>
<Import Project="..\packages\Xamarin.Insights.1.12.3\build\portable-win+net45+wp80+windows8+wpa+MonoAndroid10+MonoTouch10\Xamarin.Insights.targets" Condition="Exists('..\packages\Xamarin.Insights.1.12.3\build\portable-win+net45+wp80+windows8+wpa+MonoAndroid10+MonoTouch10\Xamarin.Insights.targets')" />
-</Project>
+</Project> \ No newline at end of file