Quantcast
Channel: Ribbon for WPF - Recent Posts
Viewing all articles
Browse latest Browse all 1458

CanExecut not called for collapsed Ribbon elements

$
0
0

Hello.

I'm use next command callback

 private void OnNextCanExecuted(object sender, CanExecuteRoutedEventArgs e)
{
     var bt = e.Parameter as UIElement;
     if (bt != null)
     {
          bt.Visibility = (Surfaces?.Count ?? 0) > 1 ? Visibility.Visible : Visibility.Collapsed;
     }

     e.CanExecute = (Surfaces?.Count ?? 1) - 1 > CurrentSurface;
}
<ribbon:Button Command="d3e:SurfaceCommands.Next" CommandParameter="{Binding RelativeSource={RelativeSource Self}}"/>

 When visibility collapsed -  OnNextCanExecuted never call

For simple WPF Button all work good.

How can I resolve it.


Viewing all articles
Browse latest Browse all 1458

Trending Articles