private ProgressFragment ShowProcess() { try { FragmentTransaction ft = FragmentManager.BeginTransaction(); ProgressFragment progress = (ProgressFragment)FragmentManager.FindFragmentByTag("Progress"); if (progress != null) { ft.Show(progress); //ft.AddToBackStack(null); } else { // Create and show the dialog. progress = new ProgressFragment(this); //Add fragment progress.Show(ft, "Progress"); } return(progress); } catch (Exception Ex) { WriteErrorLog(Ex); } return(null); }
private async void AddProgressFragment(ProgressFragment item) { await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { var fragmentUI = new ProgressBarFragment(item); ProgressBarCanvas.Children.Add(fragmentUI); CalcProgressBarFragmentPosition(fragmentUI); }); }
public void ShowWaitInfo(string title, string story) { _progressFragment = new ProgressFragment(); Bundle arguments = new Bundle(); arguments.PutString(ProgressFragment.TitleKey, title); arguments.PutString(ProgressFragment.MessageKey, story); _progressFragment.Arguments = arguments; ShowOverlay(_progressFragment, true); }
private async void RemoveProgressFragment(ProgressFragment item) { await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { var removeTarget = ProgressBarCanvas.Children.Cast <ProgressBarFragment>() .SingleOrDefault(x => x.ProgressFragment == item); if (removeTarget != null) { removeTarget.Dispose(); ProgressBarCanvas.Children.Remove(removeTarget); } }); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.layout_resetpin); var trans = GetFragmentManager().BeginTransaction(); // TODO check why this exists alertinfo = new CustomDialogFragment( string.Empty, this.GetString(Resource.String.pin_reset_no_internet), this.GetString(Resource.String.go_back), null, null); string dealerSupportLine = Settings.Instance.DealerSupportLine; CustomInfoFragment.Info info = new CustomInfoFragment.Info { ActionBarTitle = Resources.GetString(Resource.String.pin_reset_fail_title), Title = Resources.GetString(Resource.String.pin_reset_fail_title), Content = string.Format(Resources.GetString(Resource.String.pin_reset_fail_msg), dealerSupportLine), PositiveButtonCaption = Resources.GetString(Resource.String.try_again), NegativeButtonCaption = Resources.GetString(Resource.String.cancel_reset) }; resetPinFailedFragment = new CustomInfoFragment(); resetPinFailedFragment.SetArgument(CustomInfoFragment.InfoKey, info); // set event handlers for failed pin resetPinFailedFragment.PositiveAction += new CustomInfoFragment.BtnClick(go); resetPinFailedFragment.NegativeAction += new CustomInfoFragment.BtnClick(GoBackToLogin); // register fragment trans.Add(Resource.Id.reset_pin_placeholder, resetPinFailedFragment, RESETPINFAILED_FRAGMENT_TAG); trans.AddToBackStack(null); trans.Hide(resetPinFailedFragment); CustomInfoFragment.Info infoSuccess = new CustomInfoFragment.Info() { ActionBarTitle = Resources.GetString(Resource.String.pin_reset_done), Title = Resources.GetString(Resource.String.pin_reset_done), Content = Resources.GetString(Resource.String.pin_reset_success_msg), PositiveButtonCaption = Resources.GetString(Resource.String.back_to_login) }; resetPinResultInfoFragment = new CustomInfoFragment(); resetPinResultInfoFragment.SetArgument(CustomInfoFragment.InfoKey, infoSuccess); resetPinResultInfoFragment.PositiveAction += new CustomInfoFragment.BtnClick(GoBackToLogin); trans.Add(Resource.Id.reset_pin_placeholder, resetPinResultInfoFragment, RESETPINRESULT_FRAGMENT_TAG); trans.AddToBackStack(null); trans.Hide(resetPinResultInfoFragment); fragmentResetPin = new ResetPinFragment(); fragmentResetPin.ButtonNextClicked += fragmentResetPin_ButtonNextClicked; trans.Add(Resource.Id.reset_pin_placeholder, fragmentResetPin, RESETPIN_FRAGMENT_TAG); trans.AddToBackStack(null); trans.Hide(fragmentResetPin); progressFragment = new ProgressFragment(); Bundle arguments = new Bundle(); arguments.PutString(ProgressFragment.TitleKey, GetString(Resource.String.reset_pin_title)); arguments.PutString(ProgressFragment.MessageKey, GetString(Resource.String.resetting_pin)); progressFragment.Arguments = arguments; trans.Add(Resource.Id.reset_pin_placeholder, progressFragment, RESETPINPROGRESS_FRAGMENT_TAG); trans.AddToBackStack(null); trans.Commit(); go(); // TODO check why we are adding all the fragments to start with and not only when needed }