예제 #1
0
        protected override ui.geom.Dimension calcPreferredSize()
        {
            int w = 0;
            int h = 0;

            SilverlightImplementation.dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                element.Measure(new Size(1000000, 1000000));
                w = SilverlightImplementation.screen.ConvertDipsToPixels((float)(element.DesiredSize.Width * SilverlightImplementation.scaleFactor), CanvasDpiRounding.Round);
                h = SilverlightImplementation.screen.ConvertDipsToPixels((float)(element.DesiredSize.Height * SilverlightImplementation.scaleFactor), CanvasDpiRounding.Round);
            }).AsTask().ConfigureAwait(false).GetAwaiter().GetResult();
            ui.geom.Dimension d = new ui.geom.Dimension(Math.Max(2, w), Math.Max(2, h));
            return(d);
        }
예제 #2
0
        protected override ui.geom.Dimension calcPreferredSize()
        {
            int w = 0;
            int h = 0;
            SilverlightImplementation.dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                element.Measure(new Size(1000000, 1000000));
                w = SilverlightImplementation.screen.ConvertDipsToPixels((float)(element.DesiredSize.Width * SilverlightImplementation.scaleFactor), CanvasDpiRounding.Round);
                h = SilverlightImplementation.screen.ConvertDipsToPixels((float)(element.DesiredSize.Height * SilverlightImplementation.scaleFactor), CanvasDpiRounding.Round);

            }).AsTask().ConfigureAwait(false).GetAwaiter().GetResult();
            ui.geom.Dimension d = new ui.geom.Dimension(Math.Max(2, w), Math.Max(2, h));
            return d;
        }