private void Attach(IChromeOwner window, bool initialShow) { this.Detach(); this._windowInteropHelper.Owner = window.Handle; this.Owner = window; this.Owner.StateChanged += this.OwnerStateChangedCallback; this.Owner.LocationChanged += this.OwnerLocationChangedCallback; this.Owner.SizeChanged += this.OwnerSizeChangedCallback; this.Owner.Activated += this.OwnerActivatedCallback; this.Owner.Deactivated += this.OwnerDeactivatedCallback; this.Owner.Closed += this.OwnerClosedCallback; if (initialShow) { this._ownerPreviewState = this.Owner.WindowState; this.Show(); this.UpdateState(forceImmediate: true); this.UpdateLocationAndSize(); } else { this.Owner.ContentRendered += this.OwnerContentRenderedCallback; } }
/// <summary> /// 指定したウィンドウに、このクローム UI をアタッチします。 /// </summary> public void Attach(IChromeOwner window) { this.Detach(); this._top.Window.Attach(window); this._left.Window.Attach(window); this._right.Window.Attach(window); this._bottom.Window.Attach(window); this.CanResize = false; }
public void Attach(IChromeOwner window) { Action <Color> applyAccent = color => this.Background = new SolidColorBrush(Color.FromRgb(color.R, color.G, color.B)); var disposable = WindowsTheme.Accent.RegisterListener(applyAccent); this.Closed += (sender, e) => disposable.Dispose(); applyAccent(WindowsTheme.Accent.Current); this.Attach(window, true); }
internal void Attach(IChromeOwner window, bool initialShow) { this.Detach(); this.Owner = window; this.Owner.StateChanged += this.OwnerStateChangedCallback; this.Owner.LocationChanged += this.OwnerLocationChangedCallback; this.Owner.SizeChanged += this.OwnerSizeChangedCallback; this.Owner.Activated += this.OwnerActivatedCallback; this.Owner.Deactivated += this.OwnerDeactivatedCallback; this.Owner.Closed += this.OwnerClosedCallback; if (initialShow) { this._ownerPreviewState = this.Owner.WindowState; this.Show(); this.Update(); } else { this.Owner.ContentRendered += this.OwnerContentRenderedCallback; } }
/// <summary> /// 指定したウィンドウに、このクローム UI をアタッチします。 /// </summary> public void Attach(IChromeOwner window) { this.Detach(); this._top.Window.Attach(window); this._left.Window.Attach(window); this._right.Window.Attach(window); this._bottom.Window.Attach(window); this.CanResize = false; }