mirror of
https://github.com/AtomUI/AtomUI.git
synced 2026-10-28 23:08:36 +08:00
Fixed TabControl overflow menu bug
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.Reactive.Disposables;
|
||||
using AtomUI.Controls.Utils;
|
||||
@@ -63,18 +64,12 @@ public class MenuFlyout : Flyout
|
||||
|
||||
Presenter = new MenuFlyoutPresenter
|
||||
{
|
||||
ItemsSource = Items,
|
||||
MenuFlyout = this
|
||||
};
|
||||
|
||||
// 会二次创建
|
||||
foreach (var item in Items)
|
||||
{
|
||||
if (item is Control control)
|
||||
{
|
||||
control.SetLogicalParent(null);
|
||||
control.SetVisualParent(null);
|
||||
}
|
||||
Presenter.Items.Add(item);
|
||||
}
|
||||
|
||||
_presenterBindingDisposables.Add(BindUtils.RelayBind(this, ItemTemplateProperty, Presenter, MenuFlyoutPresenter.ItemTemplateProperty));
|
||||
|
||||
@@ -11,6 +11,7 @@ using Avalonia.Controls.Platform;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.VisualTree;
|
||||
|
||||
namespace AtomUI.Controls;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user