private void OnSelectedItemChanged(BreadcrumbButton button, object e) { if (button.IsInitialized) { RoutedEventArgs args = new RoutedEventArgs(SelectedItemChangedEvent); button.RaiseEvent(args); } }
private void OverflowPressedChanged(BreadcrumbButton o, AvaloniaPropertyChangedEventArgs e) { //todo check if (contextMenu != null) { if (contextMenu.Items.OfType <object>().Count() == 0) { IsDropDownPressed = false; return; //contextMenu.Items = new AvaloniaList<object>(); } bool val = (bool)e.NewValue; //if (contextMenu.IsOpen) //{ // contextMenu.Close(); //} if (val) { if (contextMenu.ItemCount > 0) { try { //contextMenu.Focus(); contextMenu.Open(dropDownBtn); } catch { } } } else { contextMenu.Close(); } } o.OnOverflowPressedChanged(); }
private void OnImageChanged(BreadcrumbButton o, AvaloniaPropertyChangedEventArgs e) { HasImage = e.NewValue is IBitmap; }
private void OnItemsCollectionChanged(BreadcrumbButton o, AvaloniaPropertyChangedEventArgs e) { HasItems = Items == null ? false : Items.OfType <object>().Count() > 0; }