public BottomPage() { Title = "Bottom"; tray = new Tray(TrayOrientation.Bottom, 0.5) { VerticalOptions = LayoutOptions.End, }; tray.Content = new ContentView { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.Red }; Button switchTray = new Button { Text = "Open/Close Tray", WidthRequest = 0.5 * App.ScreenWidth }; switchTray.Clicked += ToggleTray; AbsoluteLayout layout = new AbsoluteLayout() { HeightRequest = App.ScreenHeight, WidthRequest = App.ScreenWidth, BackgroundColor = Color.Yellow }; layout.Children.Add(switchTray, new Rectangle(App.ScreenWidth * 0.25, 100, switchTray.WidthRequest, 50)); layout.Children.Add(tray, new Rectangle(0, App.ScreenHeight, App.ScreenWidth, tray.HeightRequest)); Content = layout; }
public TrayEventArgs(Tray tray) { this.tray = tray; }