当前位置: 首页>>代码示例>>C#>>正文


C# Window.MoveTo方法代码示例

本文整理汇总了C#中System.Windows.Window.MoveTo方法的典型用法代码示例。如果您正苦于以下问题:C# Window.MoveTo方法的具体用法?C# Window.MoveTo怎么用?C# Window.MoveTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Window的用法示例。


在下文中一共展示了Window.MoveTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: JSCBrandedWindow

        public JSCBrandedWindow()
        {
            this.Icon = new JSCSolutionsNETImage().Source;
            
            // dwmapi.dll will be missing on xp
            this.WithGlass();


            this.Title = "What do you want to create today?";

            var Overlay = new Window
            {
                AllowsTransparency = true,
                Background = Brushes.Transparent,
                ShowInTaskbar = false,
                WindowStyle = System.Windows.WindowStyle.None,
                //Topmost = true,
                Width = 400,
                Height = 400,


            };
            BrandedOverlay = Overlay;

            Overlay.SourceInitialized +=
              delegate
              {
                  ScriptCoreLib.CSharp.Avalon.Extensions.DesktopWindowManager.MakeInteractive(
                  Overlay, false);
              };

            var Zoom = 0.4;

            Action MoveOverlay =
                delegate
                {
                    Overlay.MoveTo(
                        this.Left - 200 * Zoom + 20,
                        this.Top - 200 * Zoom + 20
                     );

                };

            this.LocationChanged +=
                delegate
                {
                    MoveOverlay();
                };




            var TitleCanvas = new Canvas().AttachTo(Overlay);

            cc = new JSCSolutionsNETCarouselCanvas();

            cc.StepSpeedToToggleSattelites = 0.20;
            cc.DisableTimerShutdown = true;

            //cc.CloseOnClick = false;
            //cc.AtLogoClick +=
            //    delegate
            //    {
            //        Process.Start("http://www.jsc-solutions.net");
            //    };

            // http://stackoverflow.com/questions/741956/wpf-pan-zoom-image
            cc.Container.RenderTransform = new ScaleTransform(Zoom, Zoom);

            cc.AttachContainerTo(TitleCanvas);



            this.Deactivated +=
                delegate
                {
                    if (!cc.SattelitesHidden)
                        cc.HideSattelites();
                };



            this.Activated +=
                delegate
                {
                    if (EnableSattelites && cc.DisableTimerShutdown)
                        if (cc.SattelitesHidden)
                            cc.ShowSattelitesAgain();


                };


            this.cc.AtSattelitesShownAgain +=
                delegate
                {
                    if (HideSattelitesAtDelay > 0)
                        HideSattelitesAtDelay.AtDelay(cc.HideSattelites);
                };

//.........这里部分代码省略.........
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:101,代码来源:JSCBrandedWindow.cs

示例2: Main


//.........这里部分代码省略.........
                    if (key == Key.LeftShift)
                    {
                        NextInputModeKeyDownEnabled = false;
                    }
                    else
                    {

                    }

                    NextInputModeEnabled = false;
                };
            #endregion


            var s = 7;

            var ThumbnailSize = 0.4;
            var CaptionBackgroundHeight = 24;

            #region UpdateChildren
            Action UpdateChildren =
                delegate
                {
                    if (w.ActualWidth == 0)
                        return;

                    var ss = s;
                    var ss2 = 0;


                    Console.WriteLine(
                        new { w.Left, w.Top });

                    winfo.MoveTo(w.Left, w.Top).SizeTo(w.ActualWidth, w.ActualHeight);

                    if (ThumbnailSize == 1)
                    {
                        wcam.Background = Brushes.Black;
                        ss = 0;

                        var qw = w.ActualWidth - ss * 2;
                        var qh = w.ActualHeight - ss * 2;

                        // no status bars or menues please :)

                        wcam.MoveTo(
                            w.Left + ss + ss2,
                            w.Top + (w.ActualHeight - qh * ThumbnailSize - ss) - ss2
                        ).SizeTo(
                            qw * ThumbnailSize,
                            qh * ThumbnailSize
                        );

                    }
                    else
                    {
                        wcam.Background = Brushes.Transparent;

                        //if (w.WindowState == WindowState.Maximized)
                        //{
                        //    ss2 = s;
                        //}

                        var qw = w.ActualWidth - ss * 2;
                        var qh = w.ActualHeight - ss * 2;
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:66,代码来源:Program.cs


注:本文中的System.Windows.Window.MoveTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。