This commit is contained in:
Matthew Leibowitz 2021-09-23 02:32:19 +02:00
Родитель a82ccd92db
Коммит 3cd14afc18
9 изменённых файлов: 0 добавлений и 68 удалений

Просмотреть файл

@ -603,7 +603,6 @@ namespace Microsoft.Maui.Controls.Compatibility.ControlGallery
protected TestShell() : base()
{
Device.SetFlags(new List<string> { ExperimentalFlags.ShellUWPExperimental });
Routing.Clear();
#if APP
Init();

Просмотреть файл

@ -1,50 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
namespace Microsoft.Maui.Controls
{
static class ExperimentalFlags
{
internal const string ShellUWPExperimental = "Shell_UWP_Experimental";
[EditorBrowsable(EditorBrowsableState.Never)]
public static void VerifyFlagEnabled(
string coreComponentName,
string flagName,
string constructorHint = null,
[CallerMemberName] string memberName = "")
{
if (DesignMode.IsDesignModeEnabled)
{
return;
}
if (Device.Flags == null || !Device.Flags.Contains(flagName))
{
if (!String.IsNullOrEmpty(memberName))
{
if (!String.IsNullOrEmpty(constructorHint))
{
constructorHint = constructorHint + " ";
}
var call = $"('{constructorHint}{memberName}')";
var errorMessage = $"The class, property, or method you are attempting to use {call} is part of "
+ $"{coreComponentName}; to use it, you must opt-in by calling "
+ $"Forms.SetFlags(\"{flagName}\") before calling Forms.Init().";
throw new InvalidOperationException(errorMessage);
}
var genericErrorMessage =
$"To use {coreComponentName} or associated classes, you must opt-in by calling "
+ $"Forms.SetFlags(\"{flagName}\") before calling Forms.Init().";
throw new InvalidOperationException(genericErrorMessage);
}
}
}
}

Просмотреть файл

@ -12,8 +12,6 @@ namespace Microsoft.Maui.Controls.Platform
public ShellFooterView(Shell element)
{
Shell.VerifyShellUWPFlagEnabled(nameof(ShellFooterView));
SetElement(element);
SizeChanged += OnShellFooterViewSizeChanged;
HorizontalContentAlignment = HorizontalAlignment.Stretch;

Просмотреть файл

@ -11,8 +11,6 @@ namespace Microsoft.Maui.Controls.Platform
public ShellHeaderView(Shell element)
{
Shell.VerifyShellUWPFlagEnabled(nameof(ShellHeaderView));
SetElement(element);
SizeChanged += OnShellHeaderViewSizeChanged;
HorizontalContentAlignment = HorizontalAlignment.Stretch;

Просмотреть файл

@ -41,7 +41,6 @@ namespace Microsoft.Maui.Controls.Platform
public ShellItemView(ShellView shellContext)
{
Microsoft.Maui.Controls.Shell.VerifyShellUWPFlagEnabled(nameof(ShellItemView));
_ = shellContext ?? throw new ArgumentNullException(nameof(shellContext));
ShellContext = shellContext;

Просмотреть файл

@ -30,7 +30,6 @@ namespace Microsoft.Maui.Controls.Platform
ObservableCollection<ShellContent> ShellContentMenuItems;
public ShellSectionView()
{
Microsoft.Maui.Controls.Shell.VerifyShellUWPFlagEnabled(nameof(ShellSectionView));
MenuItemTemplate = (Microsoft.UI.Xaml.DataTemplate)Microsoft.UI.Xaml.Application.Current.Resources["ShellSectionMenuItemTemplate"];
IsBackButtonVisible = Microsoft.UI.Xaml.Controls.NavigationViewBackButtonVisible.Collapsed;
IsSettingsVisible = false;

Просмотреть файл

@ -24,7 +24,6 @@ namespace Microsoft.Maui.Controls.Platform
public ShellToolbarItemView()
{
Microsoft.Maui.Controls.Shell.VerifyShellUWPFlagEnabled(nameof(ShellToolbarItemView));
Click += OnClick;
}

Просмотреть файл

@ -42,7 +42,6 @@ namespace Microsoft.Maui.Controls.Platform
public ShellView()
{
Microsoft.Maui.Controls.Shell.VerifyShellUWPFlagEnabled(nameof(ShellView));
_flyoutBackdrop = Brush.Default;
IsSettingsVisible = false;
PaneDisplayMode = Microsoft.UI.Xaml.Controls.NavigationViewPaneDisplayMode.LeftMinimal;

Просмотреть файл

@ -1327,15 +1327,6 @@ namespace Microsoft.Maui.Controls
}
#endregion
[EditorBrowsable(EditorBrowsableState.Never)]
public static void VerifyShellUWPFlagEnabled(
string constructorHint = null,
[CallerMemberName] string memberName = "")
{
// ExperimentalFlags.VerifyFlagEnabled(nameof(Shell), ExperimentalFlags.ShellUWPExperimental);
}
class NavigationImpl : NavigationProxy
{
readonly Shell _shell;