public void Show() { _wnd.Show(); // Extract the window handle of the window we want to dock var mWindowHandle = new System.Windows.Interop.WindowInteropHelper(_wnd).Handle; // Dock it in Maya using the docking station _mI = new MDockingStation(mWindowHandle, true, MDockingStation.BottomDock | MDockingStation.TopDock | MDockingStation.LeftDock | MDockingStation.RightDock, MDockingStation.LeftDock); }
public override void doIt(MArgList args) { // Create the window to dock wnd = new wpfexamples.DAGExplorer(); wnd.Show(); // Extract the window handle of the window we want to dock IntPtr mWindowHandle = new System.Windows.Interop.WindowInteropHelper(wnd).Handle; // Dock it in Maya using the docking station mI = new MDockingStation(mWindowHandle, true, MDockingStation.BottomDock | MDockingStation.TopDock, MDockingStation.BottomDock); }
override public void doIt(MArgList args) { // Create the window to dock wnd = new wpfexamples.DAGExplorer(); wnd.Show(); // Extract the window handle of the window we want to dock IntPtr mWindowHandle = new System.Windows.Interop.WindowInteropHelper(wnd).Handle; // Dock it in Maya using the docking station mI = new MDockingStation(mWindowHandle, true, MDockingStation.BottomDock | MDockingStation.TopDock, MDockingStation.BottomDock); }
private void ResultGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e) { // If it's a mesh, display it var selected = GetFirstSelected(); if (selected != null) { IntPtr mwh = MDockingStation.GetMayaMainWindow(); HWNDWrapper mww = new HWNDWrapper(mwh); Form1 t = new Form1(selected); t.ShowDialog(mww); } }
// Displays the object property window private void ResultGrid_MouseDoubleClick(object sender, MouseButtonEventArgs e) { var selected = GetFirstSelected(); if (selected != null) { HWNDWrapper mww; try { // Try with a Maya host first System.Windows.Forms.NativeWindow wnd = Runtime.MayaApplication.MainWindow; IntPtr mwh = MDockingStation.GetMayaMainWindow(); mww = new HWNDWrapper(mwh); } catch { // We are in standalone mode (WPF application) IntPtr mwh = new System.Windows.Interop.WindowInteropHelper(Application.Current.MainWindow).Handle; mww = new HWNDWrapper(mwh); } Form1 t = new Form1(selected); t.ShowDialog(mww); } }
private void Onclosing(object sender, System.ComponentModel.CancelEventArgs e) { e.Cancel = true; _wnd.Hide(); _mI = null; }