mirror of
https://github.com/jwetzell/qController.git
synced 2026-08-22 07:29:13 +00:00
* RootPageDetail.xaml:
* RootPageMaster.xaml: * RootPageDetail.xaml.cs: * RootPageMaster.xaml.cs: * RootPageMenuItem.cs: Remove Unused Items * RootPage.xaml: * RootPage.xaml.cs: Convert to Flyout and MasterDetail deprecated * packages.config: * packages.config: * qController.iOS.csproj: * qController.Droid.csproj: * Resource.designer.cs: * qController.csproj: Update Dependencies * QNavBar.cs: Conver QNavBar to Frame Based * App.xaml.cs: Reorganize intialization and convert to Flyout * QBrowserPage.xaml: Convert to StackLayout
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace qController
|
||||
{
|
||||
public class MenuEventArgs : EventArgs
|
||||
{
|
||||
public string Command
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
|
||||
public partial class RootPage : FlyoutPage
|
||||
{
|
||||
public MenuPage MenuPage;
|
||||
public delegate void MenuItemSelectedHandler(object source, MenuEventArgs args);
|
||||
public event MenuItemSelectedHandler MenuItemSelected;
|
||||
|
||||
public RootPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
Flyout = new MenuPage();
|
||||
}
|
||||
|
||||
public void Init()
|
||||
{
|
||||
MenuPage = (MenuPage)Flyout;
|
||||
|
||||
MenuPage.setItemSelected(OnItemSelected);
|
||||
}
|
||||
|
||||
void OnItemSelected(object sender, SelectedItemChangedEventArgs e)
|
||||
{
|
||||
var item = e.SelectedItem as MenuPageItem;
|
||||
if (item != null)
|
||||
{
|
||||
MenuPage.clearSelectedItem();
|
||||
IsPresented = false;
|
||||
if (MenuItemSelected != null)
|
||||
MenuItemSelected(this, new MenuEventArgs { Command = item.Command });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user