Ejemplo n.º 1
0
		public FooterMaster (ExtendedMap extendedMap, UIHelper uiHelper, Footer footer)
		{
			_extendedMap = extendedMap;
			_uiHelper = uiHelper;
			_footer = footer;

			Content = CreateFooter ();
		}
		public FooterDetail (UIHelper uiHelper, ExtendedMap extendedMap, Footer footer)
		{
			_uiHelper = uiHelper;
			_extendedMap = extendedMap;
			_footer = footer;

			Content = CreateFooterDetails ();
		}
//		private View _mapGridFooterRow {
//			get {
//				var footerRow = _mapGrid.Children [1];
//
//				return footerRow;
//			}
//		}

		protected override void OnSizeAllocated (double width, double height)
		{
			//If the pageSize values have not been set yet, set them
			if (Math.Abs (_pageHeight) < 0.001 && height > 0) {
				_pageHeight = Bounds.Height;
				const double collapsedMapHeight = 0.37;
				const double expandedMapHeight = 0.87;
				const double expandedFooterHeight = 0.63;

				var minimizedFooterY = _pageHeight * expandedMapHeight;
				var expandedFooterY = _pageHeight * collapsedMapHeight;

				_mapGrid.Children.Add (
					_extendedMap,
					Constraint.RelativeToParent ((parent) => {
						return (parent.Width * 0);
					}),
					Constraint.RelativeToParent ((parent) => {
						return (parent.Height * 0);
					}),
					Constraint.RelativeToParent ((parent) => {
						return (parent.Width * 1);
					}),
					Constraint.RelativeToParent ((parent) => {
						return (parent.Height * 1);
					})
				);

				Footer = new Footer (_extendedMap, _pageHeight, minimizedFooterY, expandedFooterY);

				_mapGrid.Children.Add (
					Footer,
					Constraint.RelativeToParent ((parent) => {
						return (parent.Width * 0);
					}),
					Constraint.RelativeToParent ((parent) => {
						return (parent.Height * expandedMapHeight);
					}),
					Constraint.RelativeToParent ((parent) => {
						return (parent.Width * 1);
					}),
					Constraint.RelativeToParent ((parent) => {
						return (parent.Height * 1);
					})
				);
			
				Footer.FooterMode = FooterMode.Hidden;
			}

			base.OnSizeAllocated (width, height);
		}