Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        private double GetWindowTop(object view, IWindowMetadataProvider windowInfo, FrameworkElement viewWithDataContext)
        {
            var persistedValue = (double?)this.windowManager.RecoverProperty(view.GetType().ToString(), "PositionY");

            if (persistedValue.HasValue)
            {
                return(persistedValue.Value);
            }

            return(WindowPosition.GetWindowTop(windowInfo.VerticalPosition, ((FrameworkElement)this.HostControl).ActualHeight, viewWithDataContext.Height));
        }