WPF 实现Loading效果


项目中如下实现遮盖的加载效果,代码不统一,且实现的耦合性比较多,封装了一个加载的控件.

snap

 

使用方法:

1.添加:

 <ResourceDictionary Source="/BusyIndicatorCtrl;Component/BusyIndicator.xaml"/>

2.在所要的容器中插入 BusyIndicator :

  <Grid Grid.Row="0" Width="800" Height="300" Background="Beige">
            <s:BusyIndicator x:Name="busyCtrl"  />
            <Label Content="BusyIndicator 将遮盖它的父容器"></Label>
        </Grid>

设置加载内容的文件并显示:
                this.busyCtrl.IsBusy = true;
 
                this.busyCtrl.Text = "Loading Content...";


代码下载


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM