silverLight childWindow

此生再无相见时 提交于 2019-12-02 04:38:31

问题


how can i do my childWindow to be always on top?


回答1:


If by ChildWindows you mean the ChildWindow object in Silverlight then it should always appear on top, as the documentation says:

A ChildWindow always displays in a modal popup that blocks user interaction with the underlying user interface.

But if by ChildWindow you mean something else you created in Silverlight then you need to set the ZIndex property of that object to a very big number:

The z-order of an object determines whether the object is in front of or behind another overlapping object. By default, the z-order of objects within a Panel is determined by the sequence in which they are declared. Objects that are declared later appear in front of objects that are declared earlier. You can change this behavior by setting the Canvas..::.ZIndex attached property on objects within the Panel. Higher values are closer to the foreground; lower values are farther from the foreground.

In codebehind you would write:

myObject.SetValue(Canvas.ZIndexProperty, 100); 

and in XAML you would need to write

<Rectangle Canvas.ZIndex="100" />



回答2:


Maybe Popup control will help you? http://jesseliberty.com//2008/06/06/popup-control/



来源:https://stackoverflow.com/questions/2744666/silverlight-childwindow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!