private void PersistWindowDefaultPosition(IWindowMetadataProvider windowInfo, FrameworkElement viewWithDataContext) { if (!this.windowsAttributes.ContainsKey(windowInfo)) { var top = WindowPosition.GetWindowTop(windowInfo.VerticalPosition, ((FrameworkElement)this.HostControl).ActualHeight, viewWithDataContext.Height); var left = WindowPosition.GetWindowLeft(windowInfo.HorizontalPosition, ((FrameworkElement)this.HostControl).ActualWidth); this.windowsAttributes[windowInfo] = new Point(left, top); } }
private double GetWindowLeft(object view, IWindowMetadataProvider windowInfo) { var persistedValue = (double?)this.windowManager.RecoverProperty(view.GetType().ToString(), "PositionX"); if (persistedValue.HasValue) { return(persistedValue.Value); } return(WindowPosition.GetWindowLeft(windowInfo.HorizontalPosition, ((FrameworkElement)this.HostControl).ActualWidth)); }