public void ShowQuestionDialog(string Title, string msg, deleMethod PositiveMehtod, deleMethod NeturalMehtod, string PositiveButtonText = "是", string NeutralButtonText = "否") { builder = new AlertDialog.Builder(this); alertDialog = builder .SetTitle(Title) .SetMessage(msg) .SetPositiveButton(PositiveButtonText, (s, e) => { //进行数据保存 PositiveMehtod(); }) .SetNeutralButton(NeutralButtonText, (s, e) => { //不保存数据进行返回 NeturalMehtod(); }) .Create(); //创建alertDialog对象 alertDialog.Show(); }
public static string test(deleMethod m) { return m(1, "aaa"); }
/// <summary> /// Tests the specified m. /// </summary> /// <param name="m">The m.</param> /// <returns></returns> public static string test(deleMethod m) { return(m(1, "aaa")); }
private void CreateButton(string name, int row, int col, deleMethod clickedFunction) { ////Back Button Image buttonTemp = new Image(); if (KeyLayout1.Contains(name)) { buttonTemp.Name = "_" + name; } else { buttonTemp.Name = name; } buttonTemp.Tag = name; buttonTemp.Height = keyHeight; buttonTemp.Width = keyWidth; buttonTemp.Source = new BitmapImage(new Uri(@"Image/Keyboard/notekey.png", UriKind.Relative)); buttonTemp.Stretch = Stretch.Fill; buttonTemp.Opacity = 0; if (row == 2) { Canvas.SetLeft(buttonTemp, 24 + interval + (keyWidth + interval) * col); Canvas.SetTop(buttonTemp, 30 + heightInterval + (keyHeight + heightInterval) * row); } else { Canvas.SetLeft(buttonTemp, interval + (keyWidth + interval) * col); Canvas.SetTop(buttonTemp, 30 + heightInterval + (keyHeight + heightInterval) * row); } buttonTemp.MouseLeftButtonUp += new MouseButtonEventHandler(clickedFunction); buttonTemp.MouseLeftButtonDown += new MouseButtonEventHandler(ClickedSound); buttonTemp.MouseEnter += new MouseEventHandler(ButtonEnter); buttonTemp.MouseLeave += new MouseEventHandler(ButtonLeave); _pageUI.KeyboardLayer.Children.Add(buttonTemp); }