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