當前位置: 首頁>>代碼示例>>C#>>正文


C# Grid.TransformToVisual方法代碼示例

本文整理匯總了C#中Windows.UI.Xaml.Controls.Grid.TransformToVisual方法的典型用法代碼示例。如果您正苦於以下問題:C# Grid.TransformToVisual方法的具體用法?C# Grid.TransformToVisual怎麽用?C# Grid.TransformToVisual使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Windows.UI.Xaml.Controls.Grid的用法示例。


在下文中一共展示了Grid.TransformToVisual方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnApplyTemplate

        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            Loaded += Clr_Pckr_Loaded;

            clrViewbox = GetTemplateChild("clrViewbox") as Viewbox;
            pointer = GetTemplateChild("pointer") as Grid;
            reference = GetTemplateChild("reference") as Border;
            rtrnsfrm = GetTemplateChild("rtrnsfrm") as CompositeTransform;
            innerCanvas = GetTemplateChild("innerCanvas") as Canvas;
            innerEll = GetTemplateChild("innerEll") as Grid;
            ColorImg = GetTemplateChild("ColorImg") as Image;
           
            thumbInnerEll = GetTemplateChild("thumbInnerEll") as Thumb;
            rectColor = GetTemplateChild("rectColor") as Rectangle;
            gdStop = GetTemplateChild("gdStop") as GradientStop;
            FinalColor = GetTemplateChild("FinalColor") as Ellipse;
            testblock = GetTemplateChild("test") as TextBlock;


            ColorImg.Tapped += ColorImg_Tapped_1;
          
            rectColor.PointerPressed += Rectangle_PointerPressed_1;
            thumbInnerEll.DragDelta += Thumb_DragDelta_1;

            ColorImg.PointerReleased += ColorImg_PointerReleased_1;
            ColorImg.PointerPressed += ColorImg_PointerPressed_1;
            ColorImg.PointerMoved += ColorImg_PointerMoved_1;

            gdStop.Color = SelectedColor;
            FinalColor.Fill = new SolidColorBrush(SelectedColor);



            GeneralTransform gt = pointer.TransformToVisual(reference);

            Point p = new Point();

            p = gt.TransformPoint(p);
            px = p.X;
            py = p.Y;
            loadnew();
        }
開發者ID:martijnhoogendoorn,項目名稱:inkingbehavior,代碼行數:44,代碼來源:Clr_Pckr.cs

示例2: getPhotoPosition

        private PhotoPosition getPhotoPosition(Grid g)
        {
            var ttv =  g.TransformToVisual(Window.Current.Content);
            Point screenCoords = ttv.TransformPoint(new Point(0, 0));

            if (screenCoords.X - g.ActualWidth < g.ActualWidth * -2)
            {
                return PhotoPosition.OffscreenLeft;
            }

            if (screenCoords.X > Window.Current.Bounds.Width)
            {
                return PhotoPosition.OffscreenRight;
            }

            if (screenCoords.Y - g.ActualHeight < g.ActualHeight * -2)
            {
                return PhotoPosition.OffscreenTop;
            }

            return PhotoPosition.Other;
        }
開發者ID:prashker,項目名稱:Tindows,代碼行數:22,代碼來源:SuperficialPageViewModel.cs


注:本文中的Windows.UI.Xaml.Controls.Grid.TransformToVisual方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。