public ImageDetailPage() { Image = new Image { HorizontalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.LightGray, Aspect = Aspect.AspectFit, Source = Pages.Instance.SelectedPage.DocumentPreview }; Image.SizeChanged += delegate { // Don't allow images larger than 2/3 of the screen Image.HeightRequest = Content.Height / 3 * 2; }; BottomBar = new BottomActionBar(true); Content = new StackLayout { Children = { Image, BottomBar } }; BottomBar.AddClickEvent(BottomBar.CropButton, OnCropButtonClick); BottomBar.AddClickEvent(BottomBar.FilterButton, OnFilterButtonClick); BottomBar.AddClickEvent(BottomBar.DeleteButton, OnDeleteButtonClick); }
public ImageResultsPage() { Title = "Image Results"; List = new ListView(); List.ItemTemplate = new DataTemplate(typeof(ImageResultCell)); List.RowHeight = 120; List.BackgroundColor = Color.White; BottomBar = new BottomActionBar(false); Loader = new ActivityIndicator { VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.CenterAndExpand, HeightRequest = Application.Current.MainPage.Height / 3 * 2, WidthRequest = Application.Current.MainPage.Width, Color = App.ScanbotRed, IsRunning = true, IsEnabled = true, Scale = (DeviceInfo.Platform == DevicePlatform.iOS) ? 2 : 0.3 }; Stack = new StackLayout { Orientation = StackOrientation.Vertical, Spacing = 0, Children = { List, BottomBar } }; Content = new AbsoluteLayout { Children = { Loader, Stack } }; BottomBar.AddClickEvent(BottomBar.AddButton, OnAddButtonClick); BottomBar.AddClickEvent(BottomBar.SaveButton, OnSaveButtonClick); BottomBar.AddClickEvent(BottomBar.DeleteAllButton, OnDeleteButtonClick); List.ItemTapped += OnItemClick; (Content as AbsoluteLayout).SizeChanged += Content_SizeChanged; }