我的MainWindow.xaml文件中有以下代码:
<dxmvvm:Interaction.Behaviors>
<dx:DXSplashScreenService SplashScreenType="local:LoadingSplashScreen" ShowSplashScreenOnLoading="True"/>
</dxmvvm:Interaction.Behaviors>我需要能够从代码背后(MainWindow.xaml.cs)动态添加此代码。这个是可能的吗?
我需要使用Interaction.GetBehaviors(yourElementName).Add(behavior)吗??
谢谢。
发布于 2019-03-19 08:47:57
你可以添加这样的,
var splashScreenService = new DevExpress.Xpf.Core.DXSplashScreenService
{
SplashScreenType = typeof(LoadingSplashScreen),
ShowSplashScreenOnLoading = true
};
DevExpress.Mvvm.UI.Interactivity.Interaction.GetBehaviors(yourElement).Add(splashScreenService);https://stackoverflow.com/questions/55225784
复制相似问题