开发者

How to set BusyIndicator to the center of window?

WPF: set BusyIndicator to the center开发者_如何学运维 of window


Use HorizontalAlignment ="Center" and VerticalAlignment="Center" attached properties.

For example:

<Windows>
    <Grid>

    <extToolkit:BusyIndicator IsBusy="True" HorizontalAlignment ="Center" VerticalAlignment="Center"/>

    </Grid>
</Window>

In case you want a control to be over everything on the Windows, I think you should place it inside of a popup and control the popups position from code.

As a last resort, you can put BusyIndicator to a separate boardeless WPF window to top it over the WindowsFormsHost.

In order to keep a popup sticky to its parent, just call popup.Activate() each time your parent Windows is activated. This way, if some other applications windows goes over yours, both, popup and the parent will be beneath the currently active windows. The moment user activates the parent window, it will call activate on the popup, so that it appears they are stuck together. This is rather a trick, I know. Maybe someone has a better solution.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜