2015-07-10 85 views
0

Im试图修改我的乐团应用程序的默认启动画面。发现SplashScreen.png默认包含在resources/images文件夹中,并用我自己的(相同的宽度和高度)覆盖它。启动画面没有改变。更改Catel + Orchestra应用程序的启动画面

我去看了Orchestra的代码,发现了SplashScreen视图。并看到你有一个companylogo的占位符。

 <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; 
    } 

但在AboutInfo对象的CompanyLogoForSplashScreenUri酒店需要从GetAboutInfo返回总是空。构造函数永远不会将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) 

那么我能做些什么来添加companylogo到splashscreen?

回答

1

在构造函数中有2 CompanyLogoUri。正如你可以通过变量名看,都有自己的目的:

  1. companyLogoUri
  2. companyLogoForSplashScreenUri

我想你想设置的第二;-)

相关问题