Is there a way to set a minimum width and height for my Silverlight 4 out-of-browser application?
preguntado el 27 de agosto de 11 a las 15:08
There are no built in settings to control the window Minimum Width and Height so you will need to handle it with code.
First of all your OOB app needs to have Elevated Trust.
You then need to attach a handler the
SizeChanged evento del
FrameworkElement being used for the application's
RootVisual (usually MainPage.xaml).
In the handler include code like this:-
if (Application.MainWindow.Width < myMinWidth) Application.MainWindow.Width = myMinWidth; if (Application.MainWindow.Height < myMinHeight) Application.MainWindow.Height = myMinHeight;
You can set directly properties only... You can set properties of Window with minimum and maximum. or else you can programmatically set it in PageLoad/form load Event.