2010-07-26 2 views
0

WPF 스플래시 화면이 창으로 표시되지 않고 이미지로 표시되는 중 ... 내 말은 ... 이미지가 처음 나타나는 것처럼 보입니다. 그런 다음 ... 내 창 (상단에 막대가있는 창)이옵니다. ... 내 메인 창 내에서 이미지를 표시 할 방법wpf 스플래시 화면을 메인 윈도우에 표시하는 방법은 무엇입니까?

+0

스플래시 화면이 뭔가를 표시하는 데 사용하려고합니다. 메인 윈도우가 표시된 후에 왜 스플래시 화면을 표시하겠습니까? 메인 윈도우의 스크린 샷을 만들어 스플래시 화면으로 사용하는 것이 가장 좋은 이유는 무엇입니까? – adrianm

답변

0

는 메인 윈도우가 생성 및 초기화하는 동안이

<Window x:Class="WpfApplication43.Window1" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
Title="Window1" Height="600" Width="800" AllowsTransparency="True" WindowStyle="None" Background="{x:Null}" HorizontalAlignment="Center" VerticalAlignment="Center" WindowStartupLocation="CenterScreen"> 
<Window.Resources> 
    <Storyboard x:Key="OnLoaded1"> 
     <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="splashGrid" Storyboard.TargetProperty="(UIElement.Opacity)"> 
      <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/> 
      <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1"/> 
      <SplineDoubleKeyFrame KeyTime="00:00:03" Value="1"/> 
      <SplineDoubleKeyFrame KeyTime="00:00:04" Value="0"/> 
     </DoubleAnimationUsingKeyFrames> 
     <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="(UIElement.Opacity)"> 
      <SplineDoubleKeyFrame KeyTime="00:00:03.6000000" Value="0"/> 
      <SplineDoubleKeyFrame KeyTime="00:00:04.3000000" Value="1"/> 
     </DoubleAnimationUsingKeyFrames> 
    </Storyboard> 
</Window.Resources> 
<Window.Triggers> 
    <EventTrigger RoutedEvent="FrameworkElement.Loaded"> 
     <BeginStoryboard Storyboard="{StaticResource OnLoaded1}"/> 
    </EventTrigger> 
</Window.Triggers> 
    <Grid> 
     <Grid x:Name="LayoutRoot" Opacity="0" Background="#FF180A0A"/> 
     <Grid RenderTransformOrigin="0.5,0.5" Width="400" Height="300" 
      x:Name="splashGrid" 
      Opacity="0" 
       HorizontalAlignment="Center" 
       VerticalAlignment="Center" 
      Margin="0,0,0,0" > 
      <Border BorderBrush="Black" BorderThickness="0" CornerRadius="10" Background="#FFAD6868"> 
       <Grid Margin="5"> 
        <Image Margin="0" Source="The_Midnight_Sun_by_Isilmetriel.jpg" Stretch="Fill"/> 
       </Grid> 
      </Border> 
     </Grid> 
    </Grid> 

+0

이것이 메인 윈도우 xaml입니까? – Relativity

+0

스플래시 그리드가 메인 윈도우 내부에 있으며 3 또는 4 초 후에 가시성이 0으로 변경됩니다. –

관련 문제