Beispiel #1
0
		private void Initialize (Raum raum)
		{
			_raum = raum;
			
			SelectionStyle = UITableViewCellSelectionStyle.Gray;
			Accessory = UITableViewCellAccessory.DisclosureIndicator;
			
			lblTitle = new UILabel () {
				Font = titleFont,
				TextColor = Resources.Colors.CellText,
				BackgroundColor = UIColor.Clear,
				TextAlignment = UITextAlignment.Left,
				Lines = 0,
				LineBreakMode = UILineBreakMode.WordWrap
			};
			
			lblSubtitle = new UILabel () {
				Font = subTitleFont,
				TextColor = Resources.Colors.CellText,
				BackgroundColor = UIColor.Clear,
				TextAlignment = UITextAlignment.Left,
				Lines = 0,
				LineBreakMode = UILineBreakMode.WordWrap
			};
			
			imageView = new UIImageView (new RectangleF (PicXPad, PicYPad, PicSize, PicSize));
			
			BindDataToCell (_raum);
			
			ContentView.Add (lblTitle);
			ContentView.Add (lblSubtitle);
			ContentView.Add (imageView);
		}
Beispiel #2
0
		public static float GetCellHeight (RectangleF bounds, Raum raum)
		{
			/*
			bounds.Height = 999;
			
			// Keep the same as LayoutSubviews
			bounds.X = TextLeftStart;
			bounds.Width -= TextLeftStart + TextHeightPadding;
			
			float height = 0;
			
			using (var nss = new NSString (raum.Title)) {
				height += nss.StringSize (titleFont, bounds.Size, UILineBreakMode.WordWrap).Height;
				
			}
			using (var nss = new NSString (raum.Subtitle)) {
				height += nss.StringSize (subTitleFont, bounds.Size, UILineBreakMode.WordWrap).Height;
			}
			
			return Math.Max (height + TextYOffset + 2 * TextHeightPadding, MinHeight);
			*/
			return MinHeight;
		}
		public RaumDetailViewController (Raum raum) : base ()
		{
			_raum = raum;
			Initialize ();
		}
Beispiel #4
0
		public RaumCell (NSString ident, Raum raum) : base(UITableViewCellStyle.Default, ident)
		{
			this.Initialize (raum);
		}
Beispiel #5
0
		public RaumCell (UITableViewCellStyle style, NSString ident, Raum raum) : base (style, ident)
		{
			this.Initialize (raum);
		}
Beispiel #6
0
		public RaumElement (Raum raum) : base (null)
		{
			this.raum = raum;
		}
Beispiel #7
0
		public void BindDataToCell (Raum raum)
		{
			this._raum = raum;
			
			this.lblTitle.Text = raum.Title;
			this.lblSubtitle.Text = raum.Subtitle;
			this.imageView.Image = null;
			
			if (raum.ThumbnailUri != null) {
				var img = UIImage.FromBundle (raum.ThumbnailUrl);//ImageLoader.DefaultRequestImage (raum.ThumbnailUri, this);
				if (img != null)
					this.imageView.Image = img.RoundCorners ();
			}
			SetNeedsDisplay ();
			
		}