void DimmingViewTapped(UIGestureRecognizer gesture) { if (gesture.State == UIGestureRecognizerState.Recognized) { PresentingViewController.DismissViewController(true, null); } }
public override void ViewDidLoad() { ButtonMainMenu.Layer.CornerRadius = 5; ButtonMainMenu.Layer.BorderWidth = 1; ButtonMainMenu.Layer.BorderColor = UIColor.White.CGColor; ButtonPlayAgain.Layer.CornerRadius = 5; ButtonPlayAgain.Layer.BorderWidth = 1; ButtonPlayAgain.Layer.BorderColor = UIColor.White.CGColor; LabelWinnerText.Font = UIFont.BoldSystemFontOfSize(26); SetWinnerText(); ButtonMainMenu.TouchUpInside += (sender, e) => { ((UINavigationController)PresentingViewController).ViewControllers = new UIViewController[] { ((UINavigationController)PresentingViewController).ViewControllers[0] }; PresentingViewController.DismissViewController(true, null); }; ButtonPlayAgain.TouchUpInside += (sender, e) => { PresentingViewController.DismissViewController(true, null); }; }
public void Dismiss(object sender, EventArgs args) { // Explicitly unregister observers because we cannot predict when the GC cleans up Unregister(); PresentingViewController?.DismissViewController(true, null); }
void Dismiss(NSObject sender) { // inform our MasterViewController we are going away Action completionHandler = MasterViewController != null ? MasterViewController.WasDismissed : (Action)null; PresentingViewController.DismissViewController(true, completionHandler); }
void OnSaveClicked(object sender, EventArgs e) { PhotoView.Image.Dispose(); PhotoView.Image = imageView.Image; PresentingViewController.DismissViewController(true, () => { }); }
public static void Init() { if (_hasInitialized) { return; } _hasInitialized = true; // Controls Registrar.Handlers.Register <ActivityIndicator, ActivityIndicatorHandler>(); Registrar.Handlers.Register <Button, ButtonHandler>(); Registrar.Handlers.Register <Image, ImageHandler>(); Registrar.Handlers.Register <ProgressBar, ProgressBarHandler>(); Registrar.Handlers.Register <SecureField, SecureFieldHandler>(); Registrar.Handlers.Register <ShapeView, ShapeViewHandler>(); Registrar.Handlers.Register <Slider, SliderHandler>(); Registrar.Handlers.Register <Stepper, StepperHandler>(); Registrar.Handlers.Register <DatePicker, DatePickerHandler>(); Registrar.Handlers.Register <Text, TextHandler>(); Registrar.Handlers.Register <TextField, TextFieldHandler>(); Registrar.Handlers.Register <Toggle, ToggleHandler>(); Registrar.Handlers.Register <RadioButton, RadioButtonHandler>(); //Registrar.Handlers.Register<WebView, WebViewHandler> (); // Containers Registrar.Handlers.Register <ContentView, ContentViewHandler>(); Registrar.Handlers.Register <ListView, ListViewHandler>(); Registrar.Handlers.Register <ScrollView, ScrollViewHandler>(); Registrar.Handlers.Register <View, ViewHandler>(); Registrar.Handlers.Register <ViewRepresentable, ViewRepresentableHandler>(); Registrar.Handlers.Register <TabView, TabViewHandler>(); // Managed Layout Registrar.Handlers.Register <HStack, HStackHandler>(); Registrar.Handlers.Register <VStack, VStackHandler>(); Registrar.Handlers.Register <ZStack, ZStackHandler>(); Registrar.Handlers.Register <Grid, GridHandler>(); Registrar.Handlers.Register <Spacer, SpacerHandler>(); Registrar.Handlers.Register <RadioGroup, RadioGroupHandler>(); // Device Features ModalView.PerformPresent = (o) => { PresentingViewController.PresentViewController(o.ToViewController(), true, null); }; ModalView.PerformDismiss = () => PresentingViewController.DismissModalViewController(true); ThreadHelper.JoinableTaskContext = new Microsoft.VisualStudio.Threading.JoinableTaskContext(); ThreadHelper.SetFireOnMainThread(_invoker.BeginInvokeOnMainThread); Device.FontService = new iOSFontService(); Device.GraphicsService = new iOSGraphicsService(); Device.BitmapService = new iOSBitmapService(); AnimationManger.SetTicker(new iOSTicker()); //Set Default Style var style = new Styles.Style(); style.Apply(); }
public override void DismissalTransitionWillBegin() { base.DismissalTransitionWillBegin(); var coordinator = PresentingViewController.GetTransitionCoordinator(); coordinator.AnimateAlongsideTransition(_ => DimmedBackgroundView.Alpha = 0, null); }
public override void PresentationTransitionWillBegin() { dimmingView.Frame = ContainerView.Bounds; ContainerView.AddSubview(dimmingView); var transitionCoordinator = PresentingViewController.GetTransitionCoordinator(); transitionCoordinator.AnimateAlongsideTransition(context => dimmingView.Alpha = 0.8f, null); }
public void FinishPickingAssets(object sender, EventArgs args) { // Explicitly unregister observers because we cannot predict when the GC cleans up Unregister(); FinishedPickingAssets?.Invoke(this, new MultiAssetEventArgs(_selectedAssets.ToArray())); PresentingViewController.DismissViewController(true, null); }
public override void PresentationTransitionWillBegin() { base.PresentationTransitionWillBegin(); ContainerView.AddSubview(DimmedBackgroundView); DimmedBackgroundView.Alpha = 0; var coordinator = PresentingViewController.GetTransitionCoordinator(); coordinator.AnimateAlongsideTransition(_ => DimmedBackgroundView.Alpha = DimmedBackgroundTranslucentAlpha, null); }
// before transition start public override void PresentationTransitionWillBegin() { if (!ContainerView.Subviews.Any()) { ContainerView.InsertSubview(_overlayView, 0); } PresentingViewController.GetTransitionCoordinator()?.AnimateAlongsideTransition( obj => _overlayView.Alpha = 1f, obj => { } ); }
public void Dismiss(object sender, EventArgs args) { // Explicitly unregister observers because we cannot predict when the GC cleans up Unregister(); var e = Canceled; if (e != null) { e(this, EventArgs.Empty); } PresentingViewController.DismissViewController(true, null); }
void Dismiss(NSObject sender) { if (Delegate != null) { Delegate.AccessoryViewControllerDidSaveAccessory(this, Accessory); } if (editingExistingAccessory) { PresentingViewController.DismissViewController(true, null); } else { NavigationController.PopViewController(true); } }
public static void Init() { if (_hasInitialized) { return; } _hasInitialized = true; // Controls Registrar.Handlers.Register <Button, ButtonHandler> (); Registrar.Handlers.Register <ProgressBar, ProgressBarHandler>(); Registrar.Handlers.Register <Image, ImageHandler>(); Registrar.Handlers.Register <TextField, TextFieldHandler> (); Registrar.Handlers.Register <Text, TextHandler> (); Registrar.Handlers.Register <SecureField, SecureFieldHandler>(); Registrar.Handlers.Register <Slider, SliderHandler>(); Registrar.Handlers.Register <ShapeView, ShapeViewHandler>(); Registrar.Handlers.Register <Toggle, ToggleHandler>(); Registrar.Handlers.Register <ActivityIndicator, ActivityIndicatorHandler>(); //Registrar.Handlers.Register<WebView, WebViewHandler> (); // Containers Registrar.Handlers.Register <ContentView, ContentViewHandler>(); Registrar.Handlers.Register <ListView, ListViewHandler>(); Registrar.Handlers.Register <ScrollView, ScrollViewHandler> (); Registrar.Handlers.Register <View, ViewHandler> (); Registrar.Handlers.Register <ViewRepresentable, ViewRepresentableHandler>(); Registrar.Handlers.Register <TabView, TabViewHandler>(); // Managed Layout Registrar.Handlers.Register <HStack, HStackHandler>(); Registrar.Handlers.Register <VStack, VStackHandler>(); Registrar.Handlers.Register <ZStack, ZStackHandler>(); Registrar.Handlers.Register <Grid, GridHandler>(); Registrar.Handlers.Register <Spacer, SpacerHandler>(); // Device Features ModalView.PerformPresent = (o) => { PresentingViewController.PresentViewController(o.ToViewController(), true, null); }; ModalView.PerformDismiss = () => PresentingViewController.DismissModalViewController(true); // Device Features Device.PerformInvokeOnMainThread = _invoker.BeginInvokeOnMainThread; Device.FontService = new iOSFontService(); Device.GraphicsService = new iOSGraphicsService(); Device.BitmapService = new iOSBitmapService(); }
partial void done(UIKit.UIBarButtonItem sender) { Settings.DebuggingEnabled = debuggingEnabledSwitch.On; Settings.CellSize = cellSizeStepper.Value; Settings.MarginFactor = marginFactorStepper.Value; Settings.GroupingEnabled = groupingEnabledSwitch.On; Settings.SettingsDataSet = (SettingsDataSet)SelectedRowForSection(SECTION_DATA_SET); Settings.SettingsClusterer = (SettingsClusterer)SelectedRowForSection(SECTION_CLUSTERER); Settings.MaxZoomLevelForClustering = maxZoomLevelStepper.Value; Settings.MinUniqueLocationsForClustering = (uint)minUniqueLocationsStepper.Value; Settings.SettingsAnimator = (SettingsAnimator)SelectedRowForSection(SECTION_ANIMATOR); Completed?.Invoke(this, Settings.Clone()); PresentingViewController.DismissViewController(true, null); }
public override void PresentationTransitionWillBegin() { UIView presentedViewControllerView = base.PresentedView; presentationWrapperView = new UIView(FrameOfPresentedViewInContainerView); presentationWrapperView.Layer.ShadowOpacity = .44f; presentationWrapperView.Layer.ShadowRadius = 13f; presentationWrapperView.Layer.ShadowOffset = new CGSize(0f, -6f); var presentationRoundedCornerView = new UIView(UIEdgeInsetsInsetRect(presentationWrapperView.Bounds, new UIEdgeInsets(0F, 0F, -cornerRadius, 0))); presentationRoundedCornerView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; presentationRoundedCornerView.Layer.CornerRadius = cornerRadius; presentationRoundedCornerView.Layer.MasksToBounds = true; var presentedViewControllerWrapperView = new UIView(UIEdgeInsetsInsetRect(presentationRoundedCornerView.Bounds, new UIEdgeInsets(0F, 0F, cornerRadius, 0F))); presentedViewControllerWrapperView.AutoresizingMask = (UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight); presentedViewControllerView.AutoresizingMask = (UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight); presentedViewControllerView.Frame = presentedViewControllerWrapperView.Bounds; presentedViewControllerWrapperView.AddSubview(presentedViewControllerView); presentationRoundedCornerView.AddSubview(presentedViewControllerWrapperView); presentationWrapperView.AddSubview(presentationRoundedCornerView); var dimmingViewAux = new UIView(ContainerView.Frame) { BackgroundColor = UIColor.Black, Opaque = false, AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight }; dimmingView = dimmingViewAux; var tapGesture = new UITapGestureRecognizer(); tapGesture.AddTarget(() => DimmingViewTapped(tapGesture)); dimmingView.AddGestureRecognizer(tapGesture); ContainerView.AddSubview(dimmingView); var transitionCoordinator = PresentingViewController.GetTransitionCoordinator(); dimmingView.Alpha = 0f; transitionCoordinator.AnimateAlongsideTransition((obj) => dimmingView.Alpha = .5f, (obj) => {}); }
public override void ViewDidAppear(bool animated) { if (RdioClient.SharedClient.IsAuthorized) { // After the user authenticates with the Rdio login screen we're done PresentingViewController.DismissViewController(false, null); } else if (!string.IsNullOrEmpty(RdioClient.SharedClient.AuthToken)) { // On first launch if the user has previously authenticated RdioClient.SharedClient.AuthorizeWithToken(RdioClient.SharedClient.AuthToken); } else { // On first launch with no authentication stored View.AddSubview(loginButton); } }
public LoginScreenController(RectangleF frame) { View = new UIView(frame); View.AddSubview(new UIImageView(UIImage.FromFile("purple.png"))); float width = frame.Width; float delta = 20f; float buttonWidth = width - (2 * delta); float buttonHeigth = 2 * delta; loginButton = UIButton.FromType(UIButtonType.RoundedRect); loginButton.Frame = new RectangleF(delta, delta, buttonWidth, buttonHeigth); loginButton.SetTitle("Login to Rdio", UIControlState.Normal); loginButton.SetTitleColor(UIColor.Black, UIControlState.Normal); loginButton.TouchUpInside += (sender, e) => { RdioClient.SharedClient.AuthorizeFromController(this); }; RdioClient.SharedClient.AuthorizeRequestCompleted += (state) => { switch (state) { case AuthorizeState.Authorized: PresentingViewController.DismissViewController(false, null); break; case AuthorizeState.Failed: new UIAlertView("Authentication Failed", "Failed to login to Rdio", null, "ok", null).Show(); this.View.AddSubview(loginButton); break; case AuthorizeState.Cancelled: new UIAlertView("Authentication Cancelled", "You cancelled your authentication", null, "ok", null).Show(); PresentingViewController.DismissViewController(false, null); break; default: break; } }; }
public override void ViewDidLoad() { base.ViewDidLoad(); TableView.BackgroundColor = UIColor.FromRGB(238 / 255.0f, 91 / 255.0f, 51 / 255.0f); TableView.RegisterClassForCellReuse(typeof(TextFieldCell), "TextFieldCell"); TableView.RowHeight = UITableView.AutomaticDimension; TableView.TableFooterView = new UIView(); logoCell = new ImageCell(); logoCell .CloseStream .Subscribe(_ => PresentingViewController.DismissViewController(true, null)) .AddTo(disposables); buttonCell = new ButtonCell(); buttonCell .ActionStream .SelectMany(_ => SignupManager.SignUp(api, null)) .ObserveOn(SynchronizationContext.Current) .Subscribe(Succeed) .AddTo(disposables); }
public override void DismissalTransitionWillBegin() { var transitionCoordinaotr = PresentingViewController.GetTransitionCoordinator(); transitionCoordinaotr.AnimateAlongsideTransition(context => dimmingView.Alpha = 0.0f, null); }
public override bool PrefersStatusBarHidden() { return(PresentingViewController?.PrefersStatusBarHidden() ?? UIApplication.SharedApplication.StatusBarHidden); }
public override UIStatusBarStyle PreferredStatusBarStyle() { return(PresentingViewController?.PreferredStatusBarStyle() ?? UIApplication.SharedApplication.StatusBarStyle); }
void Cancel() { PresentingViewController.DismissModalViewController(true); }
public void DismissButtonTapped(UIButton sender) { PresentingViewController.DismissViewController(true, null); }
partial void CloseButton_Activated(UIBarButtonItem sender) { PresentingViewController.DismissViewController(true, null); }
void DismissChangePasswordSuccessAlertView() { PresentingViewController.DismissViewController(true, null); }
void CancelChangePasswordAction(object sender, EventArgs e) { PresentingViewController.DismissViewController(true, null); //go back to login view AppDisplayUtil.Instance.GoToLoginView(); }
public override void DismissalTransitionWillBegin() { var transitionCoordinator = PresentingViewController.GetTransitionCoordinator(); transitionCoordinator.AnimateAlongsideTransition((obj) => dimmingView.Alpha = 0f, (obj) => { }); }
void DimmingViewTapped(UITapGestureRecognizer sender) { PresentingViewController.DismissViewController(true, null); }
partial void cancel(UIKit.UIBarButtonItem sender) { PresentingViewController.DismissViewController(true, null); }