/// <summary> /// The set on click. /// </summary> /// <returns> /// The <see cref="Task"/>. /// </returns> private async Task SetOnClick() { var selectedItem = (TileItem)this.flipView.SelectedItem; if (selectedItem == null) { return; } var content = "The tile was successfully set."; var title = "Success"; try { var baseTile = new BaseTile(selectedItem.Tile.Type); for (var textLines = 0; textLines < baseTile.TextLines; textLines++) { baseTile.AddText(this.text[textLines]); } for (var imageIndex = 0; imageIndex < baseTile.Images; imageIndex++) { baseTile.AddImage(this.images[imageIndex], "Sample Image"); } baseTile.WithNoBranding().Set(); } catch (Exception ex) { title = "Error"; content = ex.Message; } var dialog = new MessageDialog(content, title); await dialog.ShowAsync(); }