public partial class UserWindow : Window
{
public static UserWindow mywindow;
ExternalCommandData tempData;
string temMess;
ElementSet temEle;
//封装原构造方法
private UserWindow(ExternalCommandData commandData, ref string message, ElementSet elements)
{
InitializeComponent();
tempData = commandData;
temMess = message;
temEle = elements;
}
//公开静态构造方法
public static UserWindow GetWindow(ExternalCommandData commandData, ref string message, ElementSet elements)
{
ExternalCommandData tempData = commandData;
string temMess = message;
ElementSet temEle = elements;
if (mywindow == null)
{
mywindow = new UserWindow(tempData, ref temMess, temEle);
}
return mywindow;
}
{
public static UserWindow mywindow;
ExternalCommandData tempData;
string temMess;
ElementSet temEle;
//封装原构造方法
private UserWindow(ExternalCommandData commandData, ref string message, ElementSet elements)
{
InitializeComponent();
tempData = commandData;
temMess = message;
temEle = elements;
}
//公开静态构造方法
public static UserWindow GetWindow(ExternalCommandData commandData, ref string message, ElementSet elements)
{
ExternalCommandData tempData = commandData;
string temMess = message;
ElementSet temEle = elements;
if (mywindow == null)
{
mywindow = new UserWindow(tempData, ref temMess, temEle);
}
return mywindow;
}