2012-04-19 11 views
0

私はWPFを使用してプロジェクトを作成しましたが、私はRevitでそのウィンドウを開いています。あなたは、WPFユーザーコントロールを作成し、中WPFウィンドウの内容としてそれを割り当てることができRevitで追加機能としてwpfウィンドウを開く

私はこの

public virtual Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) 
    { 
     IDesign.MainWindow testsd = new IDesign.MainWindow(); 
     testsd.InitializeComponent(); 
     //MessageBox.Show("notworking"); 
     return Result.Succeeded; 
    } 

使用しますが、それは任意のソリューション

答えて

0
public virtual Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) 
    { 
     IDesign.MainWindow testsd = new IDesign.MainWindow(); 
     //testsd.InitializeComponent(); 
     //MessageBox.Show("notworking"); 
     return Result.Succeeded; 
    } 

public MainWindow() 
     { 
      InitializeComponent(); 
      this.ShowDialog(); 
     } 
0

を動作しませんでしたRevit外部コマンドのようなもの:

UserControl1 userControl = new UserControl1(); 
Window win = new Window(); 
win.Content = userControl; 
win.Show(); 
関連する問題