Example #1
0
		private void Initialize (Event lEvent)
		{
			_event = lEvent;
			
			this.SelectionStyle = UITableViewCellSelectionStyle.None;
			this.Accessory = UITableViewCellAccessory.None;
			
			_lblTitle = new UILabel () {
				Font = titleFont,
				TextAlignment = UITextAlignment.Left,
				TextColor =  Resources.Colors.CellText,
				BackgroundColor = UIColor.Clear,
				Lines = 0,
				LineBreakMode = UILineBreakMode.WordWrap
			};
			
			
			_lblDescription = new UILabel () {
				Font = descrFont,
				TextAlignment = UITextAlignment.Left,
				TextColor = Resources.Colors.CellText,
				BackgroundColor = UIColor.Clear,
				Lines = 0,
				LineBreakMode = UILineBreakMode.WordWrap
			};
			
			_lblDate = new UILabel () {
				Font = descrFont,
				TextAlignment = UITextAlignment.Left,
				TextColor = Resources.Colors.CellText,
				BackgroundColor = UIColor.Clear,
				Lines = 0,
				LineBreakMode = UILineBreakMode.WordWrap
			};
			/*
			_btnOrder = new LBKButton () {
				Font = UIFont.BoldSystemFontOfSize (13),
			};
			_btnOrder.SetTitle (Locale.GetText ("Event buchen"), UIControlState.Normal);
			
			_btnOrder.TouchUpInside += delegate {
				EventOrdered.RaiseEvent (this, new EventArgs<string> (_event.ReservationLink));
			};
			*/
			//_btnOrder.SetBackgroundImage (UIImage.FromBundle ("image/buttons/orderevent.png"), UIControlState.Normal);
			
			_imageView = new UIImageView (new RectangleF (PicXPad, PicYPad, PicSize, PicSize));
			
			BindDataToCell (_event);
			
			ContentView.Add (_lblTitle);
			ContentView.Add (_lblDate);
			ContentView.Add (_lblDescription);
			ContentView.Add (_imageView);
			/*
			if (!string.IsNullOrWhiteSpace (_event.ReservationLink)) {
				ContentView.Add (_btnOrder);
			}
			*/
		}
Example #2
0
		public EventCell (NSString ident, Event lEvent) : base(UITableViewCellStyle.Default, ident)
		{
			this.Initialize (lEvent);
		}
Example #3
0
		public EventCell (Event lEvent) : this(UITableViewCellStyle.Default, new NSString("EventCell"), lEvent)
		{
			//this.Initialize (lEvent);
		}
Example #4
0
		public EventElement (Event lEvent, DialogViewController dvc) : this (lEvent)
		{
			this._dvc = dvc;
		}
Example #5
0
		public EventCell (UITableViewCellStyle style, NSString ident, Event lEvent) : base (style, ident)
		{
			this.Initialize (lEvent);
		}
Example #6
0
		public EventElement (Event lEvent) : base (lEvent.Title, lEvent.ReservationLink)
		{
			this.lEvent = lEvent;
		}
Example #7
0
		public static float GetCellHeight (UITableView tableView, Event @event)
		{
			return EventCell.GetCellHeight (tableView, @event) + buttonSize.Height;
		}
Example #8
0
		public EventCellOrder (NSString ident, Event lEvent) : base( ident, lEvent)
		{
			this.Initialize ();
		}
Example #9
0
		public void BindDataToCell (Event @event)
		{
			this._event = @event;
			
			this._lblTitle.Text = @event.Title;
			this._lblDescription.Text = @event.Description;
			this._lblDate.Text = @event.Date;
			this._imageView.Image = null;
			
			if (_event.ThumbnailUri != null) {
				this._imageView.Image = ImageLoader.DefaultRequestImage (@event.ThumbnailUri, this);
			}
			
			/*
			if (string.IsNullOrEmpty (@event.ReservationLink)) {
				this._btnOrder.RemoveFromSuperview ();
			} else {
				_btnOrder.TouchUpInside += delegate {
					EventOrdered.RaiseEvent (this, new EventArgs<string> (@event.ReservationLink));
				};
				ContentView.Add (_btnOrder);
			}
			*/
			
			SetNeedsDisplay ();
			
		}
Example #10
0
		public static float GetCellHeight (UITableView tableView, Event @event)
		{
			int tetWidth = (int)tableView.Bounds.Width - (TextLeftStart + PicXPad / 2);
			
			if (tableView.Style == UITableViewStyle.Grouped) {
				tetWidth -= 20;
			}
			Size full = new Size (tetWidth, 999);
			
			//full.Height = 999;
			
			// Keep the same as LayoutSubviews
			//full.X = TextLeftStart;
			//full.Width = bounds.Width - (TextLeftStart + PicXPad);
			float height = 0;
			
			using (var nss = new NSString (@event.Title)) {
				height += nss.StringSize (titleFont, full, UILineBreakMode.WordWrap).Height;
			}
			
			if (!string.IsNullOrEmpty (@event.Date)) {
				using (var nss = new NSString (@event.Date)) {
					height += nss.StringSize (descrFont, full, UILineBreakMode.WordWrap).Height;
				}
			}
			using (var nss = new NSString (@event.Description)) {
				height += nss.StringSize (descrFont, full, UILineBreakMode.WordWrap).Height;
			}
			
			/*
			if (!string.IsNullOrWhiteSpace (@event.ReservationLink)) {
				height += buttonSize.Height;
			}
			*/
			
			return Math.Max (height + 4 * TextYOffset + 2 * TextHeightPadding, MinHeight);
		}