本文整理汇总了C#中Windows.ApplicationModel.Activation.LaunchActivatedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# LaunchActivatedEventArgs类的具体用法?C# LaunchActivatedEventArgs怎么用?C# LaunchActivatedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LaunchActivatedEventArgs类属于Windows.ApplicationModel.Activation命名空间,在下文中一共展示了LaunchActivatedEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnLaunched
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
Forms.Init(e);
//Don't do frame stuff here - do it
Window.Current.Content = new MainPage();
Window.Current.Activate();
}
示例2: OnLaunched
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
Container.Register<Toodeloo.WinRT.Infrastructure.Execution.IDispatcher>(new Toodeloo.WinRT.Infrastructure.Execution.Dispatcher(Window.Current.Dispatcher));
var viewModelLocator = Resources["ViewModelLocator"] as ViewModelLocator;
viewModelLocator.Initialize();
var rootFrame = Window.Current.Content as Frame;
if (rootFrame == null)
{
rootFrame = new Frame();
if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
ApplicationService.Resume();
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
if (!rootFrame.Navigate(typeof(MainPage), args.Arguments))
throw new Exception("Failed to create initial page");
SharingService.Initialize();
SearchService.Initialize();
Window.Current.Activate();
}
示例3: OnLaunched
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used when the application is launched to open a specific file, to display
/// search results, and so forth.
/// </summary>
/// <param name="args">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
// Do not repeat app initialization when already running, just ensure that
// the window is active
if (args.PreviousExecutionState == ApplicationExecutionState.Running)
{
Window.Current.Activate();
return;
}
if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously suspended application
}
// Create a Frame to act navigation context and navigate to the first page
var rootFrame = new Frame();
if (!rootFrame.Navigate(typeof(MainPage)))
{
throw new Exception("Failed to create initial page");
}
// Place the frame in the current Window and ensure that it is active
Window.Current.Content = rootFrame;
Window.Current.Activate();
}
示例4: OnLaunched
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
Frame rootFrame = Window.Current.Content as Frame;
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (rootFrame == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();
rootFrame.NavigationFailed += OnNavigationFailed;
// Add background to our Frame for navigation transitions
rootFrame.Background = (Brush)Application.Current.Resources["ApplicationPageBackgroundThemeBrush"];
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously suspended application
}
// Place the frame in the current Window
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
rootFrame.Navigate(typeof(MainPage), e.Arguments);
}
// Ensure the current window is active
Window.Current.Activate();
}
示例5: OnLaunched
/// <summary>
/// 在應用程式由使用者正常啟動時叫用。其他進入點
/// 將在啟動應用程式以開啟特定檔案時使用,以顯示
/// 搜尋結果等。
/// </summary>
/// <param name="args">關於啟動要求和處理序的詳細資料。</param>
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
Frame rootFrame = Window.Current.Content as Frame;
// 當視窗已經有內容時,不重複應用程式初始化,
// 只確定視窗是作用中
if (rootFrame == null)
{
// 建立框架做為巡覽內容,並巡覽至第一頁
rootFrame = new Frame();
if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: 從之前暫停的應用程式載入狀態
}
// 將框架放在目前視窗中
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
// 在巡覽堆疊未還原時,巡覽至第一頁,
// 設定新的頁面,方式是透過傳遞必要資訊做為巡覽
// 參數
if (!rootFrame.Navigate(typeof(MainPage), args.Arguments))
{
throw new Exception("Failed to create initial page");
}
}
// 確定目前視窗是作用中
Window.Current.Activate();
}
示例6: OnLaunched
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e) {
Appboy.SharedInstance.OpenSession();
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached) {
this.DebugSettings.EnableFrameRateCounter = true;
}
#endif
Frame rootFrame = Window.Current.Content as Frame;
if (rootFrame == null) {
rootFrame = new Frame();
rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];
rootFrame.NavigationFailed += OnNavigationFailed;
rootFrame.Navigated += Appboy.SharedInstance.SlideupManager.NavigationEvent;
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) {
//TODO: Load state from previously suspended application
}
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null) {
rootFrame.Navigate(typeof(MainPage), e.Arguments);
}
Window.Current.Activate();
}
示例7: OnLaunched
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
Frame rootFrame = Window.Current.Content as Frame;
if (rootFrame == null)
{
rootFrame = new Frame();
rootFrame.NavigationFailed += OnNavigationFailed;
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously suspended application
}
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
rootFrame.Navigate(typeof(MainPage), e.Arguments);
}
Window.Current.Activate();
}
示例8: OnLaunched
protected override async void OnLaunched(LaunchActivatedEventArgs args)
{
Frame rootFrame = Window.Current.Content as Frame;
if (rootFrame == null)
{
rootFrame = new Frame();
SuspensionManager.RegisterFrame(rootFrame, "AppFrame");
if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
try
{
await SuspensionManager.RestoreAsync();
}
catch (SuspensionManagerException)
{
//Something went wrong restoring state.
//Assume there is no state and continue
}
}
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
if (!rootFrame.Navigate(typeof(GroupedItemsPage), "AllGroups"))
{
throw new Exception("Failed to create initial page");
}
}
Window.Current.Activate();
this.InitSettings();
}
示例9: OnLaunched
/// <summary>
/// Invoked when the application is launched normally by the end user.
/// </summary>
/// <param name="args">A <see cref="LaunchActivatedEventArgs"/> containing details about the launch request and
/// the process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
var rootFrame = Window.Current.Content as Frame;
if (rootFrame == null)
{
rootFrame = new Frame();
if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously suspended application
}
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
if (!rootFrame.Navigate(typeof(MainPage), args.Arguments))
{
throw new Exception("Failed to create initial page");
}
}
Window.Current.Activate();
}
示例10: OnLaunched
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used when the application is launched to open a specific file, to display
/// search results, and so forth.
/// </summary>
/// <param name="args">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
// TODO: Create a data model appropriate for your problem domain to replace the sample data
var sampleData = new SampleDataSource();
if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously suspended application
}
// Create a Frame to act navigation context and navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
var rootFrame = new Frame();
rootFrame.Navigate(typeof(Dashboard), sampleData);
// Place the frame in the current Window and ensure that it is active
Window.Current.Content = rootFrame;
Window.Current.Activate();
// move to an appropriate place
var liveTiles = new LiveTiles();
liveTiles.ShowAsLiveTile("Wash the car");
liveTiles.ShowAsLiveTile("Do the dishes");
liveTiles.ShowAsLiveTile("Show the app");
liveTiles.ShowAsLiveTile("Mow the lawn");
liveTiles.ShowAsBadge(6);
liveTiles.ShowAsToast("Woot, a toast!");
}
示例11: OnLaunched
/// <summary>
/// Wird aufgerufen, wenn die Anwendung durch den Endbenutzer normal gestartet wird. Weitere Einstiegspunkte
/// werden verwendet, wenn die Anwendung zum Öffnen einer bestimmten Datei, zum Anzeigen
/// von Suchergebnissen usw. gestartet wird.
/// </summary>
/// <param name="e">Details über Startanforderung und -prozess.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
this.DebugSettings.EnableFrameRateCounter = true;
}
#endif
Frame rootFrame = Window.Current.Content as Frame;
// App-Initialisierung nicht wiederholen, wenn das Fenster bereits Inhalte enthält.
// Nur sicherstellen, dass das Fenster aktiv ist.
if (rootFrame == null)
{
// Frame erstellen, der als Navigationskontext fungiert und zum Parameter der ersten Seite navigieren
rootFrame = new Frame();
// TODO: diesen Wert auf eine Cachegröße ändern, die für Ihre Anwendung geeignet ist
rootFrame.CacheSize = 1;
// Standardsprache festlegen
rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
// TODO: Zustand von zuvor angehaltener Anwendung laden
}
// Den Frame im aktuellen Fenster platzieren
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
// Entfernt die Drehkreuznavigation für den Start.
if (rootFrame.ContentTransitions != null)
{
this.transitions = new TransitionCollection();
foreach (var c in rootFrame.ContentTransitions)
{
this.transitions.Add(c);
}
}
rootFrame.ContentTransitions = null;
rootFrame.Navigated += this.RootFrame_FirstNavigated;
// Wenn der Navigationsstapel nicht wiederhergestellt wird, zur ersten Seite navigieren
// und die neue Seite konfigurieren, indem die erforderlichen Informationen als Navigationsparameter
// übergeben werden
if (!rootFrame.Navigate(typeof(MainPage), e.Arguments))
{
throw new Exception("Failed to create initial page");
}
}
// Sicherstellen, dass das aktuelle Fenster aktiv ist
Window.Current.Activate();
}
示例12: OnLaunched
/// <summary>
/// Se invoca cuando la aplicación la inicia normalmente el usuario final. Se usarán otros puntos
/// de entrada cuando la aplicación se inicie para abrir un archivo específico, para mostrar
/// resultados de la búsqueda, etc.
/// </summary>
/// <param name="e">Información detallada acerca de la solicitud y el proceso de inicio.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
this.DebugSettings.EnableFrameRateCounter = true;
}
#endif
Frame rootFrame = Window.Current.Content as Frame;
// No repetir la inicialización de la aplicación si la ventana tiene contenido todavía,
// solo asegurarse de que la ventana está activa.
if (rootFrame == null)
{
// Crear un marco para que actúe como contexto de navegación y navegar a la primera página.
rootFrame = new Frame();
// TODO: Cambiar este valor a un tamaño de caché adecuado para la aplicación
rootFrame.CacheSize = 1;
// Establecer el idioma predeterminado
rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
// TODO: Cargar el estado de la aplicación suspendida previamente
}
// Poner el marco en la ventana actual.
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
// Quita la navegación de transición en el inicio.
if (rootFrame.ContentTransitions != null)
{
this.transitions = new TransitionCollection();
foreach (var c in rootFrame.ContentTransitions)
{
this.transitions.Add(c);
}
}
rootFrame.ContentTransitions = null;
rootFrame.Navigated += this.RootFrame_FirstNavigated;
// Cuando no se restaura la pila de navegación, navegar a la primera página,
// configurando la nueva página pasándole la información requerida como
//parámetro de navegación
if (!rootFrame.Navigate(typeof(MainPage), e.Arguments))
{
throw new Exception("Failed to create initial page");
}
}
// Asegurarse de que la ventana actual está activa.
Window.Current.Activate();
}
示例13: OnLaunched
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
Messenger.Default.Register<GoToPageMessage>(this, NavigateToPage);
Frame rootFrame = Window.Current.Content as Frame;
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (rootFrame == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();
rootFrame.NavigationFailed += OnNavigationFailed;
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously suspended application
}
// Place the frame in the current Window
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
rootFrame.Navigate(typeof(MainPage), e.Arguments);
}
// Ensure the current window is active
Window.Current.Activate();
}
示例14: OnLaunched
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used when the application is launched to open a specific file, to display
/// search results, and so forth.
/// </summary>
/// <param name="args">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
// TODO: Create a data model appropriate for your problem domain to replace the sample data
var mainViewModel = new MainViewModel();
if (args.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously suspended application
}
// Create a Frame to act navigation context and navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
//var rootFrame = new Frame();
////rootFrame.Navigate(typeof(GroupedItemsPage), sampleData.ItemGroups);
//rootFrame.Navigate(typeof(GroupedItemsPage), mainViewModel.Board);
//// Place the frame in the current Window and ensure that it is active
//Window.Current.Content = rootFrame;
SplashScreen splashscreen = args.SplashScreen;
var extendedSplashScreen = new ExtendedSplashView(splashscreen, false);
splashscreen.Dismissed += extendedSplashScreen.dismissedEventHandler;
Window.Current.Content = extendedSplashScreen;
Window.Current.Activate();
}
示例15: OnLaunched
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used when the application is launched to open a specific file, to display
/// search results, and so forth.
/// </summary>
/// <param name="args">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
Frame rootFrame = Window.Current.Content as Frame;
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (rootFrame == null)
{
var mainPage = new MainPage(args.SplashScreen);
Window.Current.Content = mainPage;
Window.Current.Activate();
// Setup scripting bridge
_bridge = new WinRTBridge.WinRTBridge();
appCallbacks.SetBridge(_bridge);
appCallbacks.SetSwapChainBackgroundPanel(mainPage.GetSwapChainBackgroundPanel());
appCallbacks.SetCoreWindowEvents(Window.Current.CoreWindow);
appCallbacks.InitializeD3DXAML();
}
Window.Current.Activate();
}