流暢啟動(dòng)界面
受Windows 10啟發(fā)的啟動(dòng)界面。
- 具有Acrylic material effect — a partially 透明的紋理,僅當(dāng)應(yīng)用程序在Windows 10 Version 1803 (OS build 17134)或更高版本下運(yùn)行時(shí),此效果才可用。
- 您可以自定義并在代碼中顯示此啟動(dòng)界面。
顯示并關(guān)閉啟動(dòng)界面
您可以使用靜態(tài)SplashScreenManager.ShowFluentSplashScreen方法手動(dòng)創(chuàng)建并顯示流暢的啟動(dòng)界面(例如,可以在應(yīng)用程序啟動(dòng)時(shí)調(diào)用它),該方法的參數(shù)允許指定預(yù)定義區(qū)域、界面位置、淡入淡出動(dòng)畫效果等的內(nèi)容,下圖演示了可以自定義的啟動(dòng)界面區(qū)域。
要關(guān)閉啟動(dòng)界面,請(qǐng)使用靜態(tài)SplashScreenManager.CloseForm方法。
C#:
using DevExpress.XtraSplashScreen; // Show a splashscreen. FluentSplashScreenOptions op = new FluentSplashScreenOptions(); op.Title = "When Only The Best Will Do"; op.Subtitle = "DevExpress WinForms Controls"; op.RightFooter = "Starting..."; op.LeftFooter = "Copyright © 2000 - 2020 Developer Express Inc." + Environment.NewLine + "All Rights reserved."; op.LoadingIndicatorType = FluentLoadingIndicatorType.Dots; op.OpacityColor = Color.Gray; op.Opacity = 130; op.LogoImageOptions.SvgImage = Resources.Logo; DevExpress.XtraSplashScreen.SplashScreenManager.ShowFluentSplashScreen( op, parentForm: this, useFadeIn: true, useFadeOut: true ); //Do an operation //... //Close the splashscreen DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm();
VB.NET :
' Show a splashscreen. Dim op As FluentSplashScreenOptions = New FluentSplashScreenOptions() op.Title = "When Only The Best Will Do" op.Subtitle = "DevExpress WinForms Controls" op.RightFooter = "Starting..." op.LeftFooter = "Copyright © 2000 - 2020 Developer Express Inc." & Environment.NewLine & "All Rights reserved." op.LoadingIndicatorType = FluentLoadingIndicatorType.Dots op.OpacityColor = Color.Gray op.Opacity = 130 op.LogoImageOptions.SvgImage = My.Resources.Logo DevExpress.XtraSplashScreen.SplashScreenManager.ShowFluentSplashScreen(op, parentForm:=Me, useFadeIn:=True, useFadeOut:=True) 'Do an operation '... 'Close the splashscreen DevExpress.XtraSplashScreen.SplashScreenManager.CloseForm()
動(dòng)態(tài)更新啟動(dòng)界面
啟動(dòng)界面顯示在單獨(dú)的線程中,您可以使用SplashScreenManager.SendCommand 方法發(fā)送的命令動(dòng)態(tài)更新當(dāng)前啟動(dòng)界面的內(nèi)容。
C# :
FluentSplashScreenOptions op = new FluentSplashScreenOptions(); op.RightFooter = "Done"; SplashScreenManager.Default.SendCommand(FluentSplashScreenCommand.UpdateOptions, op);
VB.NET :
Dim op As New FluentSplashScreenOptions() op.RightFooter = "Done" SplashScreenManager.Default.SendCommand(FluentSplashScreenCommand.UpdateOptions, op)
DevExpress.XtraSplashScreen.FluentSplashScreenCommand類型枚舉支持的命令。
C# :
public enum FluentSplashScreenCommand { UpdateOptions, SubscribeToCustomDrawEvent }
VB.NET:
Public Enum FluentSplashScreenCommand UpdateOptions = 0 SubscribeToCustomDrawEvent = 1 End Enum