开发者

WPF - Loading image to show page loading status

开发者 https://www.devze.com 2023-01-10 22:53 出处:网络
In my wpf application i am playing videos from the mms server. These video files takes few seconds to load. I want to display loading(waiting) image during that loading process. Can anyone guid me for

In my wpf application i am playing videos from the mms server. These video files takes few seconds to load. I want to display loading(waiting) image during that loading process. Can anyone guid me for th开发者_C百科is.

Geetha


Wrap all your contents in a grid and put an extra Grid at the end of the Grid for your loading content. It is very important to put the LoadingGrid below your Grid with the content because when you make it visible it will cover the hole wrapper and will be on top of your contents. The Grid with the contents could also be of another type than Grid (ex: DockPanel, ...).

Example:

<Grid>
    <Grid>
        <TextBlock Text="All my contents"  />
    </Grid>
    <Grid x:Name="LoadingGrid" Background="#60FFFFFF" Visibility="Collapsed">
        <TextBlock Text="Please wait while loading ..." />
    </Grid>
</Grid>

Now you can Bind the Visiblity property of the LoadingGrid to a property IsBusy in your ViewModel or you can Set the Visibility property of the LoadingGrid in the Code behind.

0

精彩评论

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

关注公众号