Skip to content

Commit

Permalink
Set up infra to remove WebView with FeatureProps
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenLPeters committed Sep 10, 2021
1 parent bbc4549 commit 4b4f984
Show file tree
Hide file tree
Showing 10 changed files with 104 additions and 8 deletions.
3 changes: 3 additions & 0 deletions FeatureAreas.props
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,10 @@
<FeatureAnimatedIconEnabled>true</FeatureAnimatedIconEnabled>
<FeatureMonochromaticOverlayPresenterEnabled>true</FeatureMonochromaticOverlayPresenterEnabled>
<FeatureInfoBadgeEnabled>true</FeatureInfoBadgeEnabled>
<!-- Webview2 has been removed for the 2.7 release. -->
<FeatureWebView2Enabled Condition="'$(Platform)' != 'ARM'">true</FeatureWebView2Enabled>
<!--<FeatureWebView2Enabled>false</FeatureWebView2Enabled>-->

</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition="$(FeatureScrollPresenterEnabled) =='true'">$(DefineConstants);FEATURE_SCROLLPRESENTER_ENABLED</DefineConstants>
Expand Down
1 change: 1 addition & 0 deletions build/NuSpecs/MUXControls.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<projectUrl>https://github.com/microsoft/microsoft-ui-xaml</projectUrl>
<iconUrl>https://aka.ms/winui_icon</iconUrl>

<!--WebView2 has been removed for the 2.7 release-->
<dependencies>
<dependency id="Microsoft.Web.WebView2" version="[1.0.955-prerelease,)" />
</dependencies>
Expand Down
1 change: 1 addition & 0 deletions build/NuSpecs/MUXControlsFrameworkPackage.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<projectUrl>https://github.com/microsoft/microsoft-ui-xaml</projectUrl>
<iconUrl>https://aka.ms/winui_icon</iconUrl>

<!--WebView2 has been removed for the 2.7 release-->
<dependencies>
<dependency id="Microsoft.Web.WebView2" version="[1.0.955-prerelease,)" />
</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions dev/InfoBadge/InfoBadge.idl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace MU_XC_NAMESPACE
{

[MUX_PREVIEW]
[MUX_PUBLIC]
[webhosthidden]
unsealed runtimeclass InfoBadgeTemplateSettings : Windows.UI.Xaml.DependencyObject
{
Expand All @@ -14,7 +14,7 @@ unsealed runtimeclass InfoBadgeTemplateSettings : Windows.UI.Xaml.DependencyObje
static Windows.UI.Xaml.DependencyProperty IconElementProperty{ get; };
}

[MUX_PREVIEW]
[MUX_PUBLIC]
[webhosthidden]
[MUX_PROPERTY_CHANGED_CALLBACK(TRUE)]
[MUX_PROPERTY_CHANGED_CALLBACK_METHODNAME("OnPropertyChanged")]
Expand Down
2 changes: 1 addition & 1 deletion dev/NavigationView/NavigationView.idl
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ unsealed runtimeclass NavigationViewItem : NavigationViewItemBase
static Windows.UI.Xaml.DependencyProperty MenuItemsSourceProperty{ get; };
}

[MUX_PREVIEW]
[MUX_PUBLIC_V2]
{
[MUX_PROPERTY_CHANGED_CALLBACK(TRUE)]
InfoBadge InfoBadge{ get; set; };
Expand Down
2 changes: 1 addition & 1 deletion dev/NavigationView/NavigationViewItemPresenter.idl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ unsealed runtimeclass NavigationViewItemPresenter : Windows.UI.Xaml.Controls.Con
static Windows.UI.Xaml.DependencyProperty TemplateSettingsProperty{ get; };


[MUX_PREVIEW]
[MUX_PUBLIC_V2]
{
Microsoft.UI.Xaml.Controls.InfoBadge InfoBadge{ get; set; };
static Windows.UI.Xaml.DependencyProperty InfoBadgeProperty{ get; };
Expand Down
1 change: 1 addition & 0 deletions dev/WebView2/WebView2.vcxitems
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(XamlPublicHeadersPath);$(LiftedIXPIncludePaths)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>%(PreprocessorDefinitions);WEBVIEW2_INCLUDED</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
86 changes: 86 additions & 0 deletions enc_temp_folder/27db99d5cbcd18bc1a9a2ff5e5413e42/MainPage.xaml.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

//
// MainPage.xaml.cpp
// Implementation of the MainPage class.
//

#include "pch.h"
#include "MainPage.xaml.h"
#include "LeakCycleTestCX.xaml.h"
#include "MenuBarTestPage.xaml.h"
#include "CornerRadiusTestPage.xaml.h"
#include "TreeViewTestPage.xaml.h"
#include "BackdropMaterialTestPage.xaml.h"
#ifndef _ARM_
#ifdef WEBVIEW2_INCLUDED
#include "WebView2TestPage.xaml.h"
#endif
#endif

using namespace TestAppCX;

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::Interop;
using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Navigation;

MainPage::MainPage()
{
InitializeComponent();
}

void MainPage::OnNavigatedTo(NavigationEventArgs^ e)
{
auto coreTitleBar = Windows::ApplicationModel::Core::CoreApplication::GetCurrentView()->TitleBar;
coreTitleBar->ExtendViewIntoTitleBar = false;
}

void TestAppCX::MainPage::GoToLeakTestControlPage(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
auto app = dynamic_cast<App^>(Application::Current);
app->RootFrame->Navigate(TypeName(LeakCycleTestCX::typeid), nullptr);

}

void TestAppCX::MainPage::GoToMenuBarTestPage(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
auto app = dynamic_cast<App^>(Application::Current);
app->RootFrame->Navigate(TypeName(MenuBarTestPage::typeid), nullptr);
}

void TestAppCX::MainPage::GoToCornerRadiusTestPage(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
auto app = dynamic_cast<App^>(Application::Current);
app->RootFrame->Navigate(TypeName(CornerRadiusTestPage::typeid), nullptr);
}

void TestAppCX::MainPage::GoToTreeViewTestPage(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
auto app = dynamic_cast<App^>(Application::Current);
app->RootFrame->Navigate(TypeName(TreeViewTestPage::typeid), nullptr);
}

void TestAppCX::MainPage::GoToBackdropMaterialTestPage(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
auto app = dynamic_cast<App^>(Application::Current);
app->RootFrame->Navigate(TypeName(BackdropMaterialTestPage::typeid), nullptr);
}

void TestAppCX::MainPage::GoToWebView2TestPage(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
auto app = dynamic_cast<App^>(Application::Current);
#ifndef _ARM_
#ifdef WEBVIEW2_INCLUDED
app->RootFrame->Navigate(TypeName(WebView2TestPage::typeid), nullptr);
#endif
#endif
}
4 changes: 4 additions & 0 deletions test/TestAppCX/MainPage.xaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
#include "TreeViewTestPage.xaml.h"
#include "BackdropMaterialTestPage.xaml.h"
#ifndef _ARM_
#ifdef WEBVIEW2_INCLUDED
#include "WebView2TestPage.xaml.h"
#endif
#endif

using namespace TestAppCX;

Expand Down Expand Up @@ -77,6 +79,8 @@ void TestAppCX::MainPage::GoToWebView2TestPage(Platform::Object^ sender, Windows
{
auto app = dynamic_cast<App^>(Application::Current);
#ifndef _ARM_
#ifdef WEBVIEW2_INCLUDED
app->RootFrame->Navigate(TypeName(WebView2TestPage::typeid), nullptr);
#endif
#endif
}
8 changes: 4 additions & 4 deletions test/TestAppCX/TestAppCX.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
<ClInclude Include="TreeViewTestPage.xaml.h">
<DependentUpon>TreeViewTestPage.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="WebView2TestPage.xaml.h" Condition="'$(Platform)' != 'ARM'">
<ClInclude Include="WebView2TestPage.xaml.h" Condition="'$(Platform)' != 'ARM' And $(FeatureWebView2Enabled) == 'true'">
<DependentUpon>WebView2TestPage.xaml</DependentUpon>
</ClInclude>
</ItemGroup>
Expand All @@ -229,7 +229,7 @@
<Page Include="TreeViewTestPage.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="WebView2TestPage.xaml" Condition="'$(Platform)' != 'ARM'">
<Page Include="WebView2TestPage.xaml" Condition="'$(Platform)' != 'ARM' And $(FeatureWebView2Enabled) == 'true'">
<SubType>Designer</SubType>
</Page>
</ItemGroup>
Expand Down Expand Up @@ -281,7 +281,7 @@
<ClCompile Include="TreeViewTestPage.xaml.cpp">
<DependentUpon>TreeViewTestPage.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="WebView2TestPage.xaml.cpp" Condition="'$(Platform)' != 'ARM'">
<ClCompile Include="WebView2TestPage.xaml.cpp" Condition="'$(Platform)' != 'ARM' And $(FeatureWebView2Enabled) == 'true'">
<DependentUpon>WebView2TestPage.xaml</DependentUpon>
</ClCompile>
</ItemGroup>
Expand All @@ -292,7 +292,7 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="..\RetargetCopyLocalFiles.targets" />
<ImportGroup Label="ExtensionTargets" Condition="'$(Platform)' != 'ARM'">
<ImportGroup Label="ExtensionTargets" Condition="'$(Platform)' != 'ARM' And $(FeatureWebView2Enabled) == 'true'">
<Import Project="..\..\packages\Microsoft.Web.WebView2.1.0.955-prerelease\build\native\Microsoft.Web.WebView2.targets" Condition="Exists('..\..\packages\Microsoft.Web.WebView2.1.0.955-prerelease\build\native\Microsoft.Web.WebView2.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
Expand Down

1 comment on commit 4b4f984

@tuckstarrydell
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test/TestAppCX/TestAppCX.vcxproj

Please sign in to comment.