Change visible to condition for SecondaryItems
This commit is contained in:
@@ -150,10 +150,11 @@
|
|||||||
x:Name="RendererBar"
|
x:Name="RendererBar"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Margin="8,6,0,0"
|
Margin="8,6,0,0"
|
||||||
IsSticky="False"
|
|
||||||
DefaultLabelPosition="Right"
|
DefaultLabelPosition="Right"
|
||||||
HorizontalContentAlignment="Stretch"
|
HorizontalContentAlignment="Stretch"
|
||||||
OverflowButtonVisibility="Auto">
|
OverflowButtonVisibility="Auto"
|
||||||
|
DynamicOverflowItemsChanging="BarDynamicOverflowChanging"
|
||||||
|
IsDynamicOverflowEnabled="True">
|
||||||
<interactivity:Interaction.Behaviors>
|
<interactivity:Interaction.Behaviors>
|
||||||
<local:BindableCommandBarBehavior
|
<local:BindableCommandBarBehavior
|
||||||
ItemClickedCommand="{x:Bind ViewModel.OperationClickedCommand}"
|
ItemClickedCommand="{x:Bind ViewModel.OperationClickedCommand}"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using CommunityToolkit.Mvvm.Messaging;
|
using CommunityToolkit.Mvvm.Messaging;
|
||||||
using Microsoft.AppCenter.Crashes;
|
using Microsoft.AppCenter.Crashes;
|
||||||
@@ -218,7 +219,7 @@ namespace Wino.Views
|
|||||||
|
|
||||||
private void BarDynamicOverflowChanging(CommandBar sender, DynamicOverflowItemsChangingEventArgs args)
|
private void BarDynamicOverflowChanging(CommandBar sender, DynamicOverflowItemsChangingEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.Action == CommandBarDynamicOverflowAction.AddingToOverflow)
|
if (args.Action == CommandBarDynamicOverflowAction.AddingToOverflow || sender.SecondaryCommands.Any())
|
||||||
sender.OverflowButtonVisibility = CommandBarOverflowButtonVisibility.Visible;
|
sender.OverflowButtonVisibility = CommandBarOverflowButtonVisibility.Visible;
|
||||||
else
|
else
|
||||||
sender.OverflowButtonVisibility = CommandBarOverflowButtonVisibility.Collapsed;
|
sender.OverflowButtonVisibility = CommandBarOverflowButtonVisibility.Collapsed;
|
||||||
|
|||||||
Reference in New Issue
Block a user