Merge branch 'main' into shweaver/storage-helpers
This commit is contained in:
Коммит
e65332ba28
|
@ -74,19 +74,20 @@
|
|||
</controls:ListDetailsView.NoSelectionContentTemplate>
|
||||
<controls:ListDetailsView.ListCommandBar>
|
||||
<CommandBar>
|
||||
<!-- Button functionality to be implemented by developer -->
|
||||
<AppBarButton Icon="Back" Label="Back"/>
|
||||
<AppBarButton Icon="Forward" Label="Forward"/>
|
||||
|
||||
<CommandBar.Content>
|
||||
<TextBlock Margin="12,14">
|
||||
<Run Text="{Binding Emails.Count}" />
|
||||
<Run Text="Items" />
|
||||
</TextBlock>
|
||||
</CommandBar.Content>
|
||||
</CommandBar>
|
||||
<CommandBar.Content>
|
||||
<TextBlock Margin="12,14">
|
||||
<Run Text="{Binding Emails.Count}" />
|
||||
<Run Text="Items" />
|
||||
</TextBlock>
|
||||
</CommandBar.Content>
|
||||
</CommandBar>
|
||||
</controls:ListDetailsView.ListCommandBar>
|
||||
<controls:ListDetailsView.DetailsCommandBar>
|
||||
<CommandBar>
|
||||
<!-- Button functionality to be implemented by developer -->
|
||||
<AppBarButton Icon="MailReply" Label="Reply" />
|
||||
<AppBarButton Icon="MailReplyAll" Label="Reply All" />
|
||||
<AppBarButton Icon="MailForward" Label="Forward" />
|
||||
|
|
|
@ -10,6 +10,7 @@ using Windows.UI.Xaml;
|
|||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Input;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using NavigationView = Microsoft.UI.Xaml.Controls;
|
||||
|
||||
namespace Microsoft.Toolkit.Uwp.UI.Controls
|
||||
{
|
||||
|
@ -42,12 +43,11 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
|
|||
private AppViewBackButtonVisibility? _previousSystemBackButtonVisibility;
|
||||
private bool _previousNavigationViewBackEnabled;
|
||||
|
||||
// Int used because the underlying type is an enum, but we don't have access to the enum
|
||||
private int _previousNavigationViewBackVisibilty;
|
||||
private NavigationView.NavigationViewBackButtonVisible _previousNavigationViewBackVisibilty;
|
||||
private NavigationView.NavigationView _navigationView;
|
||||
private ContentPresenter _detailsPresenter;
|
||||
private VisualStateGroup _selectionStateGroup;
|
||||
private Button _inlineBackButton;
|
||||
private object _navigationView;
|
||||
private Frame _frame;
|
||||
|
||||
/// <summary>
|
||||
|
@ -199,7 +199,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
|
|||
_frame.Navigating -= OnFrameNavigating;
|
||||
}
|
||||
|
||||
_navigationView = this.FindAscendants().FirstOrDefault(p => p.GetType().FullName == "Microsoft.UI.Xaml.Controls.NavigationView");
|
||||
_navigationView = this.FindAscendant<NavigationView.NavigationView>();
|
||||
_frame = this.FindAscendant<Frame>();
|
||||
if (_frame != null)
|
||||
{
|
||||
|
@ -328,8 +328,6 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
|
|||
/// </summary>
|
||||
private void SetBackButtonVisibility(ListDetailsViewState? previousState = null)
|
||||
{
|
||||
const int backButtonVisible = 1;
|
||||
|
||||
if (DesignMode.DesignModeEnabled)
|
||||
{
|
||||
return;
|
||||
|
@ -358,7 +356,7 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
|
|||
}
|
||||
else
|
||||
{
|
||||
SetNavigationViewBackButtonState(backButtonVisible, true);
|
||||
SetNavigationViewBackButtonState(NavigationView.NavigationViewBackButtonVisible.Visible, true);
|
||||
}
|
||||
}
|
||||
else if (BackButtonBehavior != BackButtonBehavior.Manual)
|
||||
|
@ -441,27 +439,18 @@ namespace Microsoft.Toolkit.Uwp.UI.Controls
|
|||
VisualStateManager.GoToState(this, SelectedItem == null ? noSelectionState : hasSelectionState, animate);
|
||||
}
|
||||
|
||||
private void SetNavigationViewBackButtonState(int visible, bool enabled)
|
||||
private void SetNavigationViewBackButtonState(NavigationView.NavigationViewBackButtonVisible visibility, bool enabled)
|
||||
{
|
||||
if (_navigationView == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var navType = _navigationView.GetType();
|
||||
var visibleProperty = navType.GetProperty("IsBackButtonVisible");
|
||||
if (visibleProperty != null)
|
||||
{
|
||||
_previousNavigationViewBackVisibilty = (int)visibleProperty.GetValue(_navigationView);
|
||||
visibleProperty.SetValue(_navigationView, visible);
|
||||
}
|
||||
_previousNavigationViewBackVisibilty = _navigationView.IsBackButtonVisible;
|
||||
_navigationView.IsBackButtonVisible = visibility;
|
||||
|
||||
var enabledProperty = navType.GetProperty("IsBackEnabled");
|
||||
if (enabledProperty != null)
|
||||
{
|
||||
_previousNavigationViewBackEnabled = (bool)enabledProperty.GetValue(_navigationView);
|
||||
enabledProperty.SetValue(_navigationView, enabled);
|
||||
}
|
||||
_previousNavigationViewBackEnabled = _navigationView.IsBackEnabled;
|
||||
_navigationView.IsBackEnabled = enabled;
|
||||
}
|
||||
|
||||
private void SetDetailsContent()
|
||||
|
|
Загрузка…
Ссылка в новой задаче