private void ActionSheet_Clicked(object sender, EventArgs e) { var config = new ActionSheetConfig { Title = "Title", Message = "Message", BottomSheet = false, }; // c.ItemTextAlgin = ActionSheetItemTextAlgin.Center; //config.AddItem("item1_icon", icon: "ic_3d_rotation_black_24dp"); //config.AddItem("item2_icon", icon: "ic_android_black_24dp"); //config.AddItem("item3_icon", icon: "ic_credit_card_black_24dp"); config.AddItem("item1"); config.AddItem("item2"); config.AddItem("item3", action: () => ToastShow("item3")); config.AddCancel(action: () => ToastShow("cancel")); config.AddDestructive(action: () => ToastShow("destructive")); UserDialogs.Instance.ActionSheet(config); }
public void Select() { var cfg = new ActionSheetConfig() .SetTitle($"{this.Description} - {this.Uuid}") .AddCancel(); if (this.Characteristic.CanWriteWithResponse()) { cfg.Add("Write With Response", () => this.DoWrite(true)); } if (this.Characteristic.CanWriteWithoutResponse()) { cfg.Add("Write Without Response", () => this.DoWrite(false)); } if (this.Characteristic.CanWrite()) { cfg.Add("Send Test BLOB", this.SendBlob); } if (this.Characteristic.CanRead()) { cfg.Add("Read", this.DoRead); } if (this.Characteristic.CanNotify()) { var txt = this.Characteristic.IsNotifying ? "Stop Notifying" : "Notify"; cfg.Add(txt, this.ToggleNotify); } if (cfg.Items.Any()) { this.dialogs.ActionSheet(cfg.AddCancel()); } }