33 lines
944 B
C#
33 lines
944 B
C#
using System;
|
|
using System.ComponentModel;
|
|
using System.Windows.Forms;
|
|
using System.Windows.Forms.Integration;
|
|
|
|
namespace Xylem.Common.Production.ProductionUiCordonel
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for UserAccessWindow.xaml
|
|
/// </summary>
|
|
public partial class UserAccessWindow
|
|
{
|
|
public event EventHandler OnCloseWindow;
|
|
private WindowsFormsHost _winFormsHost;
|
|
|
|
public UserAccessWindow(Control control, String headerTxt = "")
|
|
{
|
|
InitializeComponent();
|
|
Title = headerTxt;
|
|
_winFormsHost = new WindowsFormsHost();
|
|
_winFormsHost.Child = control;
|
|
dgWinFormsHost.Children.Add(_winFormsHost);
|
|
}
|
|
|
|
private void Window_Closing(Object sender, CancelEventArgs e)
|
|
{
|
|
_winFormsHost.Dispose();
|
|
_winFormsHost = null;
|
|
OnCloseWindow?.Invoke(this, EventArgs.Empty);
|
|
}
|
|
}
|
|
}
|