private bool ReturnToMainScreen() { if (changed) { var alert = new AlertDialog.Builder(this).Create(); var alertView = LayoutInflater.Inflate(Resource.Layout.confirmationPopup, null); alertView.FindViewById <TextView>(Resource.Id.textView2).Text = _vacationsViewModel.Localaizer.Localize("confirmationChange"); alertView.FindViewById <Button>(Resource.Id.confirmation_popup_cancel_button).Text = _vacationsViewModel.Localaizer.Localize("cancel_button"); alertView.FindViewById <Button>(Resource.Id.confirmation_popup_ok_button).Text = _vacationsViewModel.Localaizer.Localize("ok_button"); alertView.FindViewById <TextView>(Resource.Id.textView2).Typeface = FontLoader.GetFontBold(this); alertView.FindViewById <Button>(Resource.Id.confirmation_popup_cancel_button).Typeface = FontLoader.GetFontNormal(this); alertView.FindViewById <Button>(Resource.Id.confirmation_popup_ok_button).Typeface = FontLoader.GetFontNormal(this); alertView.FindViewById <Button>(Resource.Id.confirmation_popup_cancel_button).Click += (s, e) => { alert.Hide(); alert.Cancel(); Exit(); }; alertView.FindViewById <Button>(Resource.Id.confirmation_popup_ok_button).Click += async(s, e) => { alert.Hide(); alert.Cancel(); await Save(); }; alert.SetView(alertView); alert.Show(); return(false); } ViewDispose(); return(true); }
private void ShowConfirmation(VTSModel vts) { var alert = new AlertDialog.Builder(this).Create(); var alertView = LayoutInflater.Inflate(Resource.Layout.confirmationPopup, null); alertView.FindViewById <TextView>(Resource.Id.textView2).Text = _vacationsViewModel.Localaizer.Localize("confirmDelete"); alertView.FindViewById <Button>(Resource.Id.confirmation_popup_cancel_button).Text = _vacationsViewModel.Localaizer.Localize("cancel_button"); alertView.FindViewById <Button>(Resource.Id.confirmation_popup_ok_button).Text = _vacationsViewModel.Localaizer.Localize("delButton"); alertView.FindViewById <TextView>(Resource.Id.textView2).Typeface = FontLoader.GetFontBold(this); alertView.FindViewById <Button>(Resource.Id.confirmation_popup_cancel_button).Typeface = FontLoader.GetFontNormal(this); alertView.FindViewById <Button>(Resource.Id.confirmation_popup_ok_button).Typeface = FontLoader.GetFontNormal(this); alertView.FindViewById <Button>(Resource.Id.confirmation_popup_cancel_button).Click += (s, e) => { alert.Hide(); alert.Cancel(); }; alertView.FindViewById <Button>(Resource.Id.confirmation_popup_ok_button).Click += async(s, e) => { alert.Hide(); alert.Cancel(); await Delete(vts); }; alert.SetView(alertView); alert.Show(); }