/// <summary> /// 确认 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Confirm_Clicked(object sender, EventArgs e) { PopData select = null; var vm = this.ViewModel; if (vm != null) { select = vm.Options.Where(s => s.Selected).Select(s => s).FirstOrDefault(); } if (select == null) { vm.Alert("请选择项目!"); return; } Completed?.Invoke(this, select); CloseAllPopup(); }
public void Pop() { //if (uisFromLastPop.Count > 0) //{ // return; //} uisFromLastPop.Clear(); if (PopStack.Count <= 0) { return; } PopData data = PopStack[0]; PopStack.RemoveAt(0); CurPopUI = UIManager.Inst.ShowUI(data.UIName, true, data.objs); data.customAction?.Invoke(CurPopUI); CurPopUI.OnCloseLister += OnCurPopUIClose; }
//先弹出popIndex较消的面板 public void Push(string uiName, int popIndex, Action <BaseUI> customAction, params object[] objs) { PopData data = new PopData(uiName, popIndex, customAction, objs); if (PopStack.Count == 0) { PopStack.Add(data); return; } int i = 0; while (i < PopStack.Count) { if (PopStack[i].popIndex > popIndex) { PopStack.Insert(i, data); return; } i++; } PopStack.Add(data); }