示例#1
0
 private void OnSelectedItemChanged(BreadcrumbButton button, object e)
 {
     if (button.IsInitialized)
     {
         RoutedEventArgs args = new RoutedEventArgs(SelectedItemChangedEvent);
         button.RaiseEvent(args);
     }
 }
示例#2
0
        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();
        }
示例#3
0
 private void OnImageChanged(BreadcrumbButton o, AvaloniaPropertyChangedEventArgs e)
 {
     HasImage = e.NewValue is IBitmap;
 }
示例#4
0
 private void OnItemsCollectionChanged(BreadcrumbButton o, AvaloniaPropertyChangedEventArgs e)
 {
     HasItems = Items == null ? false : Items.OfType <object>().Count() > 0;
 }