0
我已經創建了啓動畫面,並且在動畫之後,我將關閉飛濺並顯示最大化的登錄窗體。登錄表單是空白的,直到我最小化它才顯示任何元素。如果我從Visual Studio運行應用程序,它運行良好,當我從調試.exe文件運行它時,它沒有。如果登錄屏幕未設置爲最大化,則顯示正常。 這是我的啓動畫面:在啓動畫面最大化後窗口不會顯示任何元素
XAML
<Window x:Class="Manager.Splash"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Manager"
mc:Ignorable="d"
Title="Splash" Height="350" Width="525" AllowsTransparency="True" WindowStyle="None" ResizeMode="NoResize" ShowInTaskbar="False" WindowStartupLocation="CenterScreen">
<Window.Triggers>
<EventTrigger RoutedEvent="Window.Loaded">
<BeginStoryboard>
<Storyboard Name="storyBoard">
<DoubleAnimation Duration="00:00:03" Storyboard.TargetProperty="Opacity" To="0">
</DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Window.Triggers>
<Grid>
<Image Name="splash" Source="/Slike/Splash.png"></Image>
</Grid>
代碼背後
public partial class Splash : Window
{
public Splash()
{
InitializeComponent();
load();
}
private void load()
{
storyBoard.Completed += new EventHandler(Story_Completed);
}
private void Story_Completed(object sender, EventArgs e)
{
Start appStart = new Start();
this.Close();
appStart.ShowDialog();
}
}