-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add UwpAddOn project and updated README.md files. (#2)
- Loading branch information
1 parent
54cfe16
commit d91d752
Showing
28 changed files
with
884 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!-- Copyright (c) Microsoft Corporation. | ||
Licensed under the MIT License. --> | ||
<Application | ||
x:Class="UwpAddOn.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:UwpAddOn" | ||
RequestedTheme="Light"> | ||
|
||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
// | ||
// App.xaml.cpp | ||
// Implementation of the App class. | ||
// | ||
|
||
#include "pch.h" | ||
#include "MainPage.xaml.h" | ||
|
||
using namespace UwpAddOn; | ||
|
||
using namespace Platform; | ||
using namespace Windows::ApplicationModel; | ||
using namespace Windows::ApplicationModel::Activation; | ||
using namespace Windows::Foundation; | ||
using namespace Windows::Foundation::Collections; | ||
using namespace Windows::UI::Xaml; | ||
using namespace Windows::UI::Xaml::Controls; | ||
using namespace Windows::UI::Xaml::Controls::Primitives; | ||
using namespace Windows::UI::Xaml::Data; | ||
using namespace Windows::UI::Xaml::Input; | ||
using namespace Windows::UI::Xaml::Interop; | ||
using namespace Windows::UI::Xaml::Media; | ||
using namespace Windows::UI::Xaml::Navigation; | ||
|
||
/// <summary> | ||
/// Initializes the singleton application object. This is the first line of authored code | ||
/// executed, and as such is the logical equivalent of main() or WinMain(). | ||
/// </summary> | ||
App::App() | ||
{ | ||
InitializeComponent(); | ||
Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending); | ||
} | ||
|
||
/// <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> | ||
void App::OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) | ||
{ | ||
#if _DEBUG | ||
// Show graphics profiling information while debugging. | ||
if (IsDebuggerPresent()) | ||
{ | ||
// Display the current frame rate counters | ||
DebugSettings->EnableFrameRateCounter = true; | ||
} | ||
#endif | ||
auto rootFrame = dynamic_cast<Frame^>(Window::Current->Content); | ||
|
||
// Do not repeat app initialization when the Window already has content, | ||
// just ensure that the window is active | ||
if (rootFrame == nullptr) | ||
{ | ||
// Create a Frame to act as the navigation context and associate it with | ||
// a SuspensionManager key | ||
rootFrame = ref new Frame(); | ||
|
||
rootFrame->NavigationFailed += ref new Windows::UI::Xaml::Navigation::NavigationFailedEventHandler(this, &App::OnNavigationFailed); | ||
|
||
if (e->PreviousExecutionState == ApplicationExecutionState::Terminated) | ||
{ | ||
// TODO: Restore the saved session state only when appropriate, scheduling the | ||
// final launch steps after the restore is complete | ||
|
||
} | ||
|
||
if (e->PrelaunchActivated == false) | ||
{ | ||
if (rootFrame->Content == nullptr) | ||
{ | ||
// 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(TypeName(MainPage::typeid), e->Arguments); | ||
} | ||
// Place the frame in the current Window | ||
Window::Current->Content = rootFrame; | ||
// Ensure the current window is active | ||
Window::Current->Activate(); | ||
} | ||
} | ||
else | ||
{ | ||
if (e->PrelaunchActivated == false) | ||
{ | ||
if (rootFrame->Content == nullptr) | ||
{ | ||
// 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(TypeName(MainPage::typeid), e->Arguments); | ||
} | ||
// Ensure the current window is active | ||
Window::Current->Activate(); | ||
} | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Invoked when application execution is being suspended. Application state is saved | ||
/// without knowing whether the application will be terminated or resumed with the contents | ||
/// of memory still intact. | ||
/// </summary> | ||
/// <param name="sender">The source of the suspend request.</param> | ||
/// <param name="e">Details about the suspend request.</param> | ||
void App::OnSuspending(Object^ sender, SuspendingEventArgs^ e) | ||
{ | ||
(void) sender; // Unused parameter | ||
(void) e; // Unused parameter | ||
|
||
//TODO: Save application state and stop any background activity | ||
} | ||
|
||
/// <summary> | ||
/// Invoked when Navigation to a certain page fails | ||
/// </summary> | ||
/// <param name="sender">The Frame which failed navigation</param> | ||
/// <param name="e">Details about the navigation failure</param> | ||
void App::OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e) | ||
{ | ||
throw ref new FailureException("Failed to load Page " + e->SourcePageType.Name); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
// | ||
// App.xaml.h | ||
// Declaration of the App class. | ||
// | ||
|
||
#pragma once | ||
|
||
#include "App.g.h" | ||
|
||
namespace UwpAddOn | ||
{ | ||
/// <summary> | ||
/// Provides application-specific behavior to supplement the default Application class. | ||
/// </summary> | ||
ref class App sealed | ||
{ | ||
protected: | ||
virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ e) override; | ||
|
||
internal: | ||
App(); | ||
|
||
private: | ||
void OnSuspending(Platform::Object^ sender, Windows::ApplicationModel::SuspendingEventArgs^ e); | ||
void OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e); | ||
}; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!-- Copyright (c) Microsoft Corporation. | ||
Licensed under the MIT License. --> | ||
<Page | ||
x:Class="UwpAddOn.MainPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:UwpAddOn" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d"> | ||
|
||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
|
||
</Grid> | ||
</Page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
// | ||
// MainPage.xaml.cpp | ||
// Implementation of the MainPage class. | ||
// | ||
|
||
#include "pch.h" | ||
#include "MainPage.xaml.h" | ||
|
||
using namespace UwpAddOn; | ||
|
||
using namespace Platform; | ||
using namespace Windows::Foundation; | ||
using namespace Windows::Foundation::Collections; | ||
using namespace Windows::UI::Xaml; | ||
using namespace Windows::UI::Xaml::Controls; | ||
using namespace Windows::UI::Xaml::Controls::Primitives; | ||
using namespace Windows::UI::Xaml::Data; | ||
using namespace Windows::UI::Xaml::Input; | ||
using namespace Windows::UI::Xaml::Media; | ||
using namespace Windows::UI::Xaml::Navigation; | ||
|
||
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409 | ||
|
||
MainPage::MainPage() | ||
{ | ||
InitializeComponent(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
// | ||
// MainPage.xaml.h | ||
// Declaration of the MainPage class. | ||
// | ||
|
||
#pragma once | ||
|
||
#include "MainPage.g.h" | ||
|
||
namespace UwpAddOn | ||
{ | ||
/// <summary> | ||
/// An empty page that can be used on its own or navigated to within a Frame. | ||
/// </summary> | ||
public ref class MainPage sealed | ||
{ | ||
public: | ||
MainPage(); | ||
|
||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" | ||
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" | ||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" | ||
xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" | ||
IgnorableNamespaces="uap mp uap3"> | ||
<Identity | ||
Name="PublisherName.UwpAddOn" | ||
Publisher="CN=PublisherName" | ||
Version="1.0.0.0" /> | ||
<mp:PhoneIdentity PhoneProductId="84ae4f41-f92e-40cb-bb32-94c35856bff3" PhonePublisherId="00000000-0000-0000-0000-000000000000" /> | ||
<Properties> | ||
<DisplayName>UwpAddOn</DisplayName> | ||
<PublisherDisplayName>PublisherName</PublisherDisplayName> | ||
<Logo>Assets\StoreLogo.png</Logo> | ||
</Properties> | ||
<Dependencies> | ||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.14311.0" MaxVersionTested="10.0.14380.0" /> | ||
<PackageDependency Name="Microsoft.VCLibs.140.00" MinVersion="14.0.23918.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" /> | ||
<uap3:MainPackageDependency Name="PublisherName.ParentApp" /> | ||
</Dependencies> | ||
<Resources> | ||
<Resource Language="x-generate" /> | ||
</Resources> | ||
<Applications> | ||
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="UwpAddOn.App"> | ||
<uap:VisualElements | ||
AppListEntry="none" | ||
DisplayName="UwpAddOn" | ||
Square150x150Logo="Assets\Square150x150Logo.png" | ||
Square44x44Logo="Assets\Square44x44Logo.png" | ||
Description="AddOn1" | ||
BackgroundColor="transparent"> | ||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"> | ||
</uap:DefaultTile> | ||
<uap:SplashScreen Image="Assets\SplashScreen.png" /> | ||
</uap:VisualElements> | ||
</Application> | ||
</Applications> | ||
</Package> |
Oops, something went wrong.