Browse Source
* Native DockMenu code * Add Native Interop * Update ControlCatalog sample * Add unit tests * Add Action<IAvnMenu> to AvaloniaNativeMenuExporter * Add dynamic dock item demo * Move s_dockMenu reference to App * Use Appium tests * Revert INativeMenuExporterResetHandler * Properly set the button for the checkbox * Add dock test * I hate Appium * Rename NativeMenu.DockMenu to NativeDock.Menu * Make static * Remove Dock Click Test * Add white space back for cleaner diff * Reduce MenuExporter back to one * Revert UpdateIfNeeded to private * Revert QueueReset to private too... and fix some whitespace * Revert IAvnMenuItem/IAvnMenu back * That's what I get not comparing it to master * And update this too * Add documentationpull/20719/head
committed by
GitHub
15 changed files with 304 additions and 30 deletions
@ -0,0 +1,28 @@ |
|||||
|
namespace Avalonia.Controls |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Allows native menu support on platforms where a <see cref="NativeMenu"/> can be attached to the dock.
|
||||
|
/// </summary>
|
||||
|
public static class NativeDock |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Defines the Menu attached property.
|
||||
|
/// </summary>
|
||||
|
public static readonly AttachedProperty<NativeMenu?> MenuProperty = |
||||
|
AvaloniaProperty.RegisterAttached<AvaloniaObject, NativeMenu?>("Menu", typeof(NativeDock)); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Sets the value of the attached <see cref="MenuProperty"/>.
|
||||
|
/// </summary>
|
||||
|
/// <param name="o">The control to set the menu for.</param>
|
||||
|
/// <param name="menu">The menu to set.</param>
|
||||
|
public static void SetMenu(AvaloniaObject o, NativeMenu? menu) => o.SetValue(MenuProperty, menu); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Gets the value of the attached <see cref="MenuProperty"/>.
|
||||
|
/// </summary>
|
||||
|
/// <param name="o">The control to get the menu for.</param>
|
||||
|
/// <returns>The menu of the control.</returns>
|
||||
|
public static NativeMenu? GetMenu(AvaloniaObject o) => o.GetValue(MenuProperty); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue