Quantcast
Channel: CRM Development 論壇
Viewing all articles
Browse latest Browse all 10280

Resize Silverlight Web Resource based on page size in CRM 2011

$
0
0

Hi,

I have a silverlight web resource added to a entity.when i resize the entity form the controls should also get resized based on the browser window size of the form.

The silverlight works fine when tested from within the silverlight project and it is not resizing when calling from entity form.

For resizing i have written the following code

this.SizeChanged += new SizeChangedEventHandler(Layout_SizeChanged);

void Layout_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            double aspectRatio = e.NewSize.Width / e.NewSize.Height;
            if (aspectRatio < (Layout.Width / Layout.Height))
                LayoutScale.ScaleX = LayoutScale.ScaleY = e.NewSize.Width / (Layout.Width);
            else
                LayoutScale.ScaleX = LayoutScale.ScaleY = e.NewSize.Height / (Layout.Height);
        }

 

Viewing all articles
Browse latest Browse all 10280

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>