本文整理汇总了C#中Windows.ApplicationModel.Activation.SplashScreen类的典型用法代码示例。如果您正苦于以下问题:C# SplashScreen类的具体用法?C# SplashScreen怎么用?C# SplashScreen使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SplashScreen类属于Windows.ApplicationModel.Activation命名空间,在下文中一共展示了SplashScreen类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExtendedSplashScreen
public ExtendedSplashScreen(SplashScreen splashscreen)
{
InitializeComponent();
// Listen for window resize events to reposition the extended splash screen image accordingly.
// This ensures that the extended splash screen formats properly in response to window resizing.
Window.Current.SizeChanged += ExtendedSplash_OnResize;
_splash = splashscreen;
if (_splash != null)
{
// Register an event handler to be executed when the splash screen has been dismissed.
_splash.Dismissed += DismissedEventHandler;
// Retrieve the window coordinates of the splash screen image.
_splashImageRect = _splash.ImageLocation;
PositionImage();
// If applicable, include a method for positioning a progress control.
PositionRing();
}
// Create a Frame to act as the navigation context
_rootFrame = new Frame();
this.Loaded += async (sender, args) => { await this.AppBootstrapper(); };
}
示例2: ArrangeImage
private void ArrangeImage(SplashScreen splashScreen)
{
this.MyImage.Height = splashScreen.ImageLocation.Height;
this.MyImage.Width = splashScreen.ImageLocation.Width;
this.MyImage.SetValue(Canvas.LeftProperty, splashScreen.ImageLocation.X);
this.MyImage.SetValue(Canvas.TopProperty, splashScreen.ImageLocation.Y);
}
示例3: ExtendedSplashPage
public ExtendedSplashPage(SplashScreen splashscreen, bool loadState) {
this.InitializeComponent();
// Listen for window resize events to reposition the extended splash screen image accordingly.
// This ensures that the extended splash screen formats properly in response to window resizing.
Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);
// Is this a phone? Then set the scaling factor
if (String.Equals(AnalyticsInfo.VersionInfo.DeviceFamily, "Windows.Mobile")) {
scaleFactor = DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel;
}
splash = splashscreen;
if (splash != null) {
// Register an event handler to be executed when the splash screen has been dismissed.
splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);
// Retrieve the window coordinates of the splash screen image.
splashImageRect = splash.ImageLocation;
PositionImage();
// If applicable, include a method for positioning a progress control.
PositionRing();
}
// Create a Frame to act as the navigation context
rootFrame = new Frame();
// Restore the saved session state if necessary
RestoreStateAsync(loadState);
}
示例4: ExtendedSplash
public ExtendedSplash(SplashScreen splashscreen, bool loadState)
{
InitializeComponent();
setuptitle();
LoginVM vm = this.DataContext as LoginVM;
STARTUP(vm);
// LearnMoreButton.Click += new RoutedEventHandler(LearnMoreButton_Click);
// Listen for window resize events to reposition the extended splash screen image accordingly.
// This is important to ensure that the extended splash screen is formatted properly in response to snapping, unsnapping, rotation, etc...
Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);
ScaleFactor = (double)DisplayInformation.GetForCurrentView().ResolutionScale / 100;
splash = splashscreen;
if (splash != null)
{
// Register an event handler to be executed when the splash screen has been dismissed.
splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);
// Retrieve the window coordinates of the splash screen image.
splashImageRect = splash.ImageLocation;
PositionImage();
}
// Create a Frame to act as the navigation context
rootFrame = new Frame();
// Restore the saved session state if necessary
RestoreStateAsync(loadState);
}
示例5: ExtendedSplash
private SplashScreen splash; // Variable to hold the splash screen object.
public ExtendedSplash(SplashScreen splashscreen)
{
InitializeComponent();
// Listen for window resize events to reposition the extended splash screen image accordingly.
// This is important to ensure that the extended splash screen is formatted properly in response to snapping, unsnapping, rotation, etc...
Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);
splash = splashscreen;
if (splash != null)
{
// Register an event handler to be executed when the splash screen has been dismissed.
splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);
// Retrieve the window coordinates of the splash screen image.
splashImageRect = splash.ImageLocation;
PositionImage();
}
// Create a Frame to act as the navigation context
rootFrame = new Frame() { Background = (SolidColorBrush)App.Current.Resources["AppBackgroundBrush"] };
rootFrame.Navigated += rootFrame_Navigated;
//DissmissStory.Begin();
}
示例6: MyExtend1
public MyExtend1(SplashScreen splashscreen, bool loadState)
{
this.InitializeComponent();
// Listen for window resize events to reposition the extended splash screen image accordingly.
// This ensures that the extended splash screen formats properly in response to window resizing.
Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);
splash = splashscreen;
if (splash != null)
{
// Register an event handler to be executed when the splash screen has been dismissed.
splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);
// Retrieve the window coordinates of the splash screen image.
splashImageRect = splash.ImageLocation;
PositionImage();
// If applicable, include a method for positioning a progress control.
PositionRing();
}
// Create a Frame to act as the navigation context
rootFrame = new Frame();
// Restore the saved session state if necessary
RestoreStateAsync(loadState);
}
示例7: DismissedEventHandler
// Include code to be executed when the system has transitioned from the splash screen to the extended splash screen (application's first view).
async void DismissedEventHandler(SplashScreen sender, object e)
{
dismissed = true;
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
{
// Complete app setup operations here...
var connectionProfile = Windows.Networking.Connectivity.NetworkInformation.GetInternetConnectionProfile();
if (connectionProfile != null)
{
FeedDataSource feedDataSource = (FeedDataSource)App.Current.Resources["feedDataSource"];
if (feedDataSource != null)
{
if (feedDataSource.Feeds.Count == 0)
{
await feedDataSource.GetFeedsAsync();
}
}
}
else
{
var messageDialog = new Windows.UI.Popups.MessageDialog("An internet connection is needed to download feeds. Please check your connection and restart the app.");
var result = messageDialog.ShowAsync();
}
DismissExtendedSplash();
});
}
示例8: Init
/// <summary>
/// Place Splash Screen at the center of the page and register to the following events:
/// DataTransferManager -> DataRequested
/// SearchPane -> SuggestionsRequested, SearchPaneQuerySubmitted
/// SettingsPane -> CommandsRequested
/// NotesDataSource -> DataCompleted
/// </summary>
/// <param name="splashScreen">SplashScreen from IActivatedEventArgs</param>
async private void Init(SplashScreen splashScreen)
{
//if (!SampleDataSource.DataLoaded)
//{
// this.InitializeComponent();
// this.splashImageCoordinates = splashScreen.ImageLocation;
// this.splash = splashScreen;
// // Position the extended splash screen image in the same location as the splash screen image.
// this.loader.SetValue(Canvas.LeftProperty, this.splashImageCoordinates.X);
// this.loader.SetValue(Canvas.TopProperty, this.splashImageCoordinates.Y);
// this.loader.Height = this.splashImageCoordinates.Height;
// this.loader.Width = this.splashImageCoordinates.Width;
// DataTransferManager datatransferManager;
// datatransferManager = DataTransferManager.GetForCurrentView();
// datatransferManager.DataRequested += new TypedEventHandler<DataTransferManager, DataRequestedEventArgs>(this.DataRequested);
// Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);
// SearchPane.GetForCurrentView().SuggestionsRequested += SearchPaneSuggestionsRequested;
// SearchPane.GetForCurrentView().QuerySubmitted += SearchPaneQuerySubmitted;
// SettingsPane.GetForCurrentView().CommandsRequested += OnCommandsRequested;
// NotesDataSource data = new NotesDataSource();
// data.Completed += Data_Completed;
// await data.Load();
//}
//else
//{
// Data_Completed(this, null);
//}
}
示例9: SplashPage
public SplashPage(SplashScreen splashscreen)
{
this.InitializeComponent();
// Listen for window resize events to reposition the extended splash screen image accordingly.
// This ensures that the extended splash screen formats properly in response to window resizing.
Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);
scaleFactor = (double)DisplayInformation.GetForCurrentView().ResolutionScale / 100;
splash = splashscreen;
if (splash != null)
{
// Register an event handler to be executed when the splash screen has been dismissed.
splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);
// Retrieve the window coordinates of the splash screen image.
splashImageRect = splash.ImageLocation;
PositionImage();
// Optional: Add a progress ring to your splash screen to show users that content is loading
PositionRing();
}
}
示例10: ExtendedSplash
public ExtendedSplash(SplashScreen splashScreen, bool loadState)
{
this.InitializeComponent();
settings = new SettingsFlyout();
settings.Closed += settings_Closed;
SettingsPane.GetForCurrentView().CommandsRequested += BlankPage_CommandsRequested;
// Listen for window resize events to reposition the extended splash screen image accordingly.
// This is important to ensure that the extended splash screen is formatted properly in response to snapping, unsnapping, rotation, etc...
Window.Current.SizeChanged += new WindowSizeChangedEventHandler(Current_SizeChanged);
_splash = splashScreen;
if (_splash != null)
{
// Register an event handler to be executed when the splash screen has been dismissed.
_splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);
this.Loaded += ExtendedSplash_Loaded;
// Retrieve the window coordinates of the splash screen image.
splashImageRect = _splash.ImageLocation;
PositionImage();
}
// Create a Frame to act as the navigation context
rootFrame = new Frame();
// Restore the saved session state if necessary
RestoreStateAsync(loadState);
}
示例11: MainPage
public MainPage(SplashScreen splashScreen)
{
this.InitializeComponent();
splash = splashScreen;
OnResize();
Window.Current.SizeChanged += new WindowSizeChangedEventHandler((o, e) => OnResize());
//Window Visibility event handler
Window.Current.VisibilityChanged += OnWindowVisibilityChanged;
//added for share
dataTransferManager.DataRequested += new TypedEventHandler<DataTransferManager,
DataRequestedEventArgs>(this.ShareTextHandler);
WindowsGateway.ShareHighScore = ShareHighScore;
//added for extended splash screen
// ensure we listen to when unity tells us game is ready
WindowsGateway.UnityLoaded = OnUnityLoaded;
// create extended splash timer
extendedSplashTimer = new DispatcherTimer();
extendedSplashTimer.Interval = TimeSpan.FromMilliseconds(100);
extendedSplashTimer.Tick += ExtendedSplashTimer_Tick;
extendedSplashTimer.Start();
}
示例12: ExtendedSplash
public ExtendedSplash(SplashScreen splashscreen, bool loadState)
{
InitializeComponent();
timer = new Timer((param) => {
Dispatcher.RunAsync(CoreDispatcherPriority.Normal, ()=>{
// Navigate to mainpage
rootFrame.Navigate(typeof(MainPage));
// Place the frame in the current Window
Window.Current.Content = rootFrame;
});
}, null, 5000, 1);
// Listen for window resize events to reposition the extended splash screen image accordingly.
// This ensures that the extended splash screen formats properly in response to window resizing.
Window.Current.SizeChanged += new WindowSizeChangedEventHandler(ExtendedSplash_OnResize);
splash = splashscreen;
if (splash != null)
{
// Register an event handler to be executed when the splash screen has been dismissed.
splash.Dismissed += new TypedEventHandler<SplashScreen, Object>(DismissedEventHandler);
// Retrieve the window coordinates of the splash screen image.
splashImageRect = splash.ImageLocation;
PositionImage();
// If applicable, include a method for positioning a progress control.
PositionRing();
}
// Create a Frame to act as the navigation context
rootFrame = new Frame();
}
示例13: MainPage
public MainPage()
{
this.InitializeComponent();
NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Required;
AppCallbacks appCallbacks = AppCallbacks.Instance;
// Setup scripting bridge
_bridge = new WinRTBridge.WinRTBridge();
appCallbacks.SetBridge(_bridge);
appCallbacks.RenderingStarted += () => { RemoveSplashScreen(); };
#if !UNITY_WP_8_1
appCallbacks.SetKeyboardTriggerControl(this);
#endif
appCallbacks.SetSwapChainPanel(GetSwapChainPanel());
appCallbacks.SetCoreWindowEvents(Window.Current.CoreWindow);
appCallbacks.InitializeD3DXAML();
splash = ((App)App.Current).splashScreen;
GetSplashBackgroundColor();
OnResize();
onResizeHandler = new WindowSizeChangedEventHandler((o, e) => OnResize());
Window.Current.SizeChanged += onResizeHandler;
#if UNITY_WP_8_1
onRotationChangedHandler = new TypedEventHandler<DisplayInformation, object>((di, o) => { OnRotate(di); });
ExtendedSplashImage.RenderTransformOrigin = new Point(0.5, 0.5);
var displayInfo = DisplayInformation.GetForCurrentView();
displayInfo.OrientationChanged += onRotationChangedHandler;
OnRotate(displayInfo);
SetupLocationService();
#endif
}
示例14: OnActivated
/// <summary>
/// Invoked when application is launched through protocol.
/// Read more - http://msdn.microsoft.com/library/windows/apps/br224742
/// </summary>
/// <param name="args"></param>
protected override void OnActivated(IActivatedEventArgs args)
{
//string appArgs = "";
//switch (args.Kind)
//{
// case ActivationKind.Protocol:
// ProtocolActivatedEventArgs eventArgs = args as ProtocolActivatedEventArgs;
// splashScreen = eventArgs.SplashScreen;
// appArgs += string.Format("Uri={0}", eventArgs.Uri.AbsoluteUri);
// break;
//}
//InitializeUnity(appArgs);
string appArgs = "";
Windows.ApplicationModel.Activation.SplashScreen splashScreen = null;
switch (args.Kind)
{
case ActivationKind.Protocol:
ProtocolActivatedEventArgs eventArgs = args as ProtocolActivatedEventArgs;
splashScreen = eventArgs.SplashScreen;
appArgs += string.Format("Uri={0}", eventArgs.Uri.AbsoluteUri);
break;
//Add VoiceCommand start detection and use the SpeechHelper handler
case ActivationKind.VoiceCommand:
SpeechHelper.HandleSpeechCommand(args);
break;
}
InitializeUnity(appArgs, splashScreen);
}
示例15: Splash
public Splash(SplashScreen splashScreen)
{
InitializeComponent();
Window.Current.SizeChanged += (s, e) => Resize(splashScreen);
Resize(splashScreen);
Opacity = 0;
}