-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extension: Respect WinUI3XPLaunchProject
- Loading branch information
Showing
25 changed files
with
594 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Application | ||
x:Class="TestDepSampleApp.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:TestDepSampleApp"> | ||
<Application.Resources> | ||
<ResourceDictionary> | ||
<ResourceDictionary.MergedDictionaries> | ||
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" /> | ||
<!-- Other merged dictionaries here --> | ||
</ResourceDictionary.MergedDictionaries> | ||
<!-- Other app resources here --> | ||
</ResourceDictionary> | ||
</Application.Resources> | ||
</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,47 @@ | ||
#include "pch.h" | ||
#include "App.xaml.h" | ||
#include "MainWindow.xaml.h" | ||
|
||
using namespace winrt; | ||
using namespace Microsoft::UI::Xaml; | ||
|
||
// To learn more about WinUI, the WinUI project structure, | ||
// and more about our project templates, see: http://aka.ms/winui-project-info. | ||
|
||
namespace winrt::TestDepSampleApp::implementation | ||
{ | ||
/// <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() | ||
{ | ||
// Xaml objects should not call InitializeComponent during construction. | ||
// See https://github.com/microsoft/cppwinrt/tree/master/nuget#initializecomponent | ||
|
||
#if defined _DEBUG && !defined DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION | ||
UnhandledException([](IInspectable const&, UnhandledExceptionEventArgs const& e) | ||
{ | ||
if (IsDebuggerPresent()) | ||
{ | ||
auto errorMessage = e.Message(); | ||
__debugbreak(); | ||
} | ||
}); | ||
#endif | ||
} | ||
|
||
/// <summary> | ||
/// Invoked when the application is launched. | ||
/// </summary> | ||
/// <param name="e">Details about the launch request and process.</param> | ||
winrt::fire_and_forget App::OnLaunched([[maybe_unused]] LaunchActivatedEventArgs const& e) | ||
{ | ||
if (co_await WinUI3XamlPreview::Preview::IsXamlPreviewLaunched()) | ||
{ | ||
co_return; | ||
} | ||
window = make<MainWindow>(); | ||
window.Activate(); | ||
} | ||
} |
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,16 @@ | ||
#pragma once | ||
|
||
#include "App.xaml.g.h" | ||
|
||
namespace winrt::TestDepSampleApp::implementation | ||
{ | ||
struct App : AppT<App> | ||
{ | ||
App(); | ||
|
||
winrt::fire_and_forget OnLaunched(Microsoft::UI::Xaml::LaunchActivatedEventArgs const&); | ||
|
||
private: | ||
winrt::Microsoft::UI::Xaml::Window window{ nullptr }; | ||
}; | ||
} |
Binary file added
BIN
+432 Bytes
WinUI3XamlPreview/TestDepSampleApp/Assets/LockScreenLogo.scale-200.png
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.
Binary file added
BIN
+1.71 KB
WinUI3XamlPreview/TestDepSampleApp/Assets/Square150x150Logo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+637 Bytes
WinUI3XamlPreview/TestDepSampleApp/Assets/Square44x44Logo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+283 Bytes
...view/TestDepSampleApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
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.
Binary file added
BIN
+2.05 KB
WinUI3XamlPreview/TestDepSampleApp/Assets/Wide310x150Logo.scale-200.png
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,9 @@ | ||
namespace TestDepSampleApp | ||
{ | ||
[default_interface] | ||
runtimeclass MainWindow : Microsoft.UI.Xaml.Window | ||
{ | ||
MainWindow(); | ||
Int32 MyProperty; | ||
} | ||
} |
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,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Window | ||
x:Class="TestDepSampleApp.MainWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:TestDepSampleApp" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d"> | ||
|
||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"> | ||
<Button x:Name="myButton" Click="myButton_Click">Click Me</Button> | ||
</StackPanel> | ||
</Window> |
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 @@ | ||
#include "pch.h" | ||
#include "MainWindow.xaml.h" | ||
#if __has_include("MainWindow.g.cpp") | ||
#include "MainWindow.g.cpp" | ||
#endif | ||
|
||
using namespace winrt; | ||
using namespace Microsoft::UI::Xaml; | ||
|
||
// To learn more about WinUI, the WinUI project structure, | ||
// and more about our project templates, see: http://aka.ms/winui-project-info. | ||
|
||
namespace winrt::TestDepSampleApp::implementation | ||
{ | ||
int32_t MainWindow::MyProperty() | ||
{ | ||
throw hresult_not_implemented(); | ||
} | ||
|
||
void MainWindow::MyProperty(int32_t /* value */) | ||
{ | ||
throw hresult_not_implemented(); | ||
} | ||
|
||
void MainWindow::myButton_Click(IInspectable const&, RoutedEventArgs const&) | ||
{ | ||
myButton().Content(box_value(L"Clicked")); | ||
} | ||
} |
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,27 @@ | ||
#pragma once | ||
|
||
#include "MainWindow.g.h" | ||
|
||
namespace winrt::TestDepSampleApp::implementation | ||
{ | ||
struct MainWindow : MainWindowT<MainWindow> | ||
{ | ||
MainWindow() | ||
{ | ||
// Xaml objects should not call InitializeComponent during construction. | ||
// See https://github.com/microsoft/cppwinrt/tree/master/nuget#initializecomponent | ||
} | ||
|
||
int32_t MyProperty(); | ||
void MyProperty(int32_t value); | ||
|
||
void myButton_Click(IInspectable const& sender, Microsoft::UI::Xaml::RoutedEventArgs const& args); | ||
}; | ||
} | ||
|
||
namespace winrt::TestDepSampleApp::factory_implementation | ||
{ | ||
struct MainWindow : MainWindowT<MainWindow, implementation::MainWindow> | ||
{ | ||
}; | ||
} |
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,60 @@ | ||
<?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:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5" | ||
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" | ||
IgnorableNamespaces="uap rescap"> | ||
|
||
<Identity | ||
Name="56fe763f-0a11-4e75-86c0-6ca322852abb" | ||
Publisher="CN=Roxk" | ||
Version="1.0.0.0" /> | ||
|
||
<mp:PhoneIdentity PhoneProductId="56fe763f-0a11-4e75-86c0-6ca322852abb" PhonePublisherId="00000000-0000-0000-0000-000000000000"/> | ||
|
||
<Properties> | ||
<DisplayName>TestDepSampleApp</DisplayName> | ||
<PublisherDisplayName>Roxk</PublisherDisplayName> | ||
<Logo>Assets\StoreLogo.png</Logo> | ||
</Properties> | ||
|
||
<Dependencies> | ||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" /> | ||
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" /> | ||
</Dependencies> | ||
|
||
<Resources> | ||
<Resource Language="x-generate"/> | ||
</Resources> | ||
|
||
<Applications> | ||
<Application Id="App" | ||
Executable="$targetnametoken$.exe" | ||
EntryPoint="$targetentrypoint$"> | ||
<uap:VisualElements | ||
DisplayName="TestDepSampleApp" | ||
Description="TestDepSampleApp" | ||
BackgroundColor="transparent" | ||
Square150x150Logo="Assets\Square150x150Logo.png" | ||
Square44x44Logo="Assets\Square44x44Logo.png"> | ||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" /> | ||
<uap:SplashScreen Image="Assets\SplashScreen.png" /> | ||
</uap:VisualElements> | ||
<Extensions> | ||
<uap5:Extension | ||
Category="windows.appExecutionAlias"> | ||
<uap5:AppExecutionAlias> | ||
<uap5:ExecutionAlias Alias="TestDepSampleApp-WinUI3XP.exe" /> | ||
</uap5:AppExecutionAlias> | ||
</uap5:Extension> | ||
</Extensions> | ||
</Application> | ||
</Applications> | ||
|
||
<Capabilities> | ||
<rescap:Capability Name="runFullTrust" /> | ||
</Capabilities> | ||
</Package> |
Oops, something went wrong.