Skip to content

Commit

Permalink
fix: Set IsVisualTreeRoot flag on all platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
dr1rrb committed Feb 3, 2021
1 parent 9be2a95 commit ce2641d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Uno.UI/UI/Xaml/Window.Android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ private void InternalSetContent(UIElement value)

_main = new Grid()
{
IsVisualTreeRoot = true,
Children =
{
_rootBorder,
Expand Down
10 changes: 10 additions & 0 deletions src/Uno.UI/UI/Xaml/Window.Desktop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,17 @@ partial void InternalActivate()

private void InternalSetContent(UIElement value)
{
if (_content != null)
{
_content.IsWindowRoot = false;
_content.IsVisualTreeRoot = false;
}

_content = value;

_content.IsWindowRoot = true;
_content.IsVisualTreeRoot = true;

TryLoadContent();
}

Expand Down
1 change: 1 addition & 0 deletions src/Uno.UI/UI/Xaml/Window.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ private void InternalSetContent(UIElement value)

_main = new Grid()
{
IsVisualTreeRoot = true,
Children =
{
_rootBorder,
Expand Down
1 change: 1 addition & 0 deletions src/Uno.UI/UI/Xaml/Window.macOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ private void InternalSetContent(UIElement value)

_main = new Grid()
{
IsVisualTreeRoot = true,
Children =
{
_rootBorder,
Expand Down
1 change: 1 addition & 0 deletions src/Uno.UI/UI/Xaml/Window.wasm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ private void InternalSetContent(UIElement content)
_popupRoot = new PopupRoot();
_window = new Grid()
{
IsVisualTreeRoot = true,
Children =
{
_rootScrollViewer,
Expand Down

0 comments on commit ce2641d

Please sign in to comment.