open wpf window in Revit as add ins
質問
I made a project using WPF and I want to open its window in Revit I trying windows form it worked but wpf not opened !!
I use this
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;
}
But it didn't work any solutions
解決
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();
}
他のヒント
You may want to create a WPF User Control and assign it as the Content of a WPF window in a Revit External Command, something like:
UserControl1 userControl = new UserControl1();
Window win = new Window();
win.Content = userControl;
win.Show();
所属していません StackOverflow