| | |
| | | { |
| | | public class ShowDialog |
| | | { |
| | | |
| | | private static ShowDialog showDialog; |
| | | |
| | | public static ShowDialog Currnet |
| | | { |
| | | get |
| | | { |
| | | if (showDialog == null) |
| | | { |
| | | |
| | | showDialog = new ShowDialog(); |
| | | } |
| | | |
| | | return showDialog; |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | public Dialog dialog; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="title">标题</param> |
| | | /// <param name="action1">回调函数</param> |
| | | /// <param name="action2">回调函数</param> |
| | | public void ClickBox(string title, Action<Dialog> action1, Action<Dialog> action2) |
| | | /// <param name="jieTingAction">回调函数</param> |
| | | /// <param name="guanBiAction">回调函数</param> |
| | | public void ClickBox(string title, Action<Dialog> jieTingAction, Action<Dialog> guanBiAction) |
| | | { |
| | | Dialog dialog = new Dialog() |
| | | if (dialog != null) |
| | | { |
| | | //防止二重界面 |
| | | dialog.Close(); |
| | | } |
| | | dialog = new Dialog() |
| | | { |
| | | BackgroundColor = MusicColor.PopupBackgroundColor, |
| | | }; |
| | | |
| | | FrameLayout whiteView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(56), |
| | |
| | | TextColor = MusicColor.TextColor, |
| | | TextSize = TextSize.Text16, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = "来自“围墙机”呼叫", |
| | | Text = title, |
| | | |
| | | }; |
| | | whiteView.AddChidren(btnTitle); |
| | | |
| | | |
| | | Button guaduanIconBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(75), |
| | |
| | | |
| | | guaduanIconBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | action1(dialog); |
| | | guanBiAction(dialog); |
| | | }; |
| | | jietingIconBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | action2(dialog); |
| | | jieTingAction(dialog); |
| | | }; |
| | | |
| | | } |