Ejemplo n.º 1
0
			public gateDevices (GerenciarPortoesViewModel viewModel)
			{
				BindingContext = viewModel;
				gerenciarPortoes = viewModel;
				this.SetBinding (TitleProperty, "SelectedGate.Name");
				//Title = "Cadastro Usuarios de Portao";


				listGateDevices.ItemTemplate = new DataTemplate (typeof(GateDeviceCell));
				listGateDevices.SetBinding (ListView.ItemsSourceProperty, "gateUsers");


				listGateDevices.ItemTapped += listGateDevices_ItemTapped;

				ToolbarItems.Add (new ToolbarItem {
					Icon = Images.SafetyKeyIcon,
					Order = ToolbarItemOrder.Primary,
					Command = new Command (ScanAction)
				});


				ToolbarItems.Add (new ToolbarItem {
					Icon = Images.tabbedRemote,
					Order = ToolbarItemOrder.Primary,
					Command = new Command (async () => {
						await gerenciarPortoes.newCellPhoneUser ();
						OnAppearing ();
					})
				});

				iconStack = new StackLayout {
					VerticalOptions = LayoutOptions.CenterAndExpand,
					HorizontalOptions = LayoutOptions.CenterAndExpand,
					Children = { iconMsg, labelMsg }
				};

				stack = new StackLayout {
					Padding = new Thickness (0, 20, 0, 0),
					Spacing = 10,
					Orientation = StackOrientation.Vertical,
					BackgroundColor = Color.FromHex ("#ECEFF1"),
					Children = {
						iconStack, listGateDevices
					}
				};


				var absoluteLayout = new AbsoluteLayout {
					VerticalOptions = LayoutOptions.FillAndExpand,
				};
				var background = new Image { /*Source = Images.Background,*/ Aspect = Aspect.Fill };

				//absoluteLayout.Children.Add (background, new Rectangle (0, 0, 1, 1), AbsoluteLayoutFlags.All);
				AbsoluteLayout.SetLayoutFlags (background, AbsoluteLayoutFlags.All);
				AbsoluteLayout.SetLayoutBounds (background, new Rectangle (0, 0, 1, 1));

				//absoluteLayout.Children.Add (stack, new Rectangle (0, 0, 1, 1), AbsoluteLayoutFlags.All);
				AbsoluteLayout.SetLayoutFlags (stack, AbsoluteLayoutFlags.All);
				AbsoluteLayout.SetLayoutBounds (stack, new Rectangle (0, 0, 1, 1));

				absoluteLayout.Children.Add (background);
				absoluteLayout.Children.Add (stack);

				Content = absoluteLayout;
			}