// 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); } }
// 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); } }