我的MainWindow.xaml文件中包含以下代码:
<dxmvvm:Interaction.Behaviors>
<dx:DXSplashScreenService SplashScreenType="local:LoadingSplashScreen" ShowSplashScreenOnLoading="True"/>
</dxmvvm:Interaction.Behaviors>
我需要能够从codebehind(MainWindow.xaml.cs)动态添加此代码。这可能吗?
我需要使用Interaction.GetBehaviors(yourElementName).Add(behavior)
吗?
谢谢。
答案 0 :(得分:0)
您可以添加赞,
var splashScreenService = new DevExpress.Xpf.Core.DXSplashScreenService
{
SplashScreenType = typeof(LoadingSplashScreen),
ShowSplashScreenOnLoading = true
};
DevExpress.Mvvm.UI.Interactivity.Interaction.GetBehaviors(yourElement).Add(splashScreenService);