Bug 57610 - AbsoluteLayout Z-order (Raise/Lower) doesn't work on UWP platform
Summary: AbsoluteLayout Z-order (Raise/Lower) doesn't work on UWP platform
Status: RESOLVED DUPLICATE of bug 38770
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows ()
Version: 2.3.5
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-06-19 23:45 UTC by Piotr Boguslawski
Modified: 2017-06-20 13:45 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 38770

Description Piotr Boguslawski 2017-06-19 23:45:02 UTC
### Steps to reproduce

Please replace ```public MainPage()``` in newly created XF project with code below.

```
		public MainPage()
		{
			InitializeComponent();

			AbsoluteLayout layout = new AbsoluteLayout();

			AbsoluteLayout viewsLayout = new AbsoluteLayout();
			AbsoluteLayout.SetLayoutFlags(viewsLayout, AbsoluteLayoutFlags.SizeProportional);
			AbsoluteLayout.SetLayoutBounds(viewsLayout, new Rectangle(0, 0, 1, 1));

			ContentView view1 = new ContentView()
			{
				BackgroundColor = Color.LightBlue,
				Content = new StackLayout
				{
					Orientation = StackOrientation.Vertical,
					VerticalOptions = LayoutOptions.CenterAndExpand,
					HorizontalOptions = LayoutOptions.CenterAndExpand,
				}
			};
			ContentView view2 = new ContentView()
			{
				BackgroundColor = Color.LightGreen,
				Content = new StackLayout
				{
					Orientation = StackOrientation.Vertical,
					VerticalOptions = LayoutOptions.CenterAndExpand,
					HorizontalOptions = LayoutOptions.CenterAndExpand,
				}
			};

			(view1.Content as StackLayout).Children.Add(new Button
			{
				Text = "show view 2",
				Command = new Command(() =>
				{
					viewsLayout.RaiseChild(view2);
				})
			});
			AbsoluteLayout.SetLayoutFlags(view1, AbsoluteLayoutFlags.SizeProportional);
			AbsoluteLayout.SetLayoutBounds(view1, new Rectangle(0, 0, 1, 1));

			viewsLayout.Children.Add(view1);

			(view2.Content as StackLayout).Children.Add(new Button
			{
				Text = "show view 1",
				Command = new Command(() =>
				{
					viewsLayout.RaiseChild(view1);
				})
			});
			AbsoluteLayout.SetLayoutFlags(view2, AbsoluteLayoutFlags.SizeProportional);
			AbsoluteLayout.SetLayoutBounds(view2, new Rectangle(0, 0, 1, 1));

			viewsLayout.Children.Add(view2);

			layout.Children.Add(viewsLayout);

			viewsLayout.RaiseChild(view1);

			Content = layout;
		}
```

### Expected behavior

It should (and it does on iOS, Android and macOS) show view2 when clicked on button in view1 and show view1 when clicked on button in view2.

### Actual behavior

On UWP it does nothing at all :(
On iOS, Android and macOS it works OK, as I expected.

### Supplemental info (logs, images, videos)

Full example can be found here:
https://github.com/boguslawski-piotr/pbX/tree/master/Samples

More complicated and useful code using this technique (works ok on iOS, Android and macOS but not on UWP) can be found here:
https://github.com/boguslawski-piotr/pbX/blob/master/pbXForms/MastersDetailsPage.xaml.cs

### Test environment (full version information)

Visual Studio 2017 on Windows
Visual Studio for Mac alpha
Xamarin.Forms 2.3.5-239-pre3
Comment 1 Paul DiPietro [MSFT] 2017-06-20 13:45:33 UTC

*** This bug has been marked as a duplicate of bug 38770 ***