एक स्पलैशस्क्रीन वास्तव में कोई सीमा वाला कोई और विंडो नहीं है, और यह आकार बदलने योग्य नहीं है (न ही आप किसी भी तरह से इसके साथ बातचीत कर सकते हैं)। आप शायद इसे टास्क बार से छिपाना चाहते हैं, इसे स्क्रीन पर केंद्रित करें, आदि। विभिन्न सेटिंग्स के साथ खेलें जब तक कि आप जो प्रभाव चाहते हैं उसे प्राप्त न करें।
<Window x:Class="MyWhateverApp.MySplashScreen"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
ShowInTaskbar="False"
ResizeMode="NoResize"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
Background="Transparent"
AllowsTransparency="True"
Title="Sandbox Splash Screen"
SizeToContent="Width"
Topmost="True"
Height="{Binding RelativeSource={RelativeSource Self},
Path=ActualWidth}">
<Border CornerRadius="8" Margin="15">
<Border.Background>
<ImageBrush ImageSource="Resources\sandtexture.jpeg"
Stretch="Fill" />
</Border.Background>
<Border.Effect>
<DropShadowEffect Color="#894F3B"
BlurRadius="10"
Opacity="0.75"
ShadowDepth="15" />
</Border.Effect>
<TextBlock FontSize="40"
FontFamily="Bauhaus 93"
Foreground="White"
Margin="10"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Text="WPF 3.5 Sandbox">
<TextBlock.Effect>
<DropShadowEffect Color="Black" />
</TextBlock.Effect>
</TextBlock>
</Border>
</Window>
इसके बाद, स्टार्टअप खिड़की निकालने के लिए अपनी App.xaml फ़ाइल को संशोधित, और बदले स्टार्टअप घटना बढ़ा:
यहां एक त्वरित एक मैं लगभग 5 मिनट में ऊपर मार पड़ी सिद्धांत को साबित करने के है
<Application x:Class="MyWhateverApp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Startup="Application_Startup">
<Application.Resources>
</Application.Resources>
</Application>
और कोड-बैक में, एप्लिकेशन_स्टार्टअप ईवेंट को किसी भी तरह से सर्वोत्तम तरीके से संभालें। उदाहरण के लिए:
Window1 mainWindow = null;
private void Application_Startup(object sender, StartupEventArgs e)
{
MySplashScreen splash = new MySplashScreen();
splash.Show();
mainWindow = new Window1();
mainWindow.Show();
splash.Close();
}
की
स्रोत
2010-10-12 13:45:37
संभव डुप्लिकेट [WPF एनिमेटेड स्प्लैश स्क्रीन] (http://stackoverflow.com/questions/3677653/wpf-animated-splash-screen) –