更改 Catel+Orchestra 应用程序的启动画面
Change splash screen for Catel+Orchestra application
我正在尝试修改管弦乐队应用程序的默认启动画面。发现 SplashScreen.png 默认包含在 resources/images 文件夹中,并用我自己的(相同的宽度和高度)覆盖它。启动画面没有改变。
我去查看Orchestra的代码,找到了SplashScreen视图。并看到您有公司徽标的占位符。
<Image Grid.Row="3" Grid.Column="0" Source="{Binding CompanyLogoForSplashScreenUri}" HorizontalAlignment="Left"
Margin="10" VerticalAlignment="Bottom" Stretch="Uniform" Opacity="0.7"
Visibility="{Binding CompanyLogoForSplashScreenUri, Converter={catel:ReferenceToCollapsingVisibilityConverter}}"/>
在视图模型上,我发现了对 IAboutInforService 的构造函数调用
public SplashScreenViewModel(IAboutInfoService aboutInfoService)
{
Argument.IsNotNull(() => aboutInfoService);
var aboutInfo = aboutInfoService.GetAboutInfo();
CompanyLogoForSplashScreenUri = aboutInfo.CompanyLogoForSplashScreenUri;
}
但是从 GetAboutInfo 返回的 AboutInfo 对象中的 CompanyLogoForSplashScreenUri 属性 始终为空。构造函数从不向它添加 uri 引用。
public AboutInfo GetAboutInfo()
{
var aboutInfo = new AboutInfo(new Uri("pack://application:,,,/Resources/Images/CompanyLogo.png", UriKind.RelativeOrAbsolute));
return aboutInfo;
}
public AboutInfo(Uri companyLogoUri = null, string logoImageSource = null, string url = null, Assembly assembly = null, Uri companyLogoForSplashScreenUri = null)
那么我该怎么做才能将公司徽标添加到初始屏幕?
构造函数中有2个CompanyLogoUri。从变量名可以看出,两者各有用途:
- companyLogoUri
- companyLogoForSplashScreenUri
我想你想设置第二个 ;-)
我正在尝试修改管弦乐队应用程序的默认启动画面。发现 SplashScreen.png 默认包含在 resources/images 文件夹中,并用我自己的(相同的宽度和高度)覆盖它。启动画面没有改变。
我去查看Orchestra的代码,找到了SplashScreen视图。并看到您有公司徽标的占位符。
<Image Grid.Row="3" Grid.Column="0" Source="{Binding CompanyLogoForSplashScreenUri}" HorizontalAlignment="Left"
Margin="10" VerticalAlignment="Bottom" Stretch="Uniform" Opacity="0.7"
Visibility="{Binding CompanyLogoForSplashScreenUri, Converter={catel:ReferenceToCollapsingVisibilityConverter}}"/>
在视图模型上,我发现了对 IAboutInforService 的构造函数调用
public SplashScreenViewModel(IAboutInfoService aboutInfoService)
{
Argument.IsNotNull(() => aboutInfoService);
var aboutInfo = aboutInfoService.GetAboutInfo();
CompanyLogoForSplashScreenUri = aboutInfo.CompanyLogoForSplashScreenUri;
}
但是从 GetAboutInfo 返回的 AboutInfo 对象中的 CompanyLogoForSplashScreenUri 属性 始终为空。构造函数从不向它添加 uri 引用。
public AboutInfo GetAboutInfo()
{
var aboutInfo = new AboutInfo(new Uri("pack://application:,,,/Resources/Images/CompanyLogo.png", UriKind.RelativeOrAbsolute));
return aboutInfo;
}
public AboutInfo(Uri companyLogoUri = null, string logoImageSource = null, string url = null, Assembly assembly = null, Uri companyLogoForSplashScreenUri = null)
那么我该怎么做才能将公司徽标添加到初始屏幕?
构造函数中有2个CompanyLogoUri。从变量名可以看出,两者各有用途:
- companyLogoUri
- companyLogoForSplashScreenUri
我想你想设置第二个 ;-)