private async void OnNavigationExecute(MaisDetalhes obj) { await PopupNavigation.PopAsync(); await Navigation.PushAsync <FormularioViewModel>(true); }
public async void OnEdit(object sender, EventArgs args) { await Navigation.PushAsync(new EditBook(Id, true)); await PopupNavigation.PopAsync(); }
public async void OnSearchBook(object sender, EventArgs args) { await Navigation.PushAsync(new BookView(Id)); await PopupNavigation.PopAsync(); }
public async void OnImageChanged(PairImageCell pairImage) { settingDelegate.OnImageChanged(pairImage); await PopupNavigation.PopAsync(); }
private void Cancel() { PopupNavigation.PopAsync(); }
internal static Task <DateTime> GetDateTimeAsync(string title, DateTime selectedDate = default(DateTime)) { TaskCompletionSource <DateTime> tcs = new TaskCompletionSource <DateTime>(); DatePicker dPicker = new DatePicker { Date = selectedDate }; Button button = new Button { Text = "TAMAM", CornerRadius = 20, HorizontalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.Accent, TextColor = Color.White }; Button btnCancel = new Button { Text = "İPTAL", CornerRadius = 20, HorizontalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.White, TextColor = Color.Accent }; button.Clicked += (s, e) => { tcs.SetResult(dPicker.Date); PopupNavigation.PopAsync(); }; btnCancel.Clicked += (s, e) => { tcs.TrySetResult(default(DateTime)); PopupNavigation.PopAsync(); }; Frame frame = new Frame { Margin = 25, BackgroundColor = Color.WhiteSmoke, VerticalOptions = LayoutOptions.CenterAndExpand, Content = new StackLayout { Spacing = 12, Children = { new Label { Text = title, Margin = 10, HorizontalOptions = LayoutOptions.Center, FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)) }, dPicker, new StackLayout { Orientation = StackOrientation.Horizontal, Children ={ button, btnCancel } } } } }; var popupPage = new PopupPage { Content = frame }; return(tcs.Task); }
/// <summary> /// Textbox açarak kullanıcıdan string tipinde input alır ve sonucu return eder. /// </summary> /// <param name="title">Başlık olarak gözükecek yazı</param> /// <param name="message">Başlığın altında yer alacak açıklama</param> /// <param name="editorContent">Bu değer textbox'ın içinde yer alacak yazı, boş textbox için null bırakılmalı.</param> /// <returns></returns> public static Task <string> GetUserInputAsync(string title = "", string message = "Bir Değer Girin;", string editorContent = "") { var tcs = new TaskCompletionSource <string>(); var lblTitle = new Label { Text = title, Margin = 10, HorizontalOptions = LayoutOptions.Center, FontAttributes = FontAttributes.Bold, FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)) }; var lblMessage = new Label { Text = message }; var txtInput = new Editor { Text = editorContent, HeightRequest = 80, BackgroundColor = Color.White }; var btnOk = new Button { Text = "TAMAM", HorizontalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.Accent, TextColor = Color.White }; btnOk.Clicked += async(s, e) => { // close page var result = txtInput.Text; await PopupNavigation.PopAsync(); // pass result tcs.SetResult(result); }; var btnCancel = new Button { Text = "İPTAL", HorizontalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.FromRgb(0.8, 0.8, 0.8) }; btnCancel.Clicked += async(s, e) => { await PopupNavigation.PopAsync(); tcs.SetResult(null); }; var slButtons = new StackLayout { Orientation = StackOrientation.Horizontal, Children = { btnOk, btnCancel }, }; var layout = new StackLayout { BackgroundColor = Color.White, Margin = new Thickness(25), Padding = new Thickness(10), VerticalOptions = LayoutOptions.CenterAndExpand, Children = { lblTitle, lblMessage, new Grid { Padding = 0.8, BackgroundColor = Color.FromHex("#005da4"), Children = { txtInput } }, slButtons }, }; // create and show page var page = new PopupPage(); page.Content = layout; page.CloseWhenBackgroundIsClicked = false; PopupNavigation.PushAsync(page); // open keyboard txtInput.Focus(); // code is waiting her, until result is passed with tcs.SetResult() in btn-Clicked // then proc returns the result return(tcs.Task); }
async void OnCloseButtonClicked(object sender, EventArgs args) { cancelled = true; await PopupNavigation.PopAsync(); }
async Task ExecuteDeleteQueueCommandlAsync() { MessagingService.Current.SendMessage(MessageKeys.DeleteQueue, new MessageArgsDeleteQueue(queueName, storageAccountName)); await PopupNavigation.PopAsync(); }
private void OnClose(object sender, EventArgs e) { //ts.Cancel(); PopupNavigation.PopAsync(); }
private async void Button_Clicked(object sender, System.EventArgs e) { await PopupNavigation.PopAsync(); await Utils.StartListening(true); }
private async void Cancel() { await PopupNavigation.PopAsync(); }
private async void RadioButton_Clicked(object sender, EventArgs e) { dashbordMW.countPage = 0; var inp = ((CrossAddRadiobtn)sender); int idInp = inp.Idi; if (dashbordMW.Type != idInp) { await PopupNavigation.PopAsync(true); dashbordMW.Type = idInp; int stateAuth = 0; await Task.Run(async() => { stateAuth = await dashbordMW.GetOrder(true); }); if (stateAuth == 3) { dashbordMW.SelectProduct = new List <Models.OrderInfo>(); dashbordMW.CountSelectOrder = ""; if (dashbordMW.Type == 1) { dashbordMW.Title = $"Paid {dashbordMW.countOrder}"; dashbordMW.TypeCheck = true; dashbordMW.TypeCheck1 = false; dashbordMW.TypeCheck2 = false; dashbordMW.TypeCheck3 = false; dashbordMW.menuDetalePage.CheckAndSetCountDashbord(dashbordMW.countOrder); } else if (dashbordMW.Type == 2) { dashbordMW.Title = $"Sold Last 3 month {dashbordMW.countOrder}"; dashbordMW.TypeCheck = false; dashbordMW.TypeCheck1 = true; dashbordMW.TypeCheck2 = false; dashbordMW.TypeCheck3 = false; } else if (dashbordMW.Type == 3) { dashbordMW.Title = $"Labels Printed Last 72h {dashbordMW.countOrder}"; dashbordMW.TypeCheck = false; dashbordMW.TypeCheck1 = false; dashbordMW.TypeCheck2 = true; dashbordMW.TypeCheck3 = false; } else if (dashbordMW.Type == 4) { dashbordMW.Title = $"Printing label error {dashbordMW.countOrder}"; dashbordMW.TypeCheck = false; dashbordMW.TypeCheck1 = false; dashbordMW.TypeCheck2 = false; dashbordMW.TypeCheck3 = true; } } else if (stateAuth == 2) { await PopupNavigation.PushAsync(new Error("Error"), true); } else if (stateAuth == 1) { await PopupNavigation.PushAsync(new Error("No network"), true); } else if (stateAuth == 4) { await PopupNavigation.PushAsync(new Error("Technical works on the server"), true); } } }
async void Return() { await PopupNavigation.PopAsync(true); }
async Task ExecuteDeleteQueueMessageCommandlAsync() { MessagingService.Current.SendMessage(MessageKeys.DeleteQueueMessage, new MessageArgsDeleteQueueMessage(queueMessage.Id)); await PopupNavigation.PopAsync(); }
private void OnClose(object sender, EventArgs e) { PopupNavigation.PopAsync(); }
async Task ExecuteCancelAsync() { await PopupNavigation.PopAsync(); }
private async void AplyGestureRecognizer_Tapped(object sender, EventArgs e) { await PopupNavigation.PopAsync(); }
internal static Task <Thickness> GetThichnessAsync(string title, Thickness current = default(Thickness)) { TaskCompletionSource <Thickness> tcs = new TaskCompletionSource <Thickness>(); Entry txtTop = new Entry { Text = current.Top.ToString(), Keyboard = Keyboard.Numeric }; Entry txtLeft = new Entry { Text = current.Left.ToString(), Keyboard = Keyboard.Numeric, HorizontalOptions = LayoutOptions.FillAndExpand }; Entry txtRight = new Entry { Text = current.Right.ToString(), Keyboard = Keyboard.Numeric, HorizontalOptions = LayoutOptions.FillAndExpand }; Entry txtBottom = new Entry { Text = current.Bottom.ToString(), Keyboard = Keyboard.Numeric }; Button button = new Button { Text = "TAMAM", CornerRadius = 20, HorizontalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.Accent, TextColor = Color.White }; Button btnCancel = new Button { Text = "İPTAL", CornerRadius = 20, HorizontalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.White, TextColor = Color.Accent }; button.Clicked += (s, e) => { tcs.SetResult(new Thickness(Convert.ToDouble(txtLeft.Text), Convert.ToDouble(txtTop.Text), Convert.ToDouble(txtRight.Text), Convert.ToDouble(txtBottom.Text))); PopupNavigation.PopAsync(); }; btnCancel.Clicked += (s, e) => { tcs.TrySetResult(default(Thickness)); PopupNavigation.PopAsync(); }; Frame frame = new Frame { Margin = 25, BackgroundColor = Color.WhiteSmoke, VerticalOptions = LayoutOptions.CenterAndExpand, Content = new StackLayout { Spacing = 12, Children = { new Label { Text = title, Margin = 10, HorizontalOptions = LayoutOptions.Center, FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)) }, txtTop, new StackLayout { Orientation = StackOrientation.Horizontal, Children = { txtLeft, txtRight } }, txtBottom, new StackLayout { Orientation = StackOrientation.Horizontal, Children ={ button, btnCancel } } } } }; var popupPage = new PopupPage { Content = frame }; PopupNavigation.PushAsync(popupPage); return(tcs.Task); }
private async void Save_Clicked(object sender, EventArgs e) { if (contact_id == 0) { // Contact Create function Dictionary <string, dynamic> vals = new Dictionary <string, dynamic>(); vals["mobile"] = mobile.Text; vals["name"] = name.Text; vals["email"] = email.Text; vals["phone"] = phone.Text; vals["function"] = position.Text; vals["parent_id"] = CustParent_Id; if (selectedimg != "") { vals["image"] = selectedimg; } else { vals["image"] = ""; } var currentpage = new LoadingAlert(); await PopupNavigation.PushAsync(currentpage); var updated = Controller.InstanceCreation().CreateContactlist("res.partner", "create", vals); if (updated) { ContactsList createCont = new ContactsList(); createCont.id = App.createContact_Id; createCont.name = name.Text; createCont.mobile = mobile.Text; createCont.email = email.Text; createCont.phone = phone.Text; createCont.position = position.Text; if (selectedimg != "") { createCont.image_small = selectedimg; } else { createCont.image_small = ""; } MessagingCenter.Send <string, ContactsList>("MyApp", "CreateMsg", createCont); await DisplayAlert("Alert", "Contact created successfully", "ok"); await PopupNavigation.PopAsync(); } else { await DisplayAlert("Alert", "Please try again", "Ok"); } } else { // Contact Update function ContactsList newcont = new ContactsList(); newcont.id = contact_id; newcont.name = name.Text; newcont.mobile = mobile.Text; newcont.email = email.Text; newcont.phone = phone.Text; newcont.position = position.Text; if (selectedimg != "") { newcont.image_small = selectedimg; } else { try { StreamImageSource streamImageSource = (StreamImageSource)photo; System.Threading.CancellationToken cancellationToken = System.Threading.CancellationToken.None; Task <Stream> task = streamImageSource.Stream(cancellationToken); Stream stream = task.Result; var memoryStream = new MemoryStream(); stream.CopyTo(memoryStream); var base64String = Convert.ToBase64String(memoryStream.ToArray()); newcont.image_small = base64String; } catch (Exception ex) { newcont.image_small = ""; } } MessagingCenter.Send <string, ContactsList>("MyApp", "ContactMsg", newcont); Dictionary <string, dynamic> vals = new Dictionary <string, dynamic>(); vals["mobile"] = mobile.Text; vals["name"] = name.Text; vals["email"] = email.Text; if (selectedimg != "") { vals["image"] = selectedimg; } else { try { StreamImageSource streamImageSource = (StreamImageSource)photo; System.Threading.CancellationToken cancellationToken = System.Threading.CancellationToken.None; Task <Stream> task = streamImageSource.Stream(cancellationToken); Stream stream = task.Result; var memoryStream = new MemoryStream(); stream.CopyTo(memoryStream); var base64String = Convert.ToBase64String(memoryStream.ToArray()); vals["image"] = base64String; } catch (Exception ex) { vals["image"] = ""; } } var currentpage = new LoadingAlert(); await PopupNavigation.PushAsync(currentpage); var updated = Controller.InstanceCreation().UpdateContactlist("res.partner", "write", contact_id, vals); if (updated) { await DisplayAlert("Alert", "Contact updated successfully", "ok"); await PopupNavigation.PopAsync(); } else { await DisplayAlert("Alert", "Please try again", "Ok"); } } await PopupNavigation.PopAsync(); }
/// <summary> /// Picker'ın içini doldurmak için. /// </summary> /// <returns>The picker result async.</returns> /// <param name="title">Title.</param> /// <param name="message">Message.</param> /// <param name="collection">Collection.</param> /// <param name="display">Display.</param> /// <typeparam name="T">The 1st type parameter.</typeparam> public static Task <T> GetPickerResultAsync <T>(string title, string message, IList <T> collection, T selectedItem = default(T), string display = null) { TaskCompletionSource <T> tcs = new TaskCompletionSource <T>(); Picker picker; if (display == null) { picker = new Picker { ItemsSource = (IList)collection, BackgroundColor = Color.White, SelectedItem = selectedItem }; } else { picker = new Picker { ItemsSource = (IList)collection, ItemDisplayBinding = new Binding(display), BackgroundColor = Color.White, SelectedItem = selectedItem }; } Button button = new Button { Text = "TAMAM", CornerRadius = 20, HorizontalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.Accent, TextColor = Color.White }; Button btnCancel = new Button { Text = "TEMİZLE", CornerRadius = 20, HorizontalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.White, TextColor = Color.Accent }; button.Clicked += (s, e) => { tcs.SetResult((T)picker.SelectedItem); PopupNavigation.PopAsync(); }; btnCancel.Clicked += (s, e) => { tcs.TrySetResult(default(T)); PopupNavigation.PopAsync(); }; Frame frame = new Frame { Margin = 25, BackgroundColor = Color.WhiteSmoke, VerticalOptions = LayoutOptions.CenterAndExpand, Content = new StackLayout { Spacing = 12, Children = { new Label { Text = title, Margin = 10, HorizontalOptions = LayoutOptions.Center, FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)) }, picker, new StackLayout { Orientation = StackOrientation.Horizontal, Children ={ button, btnCancel } } } } }; var popupPage = new PopupPage { Content = frame }; popupPage.Disappearing += (s, e) => { //tcs.SetResult((T)picker.SelectedItem); }; PopupNavigation.PushAsync(popupPage); return(tcs.Task); }
/// <summary> /// /// </summary> public async void ClosePopup() { await PopupNavigation.PopAsync(); }
void clickedCancel(object sender, System.EventArgs e) { PopupNavigation.PopAsync(); }
public static async Task PopPopupAsync(this INavigation sender, bool animate = true) { await PopupNavigation.PopAsync(animate); }
private async void btnCerrarVentana_Clicked(object sender, EventArgs e) { await PopupNavigation.PopAsync(true); }
private async void DismissModalClick(object sender, EventArgs e) { await PopupNavigation.PopAsync(); Settings.Set(Settings.Key.ResumePage, false); }
public async void OnCancel(object sender, EventArgs args) { await PopupNavigation.PopAsync(); }
public async void Actualizar() { await PopupNavigation.PopAsync(); await PopupNavigation.PushAsync(new EditPage(_persona)); }
private void Button_Clicked(object sender, EventArgs e) { PopupNavigation.PopAsync(); }
private async void TapGestureRecognizer_Tapped(object sender, EventArgs e) { App.gIsEnableReasonCode = true; await PopupNavigation.PopAsync(); }