Example #1
0
        static async Task AdjustToEndAsync(ListViewBase list, ScrollViewer scrollViewer, object targetItem)
        {
            var point           = new UWPPoint(scrollViewer.HorizontalOffset, scrollViewer.VerticalOffset);
            var targetContainer = list.ContainerFromItem(targetItem) as UIElement;

            point = AdjustToEnd(point, targetContainer.DesiredSize, scrollViewer);
            await JumpToOffsetAsync(scrollViewer, point.X, point.Y);
        }
Example #2
0
        static UWPPoint AdjustToCenter(UWPPoint point, UWPSize itemSize, ScrollViewer scrollViewer)
        {
            if (IsVertical(scrollViewer))
            {
                return(AdjustToCenterVertical(point, itemSize, scrollViewer));
            }

            return(AdjustToCenterHorizontal(point, itemSize, scrollViewer));
        }
Example #3
0
        static UWPPoint AdjustToMakeVisible(UWPPoint point, UWPSize itemSize, ScrollViewer scrollViewer)
        {
            if (IsVertical(scrollViewer))
            {
                return(AdjustToMakeVisibleVertical(point, itemSize, scrollViewer));
            }

            return(AdjustToMakeVisibleHorizontal(point, itemSize, scrollViewer));
        }
Example #4
0
        void UpdateLocation()
        {
            var anchor   = new global::Windows.Foundation.Point(0.65, 1);
            var location = new Geopoint(new BasicGeoposition
            {
                Latitude  = _pin.Position.Latitude,
                Longitude = _pin.Position.Longitude
            });

            MapControl.SetLocation(this, location);
            MapControl.SetNormalizedAnchorPoint(this, anchor);
        }
Example #5
0
        async Task CreateShadowAsync()
        {
            if (Child == null || Shadow == null || Shadow.Paint == null)
            {
                return;
            }

            double width  = _shadowHostSize.Width;
            double height = _shadowHostSize.Height;

            if (height <= 0 && width <= 0)
            {
                return;
            }

            // TODO: Fix ArgumentException
            if (Clip != null)
            {
                await Task.Delay(500);
            }

            var ttv = Child.TransformToVisual(_shadowCanvas);

            global::Windows.Foundation.Point offset = ttv.TransformPoint(new global::Windows.Foundation.Point(0, 0));

            var shadowHost = new UI.Xaml.Shapes.Rectangle()
            {
                Fill   = new SolidColorBrush(UI.Colors.Transparent),
                Width  = width,
                Height = height
            };

            Canvas.SetLeft(shadowHost, offset.X);
            Canvas.SetTop(shadowHost, offset.Y);

            _shadowCanvas.Children.Insert(0, shadowHost);

            var hostVisual = ElementCompositionPreview.GetElementVisual(_shadowCanvas);
            var compositor = hostVisual.Compositor;

            _dropShadow = compositor.CreateDropShadow();
            SetShadowProperties(_dropShadow, Shadow);

            _dropShadow.Mask = await Child.GetAlphaMaskAsync();

            _shadowVisual      = compositor.CreateSpriteVisual();
            _shadowVisual.Size = new Vector2((float)width, (float)height);

            _shadowVisual.Shadow = _dropShadow;

            ElementCompositionPreview.SetElementChildVisual(shadowHost, _shadowVisual);
        }
Example #6
0
        public Point?GetLocationOnScreen(VisualElement visualElement)
        {
            var view = Platform.UWP.Platform.GetRenderer(visualElement);

            if (view?.ContainerElement == null)
            {
                return(null);
            }

            var ttv = view.ContainerElement.TransformToVisual(Window.Current.Content);

            global::Windows.Foundation.Point screenCoords = ttv.TransformPoint(new global::Windows.Foundation.Point(0, 0));

            return(new Point(screenCoords.X, screenCoords.Y));
        }
Example #7
0
        static UWPPoint AdjustToMakeVisibleHorizontal(UWPPoint point, UWPSize itemSize, ScrollViewer scrollViewer)
        {
            if (point.X > (scrollViewer.HorizontalOffset + scrollViewer.ViewportWidth))
            {
                return(AdjustToEndHorizontal(point, itemSize, scrollViewer));
            }

            if (point.X >= scrollViewer.HorizontalOffset &&
                point.X < (scrollViewer.HorizontalOffset + scrollViewer.ViewportWidth - itemSize.Width))
            {
                // The target is already in the viewport, no reason to scroll at all
                return(new UWPPoint(scrollViewer.HorizontalOffset, scrollViewer.VerticalOffset));
            }

            return(point);
        }
Example #8
0
        static async Task ScrollToTargetContainerAsync(UIElement targetContainer, ScrollViewer scrollViewer, ScrollToPosition scrollToPosition)
        {
            var transform = targetContainer.TransformToVisual(scrollViewer.Content as UIElement);
            var position  = transform?.TransformPoint(Zero);

            if (!position.HasValue)
            {
                return;
            }

            UWPPoint offset = position.Value;

            // We'll use the desired size of the item because the actual size may not be actualized yet, and
            // we'll get a very unhelpful cast exception when it tries to cast to IUIElement10(!)
            var itemSize = targetContainer.DesiredSize;

            switch (scrollToPosition)
            {
            case ScrollToPosition.Start:
                // The transform will put the container at the top of the ScrollViewer; we'll need to adjust for
                // other scroll positions
                break;

            case ScrollToPosition.MakeVisible:
                offset = AdjustToMakeVisible(offset, itemSize, scrollViewer);
                break;

            case ScrollToPosition.Center:
                offset = AdjustToCenter(offset, itemSize, scrollViewer);
                break;

            case ScrollToPosition.End:
                offset = AdjustToEnd(offset, itemSize, scrollViewer);
                break;
            }

            await AnimateToOffsetAsync(scrollViewer, offset.X, offset.Y);
        }
Example #9
0
        void HandlePinch(ManipulationDeltaRoutedEventArgs e, View view)
        {
            if (_fingers.Count < 2 || view == null)
            {
                return;
            }

            _isPinching = true;

            global::Windows.Foundation.Point translationPoint = e.Container.TransformToVisual(Container).TransformPoint(e.Position);

            var scaleOriginPoint = new Point(translationPoint.X / view.Width, translationPoint.Y / view.Height);
            IEnumerable <PinchGestureRecognizer> pinchGestures = view.GestureRecognizers.GetGesturesFor <PinchGestureRecognizer>();

            foreach (PinchGestureRecognizer recognizer in pinchGestures)
            {
                if (!_wasPinchGestureStartedSent)
                {
                    recognizer.SendPinchStarted(view, scaleOriginPoint);
                }
                recognizer.SendPinch(view, e.Delta.Scale, scaleOriginPoint);
            }
            _wasPinchGestureStartedSent = true;
        }
Example #10
0
 protected virtual object GetElementFromPointCore(global::Windows.Foundation.Point pointInWindowCoordinates)
 {
     throw new global::System.NotImplementedException("The member object AutomationPeer.GetElementFromPointCore(Point pointInWindowCoordinates) is not implemented in Uno.");
 }
Example #11
0
 public InkPoint(global::Windows.Foundation.Point position, float pressure)
 {
     global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.UI.Input.Inking.InkPoint", "InkPoint.InkPoint(Point position, float pressure)");
 }
Example #12
0
 public global::Windows.Foundation.Rect PasteFromClipboard(global::Windows.Foundation.Point position)
 {
     throw new global::System.NotImplementedException("The member Rect InkManager.PasteFromClipboard(Point position) is not implemented in Uno.");
 }
Example #13
0
 public global::System.Numerics.Vector2 UnprojectAtUnitDepth(global::Windows.Foundation.Point pixelCoordinate)
 {
     throw new global::System.NotImplementedException("The member Vector2 CameraIntrinsics.UnprojectAtUnitDepth(Point pixelCoordinate) is not implemented in Uno.");
 }
Example #14
0
 public void SetContentFromSoftwareBitmap(global::Windows.Graphics.Imaging.SoftwareBitmap softwareBitmap, global::Windows.Foundation.Point anchorPoint)
 {
     global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.UI.Xaml.DragUI", "void DragUI.SetContentFromSoftwareBitmap(SoftwareBitmap softwareBitmap, Point anchorPoint)");
 }
 public global::Windows.Foundation.Point Transform(global::Windows.Foundation.Point point)
 {
     throw null;
 }
Example #16
0
 public global::Windows.UI.Text.ITextRange GetRangeFromPoint(global::Windows.Foundation.Point point, global::Windows.UI.Text.PointOptions options)
 {
     throw new global::System.NotImplementedException("The member ITextRange RichEditTextDocument.GetRangeFromPoint(Point point, PointOptions options) is not implemented in Uno.");
 }
		internal static global::Windows.Foundation.Point[] Func_rg__Point__(
					global::System.__ComObject __this, 
					global::System.RuntimeTypeHandle __typeHnd, 
					int __targetIndex)
		{
			// Setup
			global::Windows.Foundation.Point* unsafe___value__retval = default(global::Windows.Foundation.Point*);
			global::Windows.Foundation.Point[] __value__retval = default(global::Windows.Foundation.Point[]);
			uint unsafe___value__retval_mcgLength = 0;
			int unsafe___return__;
			try
			{
				// Marshalling
				unsafe___value__retval = null;
				// Call to native method
				unsafe___return__ = global::McgInterop.ComCallHelpers.ComCall__HRESULT(
									__this, 
									__typeHnd, 
									__targetIndex, 
									&(unsafe___value__retval_mcgLength), 
									&(unsafe___value__retval)
								);
				global::System.Runtime.InteropServices.DebugAnnotations.PreviousCallContainsUserCode();
				if (unsafe___value__retval == null)
					__value__retval = null;
				else
				{
					__value__retval = new global::Windows.Foundation.Point[unsafe___value__retval_mcgLength];
					if (__value__retval != null)
						for (uint mcgIdx = 0; (mcgIdx < unsafe___value__retval_mcgLength); mcgIdx++)
						{
							// [fwd] [out] [retval] [nativebyref] [optional] [Mcg.CodeGen.BlittableValueMarshaller] Windows_Foundation_Point__Windows_Foundation__Point __value__retval
							__value__retval[mcgIdx] = unsafe___value__retval[mcgIdx];
						}
				}
				// Return
				return __value__retval;
			}
			finally
			{
				// Cleanup
				global::System.Runtime.InteropServices.ExternalInterop.SafeCoTaskMemFree(unsafe___value__retval);
			}
		}
Example #18
0
 public global::Windows.UI.Xaml.Documents.TextPointer GetPositionFromPoint(global::Windows.Foundation.Point point)
 {
     throw new global::System.NotImplementedException("The member TextPointer RichTextBlockOverflow.GetPositionFromPoint(Point point) is not implemented in Uno.");
 }
Example #19
0
 public static global::Windows.Foundation.Rect FromPoints(global::Windows.Foundation.Point point1, global::Windows.Foundation.Point point2)
 {
     throw new global::System.NotImplementedException("The member Rect RectHelper.FromPoints(Point point1, Point point2) is not implemented in Uno.");
 }
Example #20
0
 public static global::Windows.Foundation.Point Transform(global::Windows.UI.Xaml.Media.Matrix target, global::Windows.Foundation.Point point)
 {
     throw new global::System.NotImplementedException("The member Point MatrixHelper.Transform(Matrix target, Point point) is not implemented in Uno.");
 }
Example #21
0
 public static global::Windows.Foundation.Rect FromLocationAndSize(global::Windows.Foundation.Point location, global::Windows.Foundation.Size size)
 {
     throw new global::System.NotImplementedException("The member Rect RectHelper.FromLocationAndSize(Point location, Size size) is not implemented in Uno.");
 }
Example #22
0
 public void SetContentFromBitmapImage(global::Windows.UI.Xaml.Media.Imaging.BitmapImage bitmapImage, global::Windows.Foundation.Point anchorPoint)
 {
     global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.UI.Xaml.DragUI", "void DragUI.SetContentFromBitmapImage(BitmapImage bitmapImage, Point anchorPoint)");
 }
Example #23
0
 public static bool Contains(global::Windows.Foundation.Rect target, global::Windows.Foundation.Point point)
 {
     throw new global::System.NotImplementedException("The member bool RectHelper.Contains(Rect target, Point point) is not implemented in Uno.");
 }
Example #24
0
 public global::Windows.Foundation.Point UndistortPoint(global::Windows.Foundation.Point input)
 {
     throw new global::System.NotImplementedException("The member Point CameraIntrinsics.UndistortPoint(Point input) is not implemented in Uno.");
 }
Example #25
0
 public static global::Windows.Foundation.Rect Union(global::Windows.Foundation.Rect target, global::Windows.Foundation.Point point)
 {
     throw new global::System.NotImplementedException("The member Rect RectHelper.Union(Rect target, Point point) is not implemented in Uno.");
 }
Example #26
0
 public global::Windows.Foundation.Rect SelectWithLine(global::Windows.Foundation.Point from, global::Windows.Foundation.Point to)
 {
     throw new global::System.NotImplementedException("The member Rect InkManager.SelectWithLine(Point from, Point to) is not implemented in Uno.");
 }
Example #27
0
 public void SetContentFromSoftwareBitmap(global::Windows.Graphics.Imaging.SoftwareBitmap softwareBitmap, global::Windows.Foundation.Point anchorPoint)
 {
     global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.ApplicationModel.DataTransfer.DragDrop.Core.CoreDragUIOverride", "void CoreDragUIOverride.SetContentFromSoftwareBitmap(SoftwareBitmap softwareBitmap, Point anchorPoint)");
 }
Example #28
0
 public global::Windows.Foundation.Rect MoveSelected(global::Windows.Foundation.Point translation)
 {
     throw new global::System.NotImplementedException("The member Rect InkManager.MoveSelected(Point translation) is not implemented in Uno.");
 }
Example #29
0
 public void ShowAt(global::Windows.UI.Xaml.UIElement targetElement, global::Windows.Foundation.Point point)
 {
     global::Windows.Foundation.Metadata.ApiInformation.TryRaiseNotImplemented("Windows.UI.Xaml.Controls.MenuFlyout", "void MenuFlyout.ShowAt(UIElement targetElement, Point point)");
 }
Example #30
0
 public void GetInsertionIndexes(global::Windows.Foundation.Point position, out int first, out int second)
 {
     throw new global::System.NotImplementedException("The member void OrientedVirtualizingPanel.GetInsertionIndexes(Point position, out int first, out int second) is not implemented in Uno.");
 }
Example #31
0
 protected virtual global::Windows.UI.Xaml.Automation.Peers.AutomationPeer GetPeerFromPointCore(global::Windows.Foundation.Point point)
 {
     throw new global::System.NotImplementedException("The member AutomationPeer AutomationPeer.GetPeerFromPointCore(Point point) is not implemented in Uno.");
 }