Skip to content

Commit 8da9f03

Browse files
ndbroadbentrozele
authored andcommitted
Move "RootView.Background = ..." into CreateRootView(), so that subclasses can return a RootView with their own Background (microsoft#1117)
1 parent fa85c57 commit 8da9f03

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ReactWindows/ReactNative/ReactPage.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ public void OnCreate(string arguments)
110110
/// <param name="initialProps">The initialProps.</param>
111111
public void OnCreate(string arguments, JObject initialProps)
112112
{
113-
RootView.Background = (Brush)Application.Current.Resources["ApplicationPageBackgroundThemeBrush"];
114-
115113
ApplyArguments(arguments);
116114
RootView.StartReactApplication(_reactInstanceManager, MainComponentName, initialProps);
117115

@@ -163,7 +161,9 @@ public Task DisposeAsync()
163161
/// </remarks>
164162
protected virtual ReactRootView CreateRootView()
165163
{
166-
return new ReactRootView();
164+
ReactRootView rootView = new ReactRootView();
165+
rootView.Background = (Brush)Application.Current.Resources["ApplicationPageBackgroundThemeBrush"];
166+
return rootView;
167167
}
168168

169169
/// <summary>

0 commit comments

Comments
 (0)