开发者

In a Silverlight 4 (OOB) app can you move the main window in code

开发者 https://www.devze.com 2023-01-12 13:50 出处:网络
In a Silverlight 4 out of browser app (oob) is there any way to programatically move the main window after the application start-up event.

In a Silverlight 4 out of browser app (oob) is there any way to programatically move the main window after the application start-up event.

The reason / Use case: A user selects an option on a silverlight desktop gadget app, the apps window grows to accomodate extra details. If the app started very near the right of the screen the details are obscured/ fall off the edge of the screen and the user needs to drag the window to the left. When the window r开发者_Go百科eturns to its smaller state it is now positioned to far left so the user needs to drag the window right again. It would be convention for the app to move itself back and forth automatically to accomodate the details.

Thanks.


Avida - yes you can move the MainWindow using Top/Left properties as long as WindowsStartupPosition is Manual


I will leave the answer below to show my shame... sorry I did not read the question properly.

If you mean the position within the web page, yes you can.

Silverlight can execute Javascript on the hosting page to change attributes (including the size or position of the Silverlight plugin itself).

I have used this feature to resize a Silverlight 3 application to fit its content, enabling use of the browser scrollbars to move down a large app (not needed nowadays with full mousewheel support, but the principle is the same).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号