-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Menu Bar * - wire up all the handlers and classes * - remove extra type * - rework menu elements * - fixup WinUI MenuBar placement * - add interfaces * - Cleanup interfaces * - remove text style APIs * - wire up icon * - fix interface * - stream line inheritance a bit more * - fix * - fixup some builder * - fixup menu selector calls * - fixed sub menu items * - demo code * - fix rebase * - centralize menu code * - start the fun * - move menubaritems to page * - MenuBar Page * - add additional clicks * - fixup types * - Catalyst images/clicks * - wire images * - Add Tests * - remove DesktopSupportTestPage * - add check for selector when adding menu items
- Loading branch information
Showing
80 changed files
with
3,100 additions
and
904 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
257 changes: 0 additions & 257 deletions
257
src/Compatibility/ControlGallery/src/Issues.Shared/DesktopSupportTestPage.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
src/Controls/samples/Controls.Sample/Pages/Core/MenuBarPage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Microsoft.Maui.Controls; | ||
using Microsoft.Maui.Graphics; | ||
|
||
namespace Maui.Controls.Sample.Pages | ||
{ | ||
public partial class MenuBarPage | ||
{ | ||
public MenuBarPage() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
void ItemClicked(object sender, EventArgs e) | ||
{ | ||
if (sender is MenuFlyoutItem mfi) | ||
{ | ||
menuLabel.Text = $"You clicked on Menu Item: { mfi.Text}"; | ||
} | ||
} | ||
|
||
void ToggleMenuBarItem(object sender, EventArgs e) | ||
{ | ||
MenuBarItem barItem = | ||
MenuBarItems.FirstOrDefault(x => x.Text == "Added Menu"); | ||
|
||
if(barItem == null) | ||
{ | ||
barItem = new MenuBarItem() | ||
{ | ||
Text = "Added Menu" | ||
}; | ||
|
||
barItem.Add(new MenuFlyoutItem() | ||
{ | ||
Text = "Added Flyout Item", | ||
Command = new Command(() => ItemClicked(barItem.First(), EventArgs.Empty)) | ||
}); | ||
|
||
MenuBarItems.Add(barItem); | ||
} | ||
else | ||
{ | ||
MenuBarItems.Remove(barItem); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.