From 01a9ab0def07ecddbc1bdfa67fec1bd3e6d030ea Mon Sep 17 00:00:00 2001 From: Gilles Khouzam Date: Tue, 31 Mar 2015 13:49:39 -0700 Subject: VS: Add support for XAML source files XAML files are by default of type Page in the vcxproj and can be overriden by setting the VS_XAML_TYPE property. The .cpp and .h file of the same name are automatically added as depending on the XAML file. New VSXaml test builds a basic XAML WindowsStore 8.1 app with VS2013. --- Help/manual/cmake-properties.7.rst | 1 + Help/prop_sf/VS_XAML_TYPE.rst | 6 ++ Help/release/dev/vs-xaml.rst | 6 ++ Source/cmGeneratorTarget.cxx | 49 ++++++++++ Source/cmGeneratorTarget.h | 13 +++ Source/cmVisualStudio10TargetGenerator.cxx | 80 +++++++++++++++- Source/cmVisualStudio10TargetGenerator.h | 3 + Tests/CMakeLists.txt | 11 +++ Tests/VSWindowsFormsResx/CMakeLists.txt | 2 +- Tests/VSXaml/App.xaml | 7 ++ Tests/VSXaml/App.xaml.cpp | 125 +++++++++++++++++++++++++ Tests/VSXaml/App.xaml.h | 27 ++++++ Tests/VSXaml/Assets/Logo.scale-100.png | Bin 0 -> 801 bytes Tests/VSXaml/Assets/SmallLogo.scale-100.png | Bin 0 -> 329 bytes Tests/VSXaml/Assets/SplashScreen.scale-100.png | Bin 0 -> 2146 bytes Tests/VSXaml/Assets/StoreLogo.scale-100.png | Bin 0 -> 429 bytes Tests/VSXaml/CMakeLists.txt | 52 ++++++++++ Tests/VSXaml/MainPage.xaml | 14 +++ Tests/VSXaml/MainPage.xaml.cpp | 27 ++++++ Tests/VSXaml/MainPage.xaml.h | 21 +++++ Tests/VSXaml/Package.appxmanifest | 41 ++++++++ Tests/VSXaml/VSXaml_TemporaryKey.pfx | Bin 0 -> 2560 bytes Tests/VSXaml/pch.cpp | 6 ++ Tests/VSXaml/pch.h | 11 +++ 24 files changed, 498 insertions(+), 4 deletions(-) create mode 100644 Help/prop_sf/VS_XAML_TYPE.rst create mode 100644 Help/release/dev/vs-xaml.rst create mode 100644 Tests/VSXaml/App.xaml create mode 100644 Tests/VSXaml/App.xaml.cpp create mode 100644 Tests/VSXaml/App.xaml.h create mode 100644 Tests/VSXaml/Assets/Logo.scale-100.png create mode 100644 Tests/VSXaml/Assets/SmallLogo.scale-100.png create mode 100644 Tests/VSXaml/Assets/SplashScreen.scale-100.png create mode 100644 Tests/VSXaml/Assets/StoreLogo.scale-100.png create mode 100644 Tests/VSXaml/CMakeLists.txt create mode 100644 Tests/VSXaml/MainPage.xaml create mode 100644 Tests/VSXaml/MainPage.xaml.cpp create mode 100644 Tests/VSXaml/MainPage.xaml.h create mode 100644 Tests/VSXaml/Package.appxmanifest create mode 100644 Tests/VSXaml/VSXaml_TemporaryKey.pfx create mode 100644 Tests/VSXaml/pch.cpp create mode 100644 Tests/VSXaml/pch.h diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 1dff33e..76dd279 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -298,6 +298,7 @@ Properties on Source Files /prop_sf/VS_SHADER_FLAGS /prop_sf/VS_SHADER_MODEL /prop_sf/VS_SHADER_TYPE + /prop_sf/VS_XAML_TYPE /prop_sf/WRAP_EXCLUDE /prop_sf/XCODE_EXPLICIT_FILE_TYPE /prop_sf/XCODE_LAST_KNOWN_FILE_TYPE diff --git a/Help/prop_sf/VS_XAML_TYPE.rst b/Help/prop_sf/VS_XAML_TYPE.rst new file mode 100644 index 0000000..e92191d --- /dev/null +++ b/Help/prop_sf/VS_XAML_TYPE.rst @@ -0,0 +1,6 @@ +VS_XAML_TYPE +------------ + +Mark a XAML source file as a different type than the default ``Page``. +The most common usage would be to set the default App.xaml file as +ApplicationDefinition. diff --git a/Help/release/dev/vs-xaml.rst b/Help/release/dev/vs-xaml.rst new file mode 100644 index 0000000..575899f --- /dev/null +++ b/Help/release/dev/vs-xaml.rst @@ -0,0 +1,6 @@ +vs-xaml +------- + +* The :ref:`Visual Studio Generators` learned to support ``.xaml`` + source files and automatically associate them with corresponding + ``.h`` and ``.cpp`` sources. diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index e0af47a..41d12d7 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -56,6 +56,7 @@ struct ResxTag {}; struct ModuleDefinitionFileTag {}; struct AppManifestTag{}; struct CertificatesTag{}; +struct XamlTag{}; template struct IsSameTag @@ -98,6 +99,20 @@ struct DoAccept data.ExpectedResxHeaders.insert(hFileName); data.ResxSources.push_back(f); } + static void Do(cmGeneratorTarget::XamlData& data, cmSourceFile* f) + { + // Build and save the name of the corresponding .h and .cpp file + // This relationship will be used later when building the project files. + // Both names would have been auto generated from Visual Studio + // where the user supplied the file name and Visual Studio + // appended the suffix. + std::string xaml = f->GetFullPath(); + std::string hFileName = xaml + ".h"; + std::string cppFileName = xaml + ".cpp"; + data.ExpectedXamlHeaders.insert(hFileName); + data.ExpectedXamlSources.insert(cppFileName); + data.XamlSources.push_back(f); + } static void Do(std::string& data, cmSourceFile* f) { data = f->GetFullPath(); @@ -186,6 +201,10 @@ struct TagVisitor { DoAccept::Result>::Do(this->Data, sf); } + else if (ext == "xaml") + { + DoAccept::Result>::Do(this->Data, sf); + } else if(this->Header.find(sf->GetFullPath().c_str())) { DoAccept::Result>::Do(this->Data, sf); @@ -438,6 +457,36 @@ cmGeneratorTarget } //---------------------------------------------------------------------------- +void +cmGeneratorTarget::GetExpectedXamlHeaders(std::set& headers, + const std::string& config) const +{ + XamlData data; + IMPLEMENT_VISIT_IMPL(Xaml, COMMA cmGeneratorTarget::XamlData) + headers = data.ExpectedXamlHeaders; +} + +//---------------------------------------------------------------------------- +void +cmGeneratorTarget::GetExpectedXamlSources(std::set& srcs, + const std::string& config) const +{ + XamlData data; + IMPLEMENT_VISIT_IMPL(Xaml, COMMA cmGeneratorTarget::XamlData) + srcs = data.ExpectedXamlSources; +} + +//---------------------------------------------------------------------------- +void cmGeneratorTarget +::GetXamlSources(std::vector& srcs, + const std::string& config) const +{ + XamlData data; + IMPLEMENT_VISIT_IMPL(Xaml, COMMA cmGeneratorTarget::XamlData) + srcs = data.XamlSources; +} + +//---------------------------------------------------------------------------- bool cmGeneratorTarget::IsSystemIncludeDirectory(const std::string& dir, const std::string& config) const { diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index c329cf5..c79aa72 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -58,6 +58,12 @@ public: const std::string& config) const; void GetCertificates(std::vector&, const std::string& config) const; + void GetXamlSources(std::vector&, + const std::string& config) const; + void GetExpectedXamlHeaders(std::set&, + const std::string& config) const; + void GetExpectedXamlSources(std::set&, + const std::string& config) const; void ComputeObjectMapping(); @@ -132,6 +138,13 @@ public: mutable std::set ExpectedResxHeaders; mutable std::vector ResxSources; }; + + struct XamlData { + std::set ExpectedXamlHeaders; + std::set ExpectedXamlSources; + std::vector XamlSources; + }; + private: friend class cmTargetTraceDependencies; struct SourceEntry { std::vector Depends; }; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 19444ed..dad6f93 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -461,6 +461,7 @@ void cmVisualStudio10TargetGenerator::Generate() this->WriteAllSources(); this->WriteDotNetReferences(); this->WriteEmbeddedResourceGroup(); + this->WriteXamlFilesGroup(); this->WriteWinRTReferences(); this->WriteProjectReferences(); this->WriteString( @@ -522,8 +523,7 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup() this->WriteString("", 3); std::string hFileName = obj.substr(0, obj.find_last_of(".")) + ".h"; - (*this->BuildFileStream ) << hFileName; - this->WriteString("\n", 3); + (*this->BuildFileStream) << hFileName << "\n"; std::vector const * configs = this->GlobalGenerator->GetConfigurations(); @@ -546,6 +546,38 @@ void cmVisualStudio10TargetGenerator::WriteEmbeddedResourceGroup() } } +void cmVisualStudio10TargetGenerator::WriteXamlFilesGroup() +{ + std::vector xamlObjs; + this->GeneratorTarget->GetXamlSources(xamlObjs, ""); + if (!xamlObjs.empty()) + { + this->WriteString("\n", 1); + for (std::vector::const_iterator + oi = xamlObjs.begin(); oi != xamlObjs.end(); ++oi) + { + std::string obj = (*oi)->GetFullPath(); + std::string xamlType; + const char * xamlTypeProperty = (*oi)->GetProperty("VS_XAML_TYPE"); + if (xamlTypeProperty) + { + xamlType = xamlTypeProperty; + } + else + { + xamlType = "Page"; + } + + this->WriteSource(xamlType, *oi, ">\n"); + this->WriteString("Designer\n", 3); + this->WriteString("BuildFileStream) << xamlType << ">\n"; + + } + this->WriteString("\n", 1); + } +} + void cmVisualStudio10TargetGenerator::WriteTargetSpecificReferences() { if(this->MSTools) @@ -1192,12 +1224,21 @@ WriteGroupSources(const char* name, void cmVisualStudio10TargetGenerator::WriteHeaderSource(cmSourceFile const* sf) { - if(this->IsResxHeader(sf->GetFullPath())) + std::string const& fileName = sf->GetFullPath(); + if (this->IsResxHeader(fileName)) { this->WriteSource("ClInclude", sf, ">\n"); this->WriteString("CppForm\n", 3); this->WriteString("\n", 2); } + else if (this->IsXamlHeader(fileName)) + { + this->WriteSource("ClInclude", sf, ">\n"); + this->WriteString("", 3); + std::string xamlFileName = fileName.substr(0, fileName.find_last_of(".")); + (*this->BuildFileStream) << xamlFileName << "\n"; + this->WriteString("\n", 2); + } else { this->WriteSource("ClInclude", sf); @@ -1669,6 +1710,17 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( " ", "\n", lang); } } + if (this->IsXamlSource(source->GetFullPath())) + { + (*this->BuildFileStream) << firstString; + firstString = ""; // only do firstString once + hasFlags = true; + this->WriteString("", 3); + const std::string& fileName = source->GetFullPath(); + std::string xamlFileName = fileName.substr(0, fileName.find_last_of(".")); + (*this->BuildFileStream) << xamlFileName << "\n"; + } + return hasFlags; } @@ -2749,6 +2801,28 @@ bool cmVisualStudio10TargetGenerator:: return it != expectedResxHeaders.end(); } +bool cmVisualStudio10TargetGenerator:: +IsXamlHeader(const std::string& headerFile) +{ + std::set expectedXamlHeaders; + this->GeneratorTarget->GetExpectedXamlHeaders(expectedXamlHeaders, ""); + + std::set::const_iterator it = + expectedXamlHeaders.find(headerFile); + return it != expectedXamlHeaders.end(); +} + +bool cmVisualStudio10TargetGenerator:: +IsXamlSource(const std::string& sourceFile) +{ + std::set expectedXamlSources; + this->GeneratorTarget->GetExpectedXamlSources(expectedXamlSources, ""); + + std::set::const_iterator it = + expectedXamlSources.find(sourceFile); + return it != expectedXamlSources.end(); +} + void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings() { bool isAppContainer = false; diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index a02dfa8..a2776de 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -69,6 +69,7 @@ private: void WriteEmbeddedResourceGroup(); void WriteWinRTReferences(); void WriteWinRTPackageCertificateKeyFile(); + void WriteXamlFilesGroup(); void WritePathAndIncrementalLinkOptions(); void WriteItemDefinitionGroups(); void VerifyNecessaryFiles(); @@ -119,6 +120,8 @@ private: void AddMissingSourceGroups(std::set& groupsUsed, const std::vector& allGroups); bool IsResxHeader(const std::string& headerFile); + bool IsXamlHeader(const std::string& headerFile); + bool IsXamlSource(const std::string& headerFile); cmIDEFlagTable const* GetClFlagTable() const; cmIDEFlagTable const* GetRcFlagTable() const; diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 5944d08..1df39aa 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1927,6 +1927,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_test_VSWinStorePhone(vs12-store81-X86 "Visual Studio 12 2013" WindowsStore 8.1) add_test_VSWinStorePhone(vs12-store81-ARM "Visual Studio 12 2013 ARM" WindowsStore 8.1) add_test_VSWinStorePhone(vs12-store81-X64 "Visual Studio 12 2013 Win64" WindowsStore 8.1) + + add_test(NAME VSXaml COMMAND ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/VSXaml" + "${CMake_BINARY_DIR}/Tests/VSXaml" + --build-generator "Visual Studio 12 2013" + --build-project VSXaml + --build-config $ + --build-options -DCMAKE_SYSTEM_NAME=WindowsStore + -DCMAKE_SYSTEM_VERSION=8.1 + ) endif() if(vs11 AND wp80) add_test_VSWinStorePhone(vs11-phone80-X86 "Visual Studio 11 2012" WindowsPhone 8.0) diff --git a/Tests/VSWindowsFormsResx/CMakeLists.txt b/Tests/VSWindowsFormsResx/CMakeLists.txt index 4373810..43c4833 100644 --- a/Tests/VSWindowsFormsResx/CMakeLists.txt +++ b/Tests/VSWindowsFormsResx/CMakeLists.txt @@ -14,7 +14,7 @@ include(CheckCXXSourceCompiles) include(CheckIncludeFile) # Note: The designable form is assumed to have a .h extension as is default in Visual Studio. -# Node: The designable form is assumed to have a .resx file with the same name and path (save extension) as is default in Visual Studio +# Note: The designable form is assumed to have a .resx file with the same name and path (save extension) as is default in Visual Studio set(TARGET_H WindowsFormsResx/MyForm.h diff --git a/Tests/VSXaml/App.xaml b/Tests/VSXaml/App.xaml new file mode 100644 index 0000000..eecf2c1 --- /dev/null +++ b/Tests/VSXaml/App.xaml @@ -0,0 +1,7 @@ + + + diff --git a/Tests/VSXaml/App.xaml.cpp b/Tests/VSXaml/App.xaml.cpp new file mode 100644 index 0000000..334dc1f --- /dev/null +++ b/Tests/VSXaml/App.xaml.cpp @@ -0,0 +1,125 @@ +// +// App.xaml.cpp +// Implementation of the App class. +// + +#include "pch.h" +#include "MainPage.xaml.h" + +using namespace VSXaml; + +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; + +// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227 + +/// +/// 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(). +/// +App::App() +{ + InitializeComponent(); + Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending); +} + +/// +/// 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. +/// +/// Details about the launch request and process. +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(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(); + + // Set the default language + rootFrame->Language = Windows::Globalization::ApplicationLanguages::Languages->GetAt(0); + + 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 (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 (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(); + } +} + +/// +/// 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. +/// +/// The source of the suspend request. +/// Details about the suspend request. +void App::OnSuspending(Object^ sender, SuspendingEventArgs^ e) +{ + (void) sender; // Unused parameter + (void) e; // Unused parameter + + //TODO: Save application state and stop any background activity +} + +/// +/// Invoked when Navigation to a certain page fails +/// +/// The Frame which failed navigation +/// Details about the navigation failure +void App::OnNavigationFailed(Platform::Object ^sender, Windows::UI::Xaml::Navigation::NavigationFailedEventArgs ^e) +{ + throw ref new FailureException("Failed to load Page " + e->SourcePageType.Name); +} \ No newline at end of file diff --git a/Tests/VSXaml/App.xaml.h b/Tests/VSXaml/App.xaml.h new file mode 100644 index 0000000..1f65bda --- /dev/null +++ b/Tests/VSXaml/App.xaml.h @@ -0,0 +1,27 @@ +// +// App.xaml.h +// Declaration of the App class. +// + +#pragma once + +#include "App.g.h" + +namespace VSXaml +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + 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); + }; +} diff --git a/Tests/VSXaml/Assets/Logo.scale-100.png b/Tests/VSXaml/Assets/Logo.scale-100.png new file mode 100644 index 0000000..e26771c Binary files /dev/null and b/Tests/VSXaml/Assets/Logo.scale-100.png differ diff --git a/Tests/VSXaml/Assets/SmallLogo.scale-100.png b/Tests/VSXaml/Assets/SmallLogo.scale-100.png new file mode 100644 index 0000000..1eb0d9d Binary files /dev/null and b/Tests/VSXaml/Assets/SmallLogo.scale-100.png differ diff --git a/Tests/VSXaml/Assets/SplashScreen.scale-100.png b/Tests/VSXaml/Assets/SplashScreen.scale-100.png new file mode 100644 index 0000000..c951e03 Binary files /dev/null and b/Tests/VSXaml/Assets/SplashScreen.scale-100.png differ diff --git a/Tests/VSXaml/Assets/StoreLogo.scale-100.png b/Tests/VSXaml/Assets/StoreLogo.scale-100.png new file mode 100644 index 0000000..dcb6727 Binary files /dev/null and b/Tests/VSXaml/Assets/StoreLogo.scale-100.png differ diff --git a/Tests/VSXaml/CMakeLists.txt b/Tests/VSXaml/CMakeLists.txt new file mode 100644 index 0000000..f384c82 --- /dev/null +++ b/Tests/VSXaml/CMakeLists.txt @@ -0,0 +1,52 @@ +cmake_minimum_required(VERSION 3.2) +project(VSXaml) + +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +set(SOURCE_FILES + App.xaml.cpp + MainPage.xaml.cpp + pch.cpp + ) + +set(HEADER_FILES + App.xaml.h + MainPage.xaml.h + pch.h + ) + +set(XAML_FILES + App.xaml + MainPage.xaml + ) + +set(ASSET_FILES + Assets/Logo.scale-100.png + Assets/SmallLogo.scale-100.png + Assets/SplashScreen.scale-100.png + Assets/StoreLogo.scale-100.png + ) + +set(CONTENT_FILES + Package.appxmanifest + ) + +set(RESOURCE_FILES + ${CONTENT_FILES} ${ASSET_FILES} + VSXaml_TemporaryKey.pfx) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + +set_property(SOURCE ${CONTENT_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1) +set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_CONTENT 1) +set_property(SOURCE ${ASSET_FILES} PROPERTY VS_DEPLOYMENT_LOCATION "Assets") + +set_property(SOURCE "App.xaml" PROPERTY VS_XAML_TYPE "ApplicationDefinition") + +source_group("Source Files" FILES ${SOURCE_FILES}) +source_group("Header Files" FILES ${HEADER_FILES}) +source_group("Resource Files" FILES ${RESOURCE_FILES}) +source_group("Xaml Files" FILES ${XAML_FILES}) + +add_executable(VSXaml WIN32 ${SOURCE_FILES} ${HEADER_FILES} ${RESOURCE_FILES} ${XAML_FILES}) +set_property(TARGET VSXaml PROPERTY VS_WINRT_COMPONENT TRUE) diff --git a/Tests/VSXaml/MainPage.xaml b/Tests/VSXaml/MainPage.xaml new file mode 100644 index 0000000..62139ca --- /dev/null +++ b/Tests/VSXaml/MainPage.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/Tests/VSXaml/MainPage.xaml.cpp b/Tests/VSXaml/MainPage.xaml.cpp new file mode 100644 index 0000000..d0a64e8 --- /dev/null +++ b/Tests/VSXaml/MainPage.xaml.cpp @@ -0,0 +1,27 @@ +// +// MainPage.xaml.cpp +// Implementation of the MainPage class. +// + +#include "pch.h" +#include "MainPage.xaml.h" + +using namespace VSXaml; + +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=234238 + +MainPage::MainPage() +{ + InitializeComponent(); +} diff --git a/Tests/VSXaml/MainPage.xaml.h b/Tests/VSXaml/MainPage.xaml.h new file mode 100644 index 0000000..ccc781b --- /dev/null +++ b/Tests/VSXaml/MainPage.xaml.h @@ -0,0 +1,21 @@ +// +// MainPage.xaml.h +// Declaration of the MainPage class. +// + +#pragma once + +#include "MainPage.g.h" + +namespace VSXaml +{ + /// + /// An empty page that can be used on its own or navigated to within a Frame. + /// + public ref class MainPage sealed + { + public: + MainPage(); + + }; +} diff --git a/Tests/VSXaml/Package.appxmanifest b/Tests/VSXaml/Package.appxmanifest new file mode 100644 index 0000000..873a64a --- /dev/null +++ b/Tests/VSXaml/Package.appxmanifest @@ -0,0 +1,41 @@ + + + + + + + VSXaml + Microsoft + Assets\StoreLogo.png + + + + 6.3.0 + 6.3.0 + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Tests/VSXaml/VSXaml_TemporaryKey.pfx b/Tests/VSXaml/VSXaml_TemporaryKey.pfx new file mode 100644 index 0000000..1cad999 Binary files /dev/null and b/Tests/VSXaml/VSXaml_TemporaryKey.pfx differ diff --git a/Tests/VSXaml/pch.cpp b/Tests/VSXaml/pch.cpp new file mode 100644 index 0000000..01484ff --- /dev/null +++ b/Tests/VSXaml/pch.cpp @@ -0,0 +1,6 @@ +// +// pch.cpp +// Include the standard header and generate the precompiled header. +// + +#include "pch.h" diff --git a/Tests/VSXaml/pch.h b/Tests/VSXaml/pch.h new file mode 100644 index 0000000..2c4354d --- /dev/null +++ b/Tests/VSXaml/pch.h @@ -0,0 +1,11 @@ +// +// pch.h +// Header for standard system include files. +// + +#pragma once + +#include +#include + +#include "App.xaml.h" -- cgit v0.12