コード例 #1
0
		public void addAlertToList(AlertListItem ali) {
			alerts.Add (ali);
			alerts.Sort ();		
			if (alerts.Count == 1) {
				SetAlertListContent ();
			}
		}
コード例 #2
0
		public void removeAlertFromList(AlertListItem ali) {
			alerts.Remove (ali);
			alerts.Sort ();		
			if (alerts.Count == 0) {
				SetNoAlertsContent ();
			}
		}
コード例 #3
0
		public static async Task<AlertDetailPage> CreateAlertDetailPage(AlertListItem alert) {
			
			AlertDetailPage alertDetailPage = new AlertDetailPage {
				Title="Alert Detail"
			};

			StackLayout layout = new StackLayout {
				HorizontalOptions = LayoutOptions.FillAndExpand,
				//VerticalOptions = LayoutOptions.FillAndExpand,
				Padding = new Thickness(20),
				BackgroundColor = Color.White,
				Children = {
					new Label {
						Text = alert.Title,
						FontSize = 20,
						FontAttributes = FontAttributes.Bold,
						TextColor = Color.Black
					},
					new Label {
						Text = "Received: " + alert.DateTimeFull,
						FontSize = 16,
						FontAttributes = FontAttributes.Bold,
						TextColor = Color.Black
					},
					new Label {
						Text = alert.Content,
						FontSize = 14,
						TextColor = Color.Black
					}
				}
			};

			alertDetailPage.Content = layout;

			return alertDetailPage;
		}