How do I resize a silverlight app based on its content?
2 answers
Decision -
Instead of going through the page, you need to go through the browser object.
Here's the solution I found:
width = 200;
height = 200;
var host = HtmlPage.Document.HtmlPage.Plugin.Id);
host.SetStyleAttribute("width", width.ToString());
host.SetStyleAttribute("height", height.ToString());
+1
a source to share
After resizing the container, you may receive a notification:
public Page()
{
InitializeComponent();
App.Current.Host.Content.Resized += (s, e) =>
{
// Place here your layour resize code...
this.Width = App.Current.Host.Content.ActualWidth;
this.Height = App.Current.Host.Content.ActualHeight;
};
}
+1
a source to share