我使用WPF创建了一个项目,我想在Revit中打开它的窗口我尝试Windows窗体它工作但是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 :(得分: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();
}
答案 1 :(得分:0)
您可能想要创建WPF用户控件并将其指定为Revit外部命令中的WPF窗口的内容,例如:
UserControl1 userControl = new UserControl1();
Window win = new Window();
win.Content = userControl;
win.Show();