private void listView_ItemTapped(object sender, ItemTappedEventArgs e) { Machine machine = (Machine)e.Item; try { ControlPage page = new ControlPage(machine.IPString); Navigation.PushAsync(page); } catch (Exception exc) { if (exc.Message == "Incompatible") { DisplayAlert("Incompatible Version", "teh versions aint match up", ControlPage.GetCancelButtonText()); } else { DisplayAlert("Exception ocurred", exc.Message, ControlPage.GetCancelButtonText()); } } }
public FileExplorer() { // add the "above directory" arrow ToolbarItem item = new ToolbarItem { IconImageSource = ImageSource.FromResource("PC_Controller.up_arrow.png", typeof(FileExplorer).GetTypeInfo().Assembly), Order = ToolbarItemOrder.Primary, Priority = 0 }; item.Clicked += Item_Clicked; this.ToolbarItems.Add(item); UpdateView(); DisplayAlert("Under construction", "Please note that the file explorer is currently a Work In Progress and key features might not work.", ControlPage.GetCancelButtonText()); }
private void Button_Clicked(object sender, EventArgs e) { if (NameEntry.Text.Contains(",") | IPEntry.Text.Contains(",")) { DisplayAlert("Don't.", "Sorry but the machine name can't contain \",\".", ControlPage.GetCancelButtonText()); } machines[ID].Name = NameEntry.Text; machines[ID].IPString = IPEntry.Text; MainPage.SaveMachines(machines); Navigation.PopAsync(); }