Exemplo n.º 1
0
        public PanGestureGalleryPage()
        {
            var box = new Image
            {
                BackgroundColor   = Color.Gray,
                WidthRequest      = 2000,
                HeightRequest     = 2000,
                VerticalOptions   = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center
            };

            var label = new Label {
                Text = "Use two fingers to pinch. Use one finger to pan."
            };

            var panme = new PanContainer {
                Content = box
            };

            panme.PanCompleted += (s, e) =>
            {
                label.Text = e.Message;
            };

            Content = new StackLayout {
                Children = { label, panme }, Padding = new Thickness(20)
            };
        }
Exemplo n.º 2
0
        protected override void Init()
        {
            _Image = new Image {
                Source = ImageSource.FromFile("crimson.jpg"), WidthRequest = 350, HeightRequest = 350, AutomationId = ImageName
            };
            _Label = new Label {
                Text = "Press and hold the image for 1 second without moving it, then attempt to drag the image. If the image does not move, this test has failed. If this label does not display 'Success' when you have finished the pan, this test has failed."
            };

            var panView = new PanContainer()
            {
                Content = _Image,
                Panning = (s, e) =>
                {
                    _Label.Text = $"TotalX: {e.TotalX}, TotalY: {e.TotalY}";
                },
                PanningCompleted = (s, e) =>
                {
                    _Label.Text = "Success";
                }
            };

            Content = new StackLayout
            {
                Children =
                {
                    panView,
                    _Label
                }
            };
        }
Exemplo n.º 3
0
        public PanGestureGalleryPage()
        {
            var image = new Image {
                Source = "http://placehold.it/2000x2000", BackgroundColor = Color.Gray, WidthRequest = 2000, HeightRequest = 2000, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center
            };

            var panme = new PanContainer {
                Content = image
            };

            Content = new StackLayout {
                Children = { new Label {
                                 Text = "Use two fingers to pinch. Use one finger to pan."
                             }, panme }, Padding = new Thickness(20)
            };
        }
Exemplo n.º 4
0
        public MainPage4()
        {
            categoryButton = new Button
            {
                Text = "category button"
            };
            categoryButton.Clicked += Button_Clicked;


            relativeLayout = new RelativeLayout();

            relativeLayout.Children.Add(
                categoryButton,
                Constraint.RelativeToParent((parent) =>
            {
                return(parent.X + 50);
            }),
                Constraint.RelativeToParent((parent) =>
            {
                return(parent.Y + 50);
            }));

            panContainer = new PanContainer();

            relativeLayout.Children.Add(panContainer,
                                        yConstraint: Constraint.RelativeToParent(parent => parent.Y));

            panContainer.IsVisible = false;

            MessagingCenter.Subscribe <PanContainer>(this, "PanContainer_down", (sender) =>
            {
                panContainer.IsVisible = false;
            });

            Content = relativeLayout;
        }
Exemplo n.º 5
0
		public PanGestureGalleryPage ()
		{
			var image = new Image { Source = "http://placehold.it/2000x2000", BackgroundColor = Color.Gray, WidthRequest = 2000, HeightRequest = 2000, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center };

			var panme = new PanContainer { Content = image };

			Content = new StackLayout { Children = { new Label { Text = "Use two fingers to pinch. Use one finger to pan." }, panme }, Padding = new Thickness (20) };
		}