示例#1
0
 void PositionImage()
 {
     LogoImage.SetValue(Canvas.LeftProperty, _SplashImageRect.X);
     LogoImage.SetValue(Canvas.TopProperty, _SplashImageRect.Y);
     LogoImage.Height = _SplashImageRect.Height;
     LogoImage.Width  = _SplashImageRect.Width;
 }
示例#2
0
        public SplashScreenImage(SplashScreenSettings settings, string splashImagePath, string logoPath)
        {
            InitializeComponent();
            if (!string.IsNullOrEmpty(splashImagePath))
            {
                BackgroundImage.Source = new BitmapImage(new Uri(splashImagePath));
            }
            if (!string.IsNullOrEmpty(logoPath))
            {
                LogoImage.Source            = new BitmapImage(new Uri(logoPath));
                LogoImage.VerticalAlignment = settings.LogoVerticalAlignment;
                switch (settings.LogoHorizontalAlignment)
                {
                case HorizontalAlignment.Left:
                    LogoImage.SetValue(Grid.ColumnProperty, 0);
                    break;

                case HorizontalAlignment.Center:
                    LogoImage.SetValue(Grid.ColumnProperty, 1);
                    break;

                case HorizontalAlignment.Right:
                    LogoImage.SetValue(Grid.ColumnProperty, 2);
                    break;

                default:
                    break;
                }
            }
        }