protected override HandleRef BuildWindowCore(HandleRef hwndParent) { DestroyHost(); _host = new WinFormsAvaloniaControlHost {Content = _content}; UnmanagedMethods.SetParent(_host.Handle, hwndParent.Handle); return new HandleRef(this, _host.Handle); }
/// <summary> /// Builds the window. /// </summary> /// <param name="hwndParent"></param> /// <returns></returns> protected override HandleRef BuildWindowCore(HandleRef hwndParent) { DestroyHost(); _host = new WinFormsAvaloniaControlHost { Content = _content }; UnmanagedMethods.SetParent(_host.Handle, hwndParent.Handle); return(new HandleRef(this, _host.Handle)); }
void DestroyHost() { _host?.Dispose(); _host = null; }