Exemplo n.º 1
0
Arquivo: app.cs Projeto: Sugz/CSharp
        private void SetupDialog()
        {
            // Create a new managed window to contain the WPF control
            this.dial               = new System.Windows.Window();
            dial.SizeToContent      = System.Windows.SizeToContent.WidthAndHeight;
            dial.ResizeMode         = ResizeMode.CanResizeWithGrip;
            dial.Title              = "test UI";
            dial.WindowStyle        = WindowStyle.None;
            dial.AllowsTransparency = true;
            dial.MinWidth           = 200.0;
            dial.MinHeight          = 400;
            dial.Height             = 900;
            dial.Width              = 600;

            dial.ShowInTaskbar = false;

            dialog templateUI = new dialog(dial);

            // Assign the window's content to be the WPF control
            dial.Content = templateUI;
            dial.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;

            // Create an interop helper
            System.Windows.Interop.WindowInteropHelper windowHandle = new System.Windows.Interop.WindowInteropHelper(dial);

            // Assign the 3ds Max HWnd handle to the interop helper
            windowHandle.Owner = ManagedServices.AppSDK.GetMaxHWND();

            // Setup 3ds Max to handle the WPF dialog correctly
            ManagedServices.AppSDK.ConfigureWindowForMax(dial);

            dial.Show();
        }
Exemplo n.º 2
0
Arquivo: app.cs Projeto: Sugz/CSharp
        private void SetupDialog()
        {
            // Create a new managed window to contain the WPF control
            this.dial = new System.Windows.Window();
            dial.SizeToContent = System.Windows.SizeToContent.WidthAndHeight;
            dial.ResizeMode = ResizeMode.CanResizeWithGrip;
            dial.Title = "test UI";
            dial.WindowStyle = WindowStyle.None;
            dial.AllowsTransparency = true;
            dial.MinWidth = 200.0;
            dial.MinHeight = 400;
            dial.Height = 900;
            dial.Width = 600;

            dial.ShowInTaskbar = false;

            dialog templateUI = new dialog(dial);

            // Assign the window's content to be the WPF control
            dial.Content = templateUI;
            dial.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;

            // Create an interop helper
            System.Windows.Interop.WindowInteropHelper windowHandle = new System.Windows.Interop.WindowInteropHelper(dial);

            // Assign the 3ds Max HWnd handle to the interop helper
            windowHandle.Owner = ManagedServices.AppSDK.GetMaxHWND();

            // Setup 3ds Max to handle the WPF dialog correctly
            ManagedServices.AppSDK.ConfigureWindowForMax(dial);

            dial.Show(); 
        }