原創|使用教程|編輯:我只采一朵|2016-07-28 11:39:40.000|閱讀 1716 次
概述:本教程教你如何應用DevExpress WPF的加載動畫控件。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
LoadingDecorator是一個容器控件用于顯示 long-loading 的內容。內容還沒加載完成的時候會顯示一個加載指示器,加載完成后指示器消失,如下圖所示:
用dx:LoadingDecorator標簽:
<Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Views:NavigationView/> <dx:LoadingDecorator Grid.Column="1"> <Views:MainView/> </dx:LoadingDecorator> </Grid>
LoadingDecorator提供了一系列屬性,用于自定義Loading Indicator外觀。
定義indicator 布局:LoadingDecorator.SplashScreenTemplate 屬性;
傳遞自定義數據:LoadingDecorator.SplashScreenDataContext 屬性;
更改加載條位置:LoadingDecorator.SplashScreenLocation 屬性;
將加載條在窗口居中或者容器居中:(SplashScreenLocation.CenterWindow) or (SplashScreenLocation.CenterContainer).
<Grid> ... <dx:LoadingDecorator Grid.Column="1" SplashScreenDataContext="{Binding ... }" SplashScreenLocation="CenterContainer"> <dx:LoadingDecorator.SplashScreenTemplate> <DataTemplate> <Grid> ... </Grid> </DataTemplate> </dx:LoadingDecorator.SplashScreenTemplate> <Views:MainView/> </dx:LoadingDecorator> </Grid>
LoadingDecorator.BorderEffect 和 LoadingDecorator.BorderEffectColor 屬性可以設置高亮效果。BorderEffect 設置邊框高亮,BorderEffectColor 設置邊框高亮顏色。
<dx:LoadingDecorator ... BorderEffect="Default" BorderEffectColor="Blue"> ... </dx:LoadingDecorator>
如果不想要加載條,將 LoadingDecorator.UseFadeEffect 設置 False 即可。
DevExpress專為企業客戶提供團隊、企業授權優惠方案,歡迎來電咨詢:023-66090381
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn