public void ShowForm(UIApplication uiapp)
{
if (_ElementFilterUserControl == null)
{
if (Instance == null)
{
Instance = this;
}
// A new handler to handle request posting by the dialog
RevitHandler handler = new RevitHandler();
// External Event for the dialog to use (to post requests)
ExternalEvent exEvent = ExternalEvent.Create(handler);
// We give the objects to the new dialog;
// The dialog becomes the owner responsible for disposing them, eventually.
_ElementFilterUserControl = new ElementFilterUserControl(exEvent);
BitmapImage pb1Image = new BitmapImage(new Uri("pack://application:,,,/ElementFilter;component/Resources/icon.ico"));
Window.Content = _ElementFilterUserControl;
Window.Icon = pb1Image;
Window.Title = Util.ApplicationWindowTitle;
Window.Height = Util.ApplicationWindowHeight;
Window.Topmost = Util.IsApplicationWindowTopMost;
Window.Width = Util.ApplicationWindowWidth;
Window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
Window.Show();
Window.Closed += OnClosing;
App.ElementFilterButton.Enabled = false;
}
}