protected override void OnElementChanged (VisualElementChangedEventArgs e)
		{
			base.OnElementChanged (e);

			this.ScrollView.ScrollEnabled = false;
			this.ScrollView.Bounces = false;
		}
Exemplo n.º 2
0
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);

            //Xamarin.Formのコントロール(ExWebView)
            var exWebView = e.NewElement as ExWebView;
            //ネイティブコントロール(MonoTouch.UIKit.UIWebView)
            //var webView = this;

            // これは、例外で落ちるため使用できない
            //webView.ShouldStartLoad = (w, request, naviType) => {
            //    //イベントをForms側に送る
            //    exWebView.OnNavigate(request.Url.AbsoluteString);
            //    return true;
            //};

            //if(e.OldElement == null) { // perform initial setup
            //    base.Delegate = new MyWebViewDelegate(webView) { ExWebView = exWebView };
            //}

            if (exWebView.DeleteCookie) {
                //クッキー(ログイン情報)の削除
                var storage = NSHttpCookieStorage.SharedStorage;
                foreach (var cookie in storage.Cookies) {
                    storage.DeleteCookie(cookie);
                }
            }
        }
        protected async override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            // Call the method on the base
            base.OnElementChanged(e);

            // Exit if the element (Page) is null
            if (e.OldElement != null || Element == null)
            {
                return;
            }

            // Set up the AuthenticationManager to challenge for ArcGIS Online credentials
            UpdateAuthenticationManager();

            // Force an OAuth challenge
            var info = new CredentialRequestInfo
            {
                AuthenticationType = AuthenticationType.Token,
                ServiceUri = new Uri(OAuthPage.PortalUrl)
            };
            await AuthenticationManager.Current.GetCredentialAsync(info, false);

            // Open the desired web map (portal item)
            ArcGISPortal portal = await ArcGISPortal.CreateAsync(new Uri(OAuthPage.PortalUrl));
            PortalItem item = await PortalItem.CreateAsync(portal, OAuthPage.WebMapId);

            // Create a map
            Map myMap = new Map(item);

            // Set the MyMap property on the shared form to display the map in the map view
            var oauthPage = e.NewElement as OAuthPage;
            oauthPage.MyMap = myMap;
        }
		protected async override void OnElementChanged (VisualElementChangedEventArgs e)
		{
			base.OnElementChanged (e);

			navigation = NavigationController;

			window = new UIWindow(UIScreen.MainScreen.Bounds);

			//This is the class which actually implements the component a couple of elements to make it work
			viewController = new JSQmessages(); 


			//sender is a public field of JSQmessages and it is populated using the public fields we defined in the orginal forms ChatPage.
			viewController.sender = new User (){ Id = ChatPage.senderID, DisplayName = ChatPage.senderName };

			viewController.View.Frame = this.View.Frame;

			navigationController = new UINavigationController();
			navigationController.PushViewController(viewController, false);

			AddChildViewController (viewController);

			/*the Frame is smaller than the entire screen, this lets us still retain the original Navigation bar from Xamarin Forms, 
			 * so it's easy to dismiss the page from the view hierarchy if we retain the navbar that forms created for us */
			viewController.View.Frame = new CGRect(this.View.Frame.X,this.View.Frame.Y,this.View.Bounds.Width,this.View.Bounds.Height - 64f);
			this.View.AddSubview (viewController.View);
			this.DidMoveToParentViewController (viewController); 



		} 
		protected override void OnElementChanged (VisualElementChangedEventArgs e)
		{
			base.OnElementChanged (e);

		

		}
		protected override void OnElementChanged (VisualElementChangedEventArgs e)
		{
			base.OnElementChanged (e);

			if (e.OldElement == null)
				((UIScrollView)NativeView).DelaysContentTouches = false;
		}
 protected override void OnElementChanged(VisualElementChangedEventArgs e)
 {
     base.OnElementChanged (e);
     if (e == null || e.NewElement == null)
         return;
     ModalPresentationStyle = UIModalPresentationStyle.Custom;
 }
		protected override void OnElementChanged (VisualElementChangedEventArgs e)
		{
			base.OnElementChanged (e);

			if (e.NewElement != null) {
				tabbedController = (UITabBarController)ViewController;
			}

			if (!isInitialized) {

				rightGesture = new UISwipeGestureRecognizer (swipe => {
					//Check to make sure we aren't at the last view
					Console.WriteLine ("Swipe Left");
					if(this.SelectedIndex != ViewControllers.Length - 1)
						tabbedController.SelectedViewController = ViewControllers [this.SelectedIndex + 1];
				}) {
					Direction = UISwipeGestureRecognizerDirection.Left
				};

				leftGesture = new UISwipeGestureRecognizer (swipe => {
					//Check to make sure we aren't at the first view
					Console.WriteLine ("Swipe Right");
					if(this.SelectedIndex != 0)
						tabbedController.SelectedViewController = ViewControllers [this.SelectedIndex - 1];
				}) {
					Direction = UISwipeGestureRecognizerDirection.Right
				};

				View.AddGestureRecognizer (rightGesture);
				View.AddGestureRecognizer (leftGesture);

				isInitialized = true;
			}
		}
		protected override void OnElementChanged (VisualElementChangedEventArgs e)
		{
			base.OnElementChanged (e);

			_page = (GesturedContentPage)e.NewElement;

			// Subscribe to the events here
			if (_page.CaptureSwipeRightToLeft) {
				NativeView.AddGestureRecognizer (new UISwipeGestureRecognizer (g => _page.OnSwipeRightToLeft()) { Direction = UISwipeGestureRecognizerDirection.Left });
			}

			if (_page.CaptureSwipeLeftToRight) {
				NativeView.AddGestureRecognizer (new UISwipeGestureRecognizer (g => _page.OnSwipeLeftToRight()) { Direction = UISwipeGestureRecognizerDirection.Right });
			}

			if (_page.CaptureSwipeBottomToTop) {
				NativeView.AddGestureRecognizer (new UISwipeGestureRecognizer (g => _page.OnSwipeBottomToTop()) { Direction = UISwipeGestureRecognizerDirection.Up });
			}

			if (_page.CaptureSwipeTopToBottom) {
				NativeView.AddGestureRecognizer (new UISwipeGestureRecognizer (g => _page.OnSwipeTopToBottom()) { Direction = UISwipeGestureRecognizerDirection.Down });
			}

			if (_page.CaptureTap) {
				NativeView.AddGestureRecognizer (new UITapGestureRecognizer (g => _page.OnTap()) { NumberOfTapsRequired = 1 });
			}

			if (_page.CaptureLongTap)
			{
				NativeView.AddGestureRecognizer (new UILongPressGestureRecognizer (g => _page.OnLongTap()));
			}
		}
		protected override void OnElementChanged (VisualElementChangedEventArgs e)
		{
			base.OnElementChanged (e);

			if (e.OldElement != null || Element == null) {
				return;
			}

			try {
				app = Application.Current;
				app.Suspending += OnAppSuspending;
				app.Resuming += OnAppResuming;

				HardwareButtons.BackPressed += OnBackButtonPressed;

				var container = ContainerElement as Canvas;

				SetupUserInterface ();
				SetupEventHandlers ();
				SetupLiveCameraStream ();
				container.Children.Add (page);
			} catch (Exception ex) {
				Debug.WriteLine (@"      ERROR: ", ex.Message);
			}
		}
Exemplo n.º 11
0
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged (e);

            if (e.OldElement != null || Element == null) {
                return;
            }
        }
Exemplo n.º 12
0
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged (e);
            var pclControl = (BaseUrlWebView)e.NewElement;
            var html = (pclControl.Source as HtmlWebViewSource).Html;

            this.Delegate = new browserDelegate (pclControl);
        }
		protected override void OnElementChanged (VisualElementChangedEventArgs e)
		{
			base.OnElementChanged (e);

			if (e.NewElement != null) {
				formsWebView = e.NewElement as WebView;
				Delegate = new CustomWebViewDelegate (formsWebView);
			}
		}
Exemplo n.º 14
0
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);

            if (e.OldElement == null)
            {
                Delegate = new WebViewDelegate(CookieWebView);
            }
        }
Exemplo n.º 15
0
 protected override void OnElementChanged(VisualElementChangedEventArgs e)
 {
     var page = e.NewElement as Page;
     if (page != null) {
         _secondaryItems = page.ToolbarItems.Where (i => i.Order == ToolbarItemOrder.Secondary).ToList ();
         _secondaryItems.ForEach (t => page.ToolbarItems.Remove (t));
     }
     base.OnElementChanged (e);
 }
Exemplo n.º 16
0
 protected override void OnElementChanged(VisualElementChangedEventArgs e)
 {
     base.OnElementChanged (e);
     if (e.NewElement is SignInPage) {
         signInPage = ((SignInPage)e.NewElement);
     } else if (e.NewElement is SignUpPage) {
         signUpPage = ((SignUpPage)e.NewElement);
     }
 }
Exemplo n.º 17
0
			protected override void OnElementChanged(VisualElementChangedEventArgs e)
			{
				base.OnElementChanged(e);
				_page = e.NewElement as LoginPage;
				_nativeView = NativeView;

			  //App.Instance.NavigationPage.PopAsync ();

			}
		protected override void OnElementChanged(VisualElementChangedEventArgs e)
		{
			base.OnElementChanged(e);

			//Set UITabBar colors
			TabBar.TintColor = AppConfigConstants.AppTheme.ColorTabbarSelectedItem.ToUIColor ();
			TabBar.BarTintColor = AppConfigConstants.AppTheme.ColorTabbarBackground.ToUIColor ();
			TabBar.BackgroundColor = AppConfigConstants.AppTheme.ColorTabbarUnselectedItem.ToUIColor ();
		}
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged (e);

            mainView = e.NewElement as MainView;
            if (mainView != null) {

            }
        }
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);

            if (e.OldElement == null)
            {
                //NavigationBar.Hidden = true;
            }
        }
        protected override void OnElementChanged (VisualElementChangedEventArgs e)
        {
            base.OnElementChanged (e);

            if (e.OldElement != null) return;

            _native = (UIScrollView)NativeView;
            _native.Scrolled += NativeScrolled;
            e.NewElement.PropertyChanged += ElementPropertyChanged;
        }
        private void NavigationPageRender_ElementChanged(object sender, VisualElementChangedEventArgs e) {
            if (e.NewElement != null) {
                this.Element.BarBackgroundColor = Color.FromRgb(0x00, 0xbc, 0xd4);// new Color(0x00, 0xBC, 0xD4, 0xff);//#00BCD4
                this.Element.Pushed -= Element_Pushed;
                this.Element.Pushed += Element_Pushed;

                this.Element.PoppedToRoot += Element_PoppedToRoot;
                this.Element.Popped += Element_Popped;
            }
        }
Exemplo n.º 23
0
		protected override void OnElementChanged (VisualElementChangedEventArgs e)
		{
			base.OnElementChanged (e);

			// Set Text Font for unselected tab states
			UITextAttributes normalTextAttributes = new UITextAttributes();
			normalTextAttributes.Font = UIFont.FromName("ChalkboardSE-Light", 9.0F); // unselected

			UITabBarItem.Appearance.SetTitleTextAttributes(normalTextAttributes, UIControlState.Normal);
		}
Exemplo n.º 24
0
        protected override void OnElementChanged (VisualElementChangedEventArgs e)
        {
            base.OnElementChanged (e);

            if (e.OldElement != null || Element == null)
                return;

            page = e.NewElement as LoginPage;

        }
		protected override void OnElementChanged (VisualElementChangedEventArgs e)
		{
			base.OnElementChanged (e);

			if (e.NewElement != null) {
				var customWebView = Element as CustomWebView;
				string fileName = Path.Combine (NSBundle.MainBundle.BundlePath, string.Format ("Content/{0}", customWebView.Uri));
				LoadRequest (new NSUrlRequest (new NSUrl (fileName, false)));
				ScalesPageToFit = true;
			}
		}
Exemplo n.º 26
0
		protected override void OnElementChanged(VisualElementChangedEventArgs e)
		{
			base.OnElementChanged(e);

			if (e.OldElement == null) {
				this.MaximumZoomScale = 4f;
				this.MinimumZoomScale = 1f;
				this.ViewForZoomingInScrollView += (UIScrollView sv) => this.Subviews[0];
				this.DidZoom += UpdateZoom;
			}
		}
 protected override void OnElementChanged(VisualElementChangedEventArgs e)
 {
     base.OnElementChanged (e);
     /*
     if ((e.NewElement as NavigationPage).CurrentPage is myimagomenu) {
         IsMenu = true;
     } else {
         IsMenu = false;
     }
     */
 }
 protected override void OnElementChanged(VisualElementChangedEventArgs e)
 {
     base.OnElementChanged(e);
     var version = new Version(MonoTouch.Constants.Version);
     if (version >= new Version(8, 0))
     {
         this.PreferredDisplayMode = ShouldHide ?
             UISplitViewControllerDisplayMode.PrimaryHidden :
             UISplitViewControllerDisplayMode.Automatic;
     }
 }
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged (e);

            if (e.OldElement == null) // perform initial setup
            {
                var gradientLayer = new CAGradientLayer ();
                gradientLayer.Frame = View.Bounds;
                gradientLayer.Colors = new CGColor[] {Color.FromHex("#a8d7ec").ToCGColor(), Color.FromHex("#3da0c7").ToCGColor()};
                View.Layer.InsertSublayer (gradientLayer, 0);
            }
        }
Exemplo n.º 30
0
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged (e);
            UIImagePickerController imagePicker = new UIImagePickerController ();

            imagePicker.SourceType = UIImagePickerControllerSourceType.PhotoLibrary;

            imagePicker.MediaTypes = UIImagePickerController.AvailableMediaTypes (UIImagePickerControllerSourceType.PhotoLibrary);
            imagePicker.FinishedPickingMedia += ImagePicker_FinishedPickingMedia;
            imagePicker.Canceled += ImagePicker_Canceled;

            View.Add (imagePicker.View);
        }
Exemplo n.º 31
0
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);

            RemoveBorderLine();
        }
Exemplo n.º 32
0
        //private static readonly TaskScheduler UIScheduler = TaskScheduler.FromCurrentSynchronizationContext();

        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);

            viewModel = new LoginWithGmailViewModel();

            // this is a ViewGroup - so should be able to load an AXML file and FindView<>
            //var activity = this.Context as Activity;

            if (Constant.IsGoogleLogin)
            {
                auth = new OAuth2Authenticator(
                    //clientId: "858089811668-dk50ujvabh8aqr3ek5r60q24p1adep97.apps.googleusercontent.com",
                    clientId: "380694676532-barrtug4jpe6gcmhk7a02odeos1bvnk0.apps.googleusercontent.com",
                    scope: "https://www.googleapis.com/auth/userinfo.email",                // The scopes for the particular API you're accessing. The format for this will vary by API.
                    authorizeUrl: new Uri("https://accounts.google.com/o/oauth2/auth"),     // the auth URL for the service
                    redirectUrl: new Uri("https://www.googleapis.com/plus/v1/people/me"));  // the redirect URL for the service


                auth.Completed += async(sender, eventArgs) =>
                {
                    if (eventArgs.IsAuthenticated)
                    {
                        var accessToken = eventArgs.Account.Properties["access_token"].ToString();
                        UserDialogs.Instance.ShowLoading();
                        //App.Instance.SuccessfulLoginAction.Invoke();
                        // Use eventArgs.Account to do wonderful things
                        App.Instance.SaveToken(eventArgs.Account.Properties["access_token"]);

                        // Now that we're logged in, make a OAuth2 request to get the user's info.
                        var request = new OAuth2Request("GET", new Uri("https://www.googleapis.com/oauth2/v2/userinfo"), null, eventArgs.Account);
                        //var request = new OAuth2Request("GET", new Uri(Constants.UserInfoUrl), null, e.Account);
                        var response = await request.GetResponseAsync();

                        if (response != null)
                        {
                            string userJson = response.GetResponseText();//All details of User in Json format which can be used further(can be stored in Manager and shown in view).
                            var    obj      = JsonValue.Parse(userJson);
                            viewModel.FirstName   = (string)obj["given_name"];
                            viewModel.LastName    = (string)obj["family_name"];
                            viewModel.Email       = (string)obj["email"];
                            viewModel._Base64_Img = (string)obj["picture"];

                            if (!string.IsNullOrEmpty(accessToken))
                            {
                                viewModel.AccessToken = accessToken;
                                // viewModel.GoogleCommand.Execute(this);
                            }
                            //App.Instance.UserName = viewModel.FirstName + " " + viewModel.LastName;

                            App.baseUser.FirstName   = viewModel.FirstName;
                            App.baseUser.LastName    = viewModel.LastName;
                            App.baseUser.EmailId     = viewModel.Email;
                            App.baseUser.UserImage   = viewModel._Base64_Img;
                            App.baseUser.AccessToken = viewModel.AccessToken;
                            Constant.IsGoogleLogin   = false;
                            App.Instance.SuccessfulLoginAction.Invoke();
                        }
                        else
                        {
                            // The user cancelled
                        }
                    }
                    else
                    {
                        Constant.IsGoogleLogin = false;
                    }
                };
            }
            else if (Constant.IsFacebookLogin)
            {
                auth = new OAuth2Authenticator(
                    clientId: "384018465086414",
                    scope: "email",
                    authorizeUrl: new Uri("https://m.facebook.com/dialog/oauth/"),
                    redirectUrl: new Uri("http://www.facebook.com/connect/login_success.html"));

                //auth.AllowCancel = allowCancel;

                auth.Completed += async(sender, eventArgs) =>
                {
                    if (eventArgs.IsAuthenticated)
                    {
                        var accessToken = eventArgs.Account.Properties["access_token"].ToString();
                        UserDialogs.Instance.ShowLoading();
                        //App.Instance.SuccessfulLoginAction.Invoke();
                        // Use eventArgs.Account to do wonderful things
                        App.Instance.SaveToken(eventArgs.Account.Properties["access_token"]);

                        // Now that we're logged in, make a OAuth2 request to get the user's info.
                        var request = new OAuth2Request("GET", new Uri("https://graph.facebook.com/me/"), null, eventArgs.Account);
                        //var request = new OAuth2Request("GET", new Uri(Constants.UserInfoUrl), null, e.Account);
                        var response = await request.GetResponseAsync();

                        if (response != null)
                        {
                            string userJson = response.GetResponseText();//All details of User in Json format which can be used further(can be stored in Manager and shown in view).
                            var    obj      = JsonValue.Parse(userJson);

                            viewModel.FirstName   = (string)obj["first_name"];
                            viewModel.LastName    = (string)obj["last_name"];
                            viewModel.Email       = (string)obj["email"];
                            viewModel._Base64_Img = "https://graph.facebook.com/" + (string)obj["id"] + "/picture";

                            if (!string.IsNullOrEmpty(accessToken))
                            {
                                viewModel.AccessToken = accessToken;
                                // viewModel.GoogleCommand.Execute(this);
                            }

                            //App.Instance.UserName = viewModel.FirstName + " " + viewModel.LastName;
                            App.baseUser.FirstName   = viewModel.FirstName;
                            App.baseUser.LastName    = viewModel.LastName;
                            App.baseUser.EmailId     = viewModel.Email;
                            App.baseUser.UserImage   = viewModel._Base64_Img;
                            App.baseUser.AccessToken = viewModel.AccessToken;
                            Constant.IsFacebookLogin = false;
                            App.Instance.SuccessfulLoginAction.Invoke();
                        }
                        else
                        {
                            // The user cancelled
                        }
                    }
                    else
                    {
                        Constant.IsFacebookLogin = false;
                    }
                };
            }

            //activity.StartActivity(auth.GetUI(activity));
        }
Exemplo n.º 33
0
 protected override void OnElementChanged(VisualElementChangedEventArgs e)
 {
     base.OnElementChanged(e);
     TabBar.BackgroundColor = ((Color)App.GetResourceValue("TabsColor")).ToUIColor();
 }
 protected override void OnElementChanged(VisualElementChangedEventArgs e)
 {
     base.OnElementChanged(e);
     this.Opaque          = false;
     this.BackgroundColor = UIColor.Clear;
 }
Exemplo n.º 35
0
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);

            //this.View.GestureRecognizers = new UIGestureRecognizer[0]; // Stop dissmis keyboard.
        }
 protected override void OnElementChanged(VisualElementChangedEventArgs e)
 {
     base.OnElementChanged(e);
     UpdateScrollView();
 }
 protected override void OnElementChanged(VisualElementChangedEventArgs e)
 {
     base.OnElementChanged(e);
     ScrollEnabled = ((CustomScrollView)e.NewElement).IsScrollEnabled;
     ((CustomScrollView)e.NewElement).PropertyChanged += OnPropertyChanged;
 }
Exemplo n.º 38
0
 // bool zoomEnabled = false;
 protected override void OnElementChanged(VisualElementChangedEventArgs e)
 {
     base.OnElementChanged(e);
     MaximumZoomScale = 3f;
     MinimumZoomScale = 1.0f;
 }
Exemplo n.º 39
0
 private void CustomTabRenderer_ElementChanged(object sender, VisualElementChangedEventArgs e)
 {
     Control.HeaderTemplate = GetStyledTitleTemplate();
     //Control.
 }
 protected override void OnElementChanged(VisualElementChangedEventArgs e)
 {
     base.OnElementChanged(e);
     mScaleDetector = new ScaleGestureDetector(Context, this);
 }
Exemplo n.º 41
0
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);
            page = e.NewElement as AuthLoginPage;
            auth = page.authenticator;

            auth.Completed += (sender, eventArgs) => {
                if (eventArgs.IsAuthenticated)
                {
                    if (eventArgs.Account.Properties.Count == 3)
                    {
                        Settings.FacebookUsername = eventArgs.Account.Username;

                        Settings.FacebookState       = eventArgs.Account.Properties["state"];
                        Settings.FacebookAccessToken = eventArgs.Account.Properties["access_token"];
                        Settings.FacebookExpiresIn   = eventArgs.Account.Properties["expires_in"];

                        Dictionary <string, string> _properties = new Dictionary <string, string>();

                        _properties.Add("state", Settings.FacebookState);
                        _properties.Add("access_token", Settings.FacebookAccessToken);
                        _properties.Add("expires_in", Settings.FacebookExpiresIn);

                        Account _account = new Account(Settings.FacebookUsername, _properties);
                        AccountData.FacebookAccount = _account;

                        page.FacebookLoginAction.Invoke();
                    }
                    else if (eventArgs.Account.Properties.Count == 4)
                    {
                        Settings.GoogleUsername = eventArgs.Account.Username;

                        Settings.GoogleAccessToken = eventArgs.Account.Properties["access_token"];
                        Settings.GoogleExpiresIn   = eventArgs.Account.Properties["expires_in"];
                        Settings.GoogleIDToken     = eventArgs.Account.Properties["id_token"];
                        Settings.GoogleTokenType   = eventArgs.Account.Properties["token_type"];

                        Dictionary <string, string> _properties = new Dictionary <string, string>();

                        _properties.Add("access_token", Settings.GoogleAccessToken);
                        _properties.Add("expires_in", Settings.GoogleExpiresIn);
                        _properties.Add("id_token", Settings.GoogleIDToken);
                        _properties.Add("token_type", Settings.GoogleTokenType);

                        Account _account = new Account(Settings.GoogleUsername, _properties);
                        AccountData.GoogleAccount = _account;

                        page.GoogleLoginAction.Invoke();
                    }
                    else
                    {
                        page.FailedLoginAction.Invoke();
                    }

                    DismissViewController(true, null);
                }
                else
                {
                    page.FailedLoginAction.Invoke();
                }
            };
        }
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);

            Element.PropertyChanged += Element_PropertyChanged;
        }
Exemplo n.º 43
0
 protected virtual void OnElementChanged(VisualElementChangedEventArgs e) => ElementChanged?.Invoke(this, e);
Exemplo n.º 44
0
 protected override void OnElementChanged(VisualElementChangedEventArgs e)
 {
     base.OnElementChanged(e);
 }
Exemplo n.º 45
0
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);

            OverrideUserInterfaceStyle = UIUserInterfaceStyle.Light;
        }
 private void OnRendererElementChanged(object sender, VisualElementChangedEventArgs e)
 {
     SetVisualElement(e.OldElement, e.NewElement);
 }
Exemplo n.º 47
0
 private void RaiseElementChanged(VisualElementChangedEventArgs args)
 {
     ElementChanged?.Invoke(this, args);
     OnElementChanged(this, args);
 }
Exemplo n.º 48
0
 protected virtual void OnElementChanged(object sender, VisualElementChangedEventArgs args)
 {
 }
Exemplo n.º 49
0
 protected override void OnElementChanged(VisualElementChangedEventArgs e)
 {
     base.OnElementChanged(e);
     page = e.NewElement as SignIn;
     svm  = page.BindingContext as SignInViewModel;
 }
 void OnElementChanged(VisualElementChangedEventArgs e)
 {
     ElementChanged?.Invoke(this, e);
 }
Exemplo n.º 51
0
 protected override void OnElementChanged(VisualElementChangedEventArgs e)
 {
     base.OnElementChanged(e);
     NavigationBar.SetBackgroundImage(new UIImage(), UIBarMetrics.Default);
     NavigationBar.ShadowImage = new UIImage();
 }
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);

            if (e.OldElement != null || Element == null)
            {
                return;
            }

            listItems = ((ScanPage)Element).AllItems;
            try { editListIndex = int.Parse(((ScanPage)Element).editListIndex.ToString()); } catch { }
            try { editItemIndex = int.Parse(((ScanPage)Element).editItemIndex.ToString()); } catch { }

            scanner = new Scanner();

            /*
             * Customize the scanner by using options below
             */

            /* Select desired scanner interface orientation
             * Available options are: LandscapeLeft, LandscapeRight, Portrait, All; Default: LandscapeLeft
             */
            scanner.setInterfaceOrientation("All");

            /* Toggle visibility of Flash button
             * Available options are: true, false; Default: true
             */
            //scanner.useFlash = true;

            /* Toggle high resolution scanning - 1280x720 vs normal resolution scaning - 640x480
             * Available options are: true, false; Default: true
             */
            //scanner.useHiRes = true;

            /* Choose between overlay types
             * Available options are: OM_NONE, OM_MW (dynamic viewfinder), OM_IMAGE (static image overlay), OM_VIEW (custom view overlay); Default: OM_MW
             */
            /*
             *          scanner.overlayMode = ScannerBase.OM_VIEW;
             *          UILabel label = new UILabel(new CGRect(50,50,200,50));
             *          label.Text = "MW Barcode Scanner";
             *          MWOverlay.overlayView = label;
             */

            /* Toggle visibility of Zoom button
             * Available options are: true, false; Default: true
             */
            //scanner.useZoom = true;

            /* Choose desired zoom levels
             * zoomLevel1, zoomLevel2 - zoom level in % ; Default: 150,300
             * initialZoomLevel       - the initial zoom level index; Available options: 0 (no zoom), 1, 2; Default: 0
             */
            //scanner.setZoomLevels(200, 400, 1);

            /* Set the number of CPU cores to be used
             * Available options are: 1,2; Default 2
             */
            //scanner.setMaxThreads(1);

            /* Use 60 fps preview if available
             * Available options are: true, false; Default: false;
             */
            //scanner.use60fps = true;

            /*
             * Set custom button frame
             */
            // Defaults:
            // scanner.setFlashButtonFrame(new CGRect(this.View.Frame.Size.Width-64,0,64,64));
            // scanner.setCloseButtonFrame(new CGRect(0,0,64,64));
            // scanner.setZoomButtonFrame(new CGRect(this.View.Frame.Size.Width-64,this.View.Frame.Size.Height-64,64,64));

            /* Show on screen location of scanned code
             * Available options are: true, false; Default: true;
             *
             * Customise line width and line color with the provided params below
             */
            // scanner.enableShowLocation = false;
            // MWOverlay.locationLineColor = 0xff0000;
            // MWOverlay.locationLineWidth = 2;

            /*
             * Use the front camera of the device
             *
             * Available options are: true, false; Default: false;
             *
             */
            //scanner.useFrontCamera = true;

            customDecoderInit();

            scanner.ScanWithCallback(this);
        }
Exemplo n.º 53
0
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);

            UITabBar.Appearance.TintColor = ((Color)Xamarin.Forms.Application.Current.Resources["TabTintColor"]).ToUIColor();
        }
Exemplo n.º 54
0
 protected override void OnElementChanged(VisualElementChangedEventArgs e)
 {
     base.OnElementChanged(e);
     this.BouncesZoom = false;
     this.Bounces     = false;
 }
Exemplo n.º 55
0
 protected override void OnElementChanged(VisualElementChangedEventArgs e)
 {
     base.OnElementChanged(e);
     page = e.NewElement as ExpenseCollectionView;
 }
Exemplo n.º 56
0
 protected override void OnElementChanged(VisualElementChangedEventArgs e)
 {
     base.OnElementChanged(e);
     TabBar.Translucent = false;
     TabBar.Opaque      = true;
 }
 protected override void OnElementChanged(VisualElementChangedEventArgs e)
 {
     base.OnElementChanged(e);
     this.AlwaysBounceVertical = true;
 }
Exemplo n.º 58
0
        protected override void OnElementChanged(VisualElementChangedEventArgs e)
        {
            base.OnElementChanged(e);

            System.Diagnostics.Debug.WriteLine($"{e.NewElement.GetType()} is replaced by _2489CustomRenderer");
        }
 protected override void OnElementChanged(VisualElementChangedEventArgs e)
 {
     base.OnElementChanged(e);
     page = e.NewElement as MainPage;
 }
 protected override void OnElementChanged(VisualElementChangedEventArgs e)
 {
     base.OnElementChanged(e);
     page = (PrivateChatPage)e.NewElement;
 }