-
Notifications
You must be signed in to change notification settings - Fork 76
HamburgerFrameBuilder
Rico Suter edited this page Sep 24, 2015
·
3 revisions
- Package: MyToolkit.Extended (2.4.1+)
- Platform: UWP (Universal Windows Platform)
The HamburgerFrameBuilder is used to an UWP app based on the Hamburger control and the MyToolkit paging classes.
The following code shows how to replace the initial App.xaml.cs
code:
sealed partial class App : MtApplication
{
private HamburgerFrameBuilder _hamburgerFrameBuilder;
public App()
{
InitializeComponent();
}
public override Type StartPageType => typeof(MainPage);
public override UIElement CreateWindowContentElement()
{
_hamburgerFrameBuilder = new HamburgerFrameBuilder();
_hamburgerFrameBuilder.Hamburger.Header = new MyHamburgerHeader();
_hamburgerFrameBuilder.Hamburger.TopItems = new ObservableCollection<HamburgerItem>
{
new PageHamburgerItem
{
Content = "Home",
ContentIcon = new SymbolIcon(Symbol.Home),
Icon = new SymbolIcon(Symbol.Home),
PageType = typeof(MainPage)
},
new SearchHamburgerItem(),
new PageHamburgerItem
{
Content = "Movie",
ContentIcon = new SymbolIcon(Symbol.Video),
Icon = new SymbolIcon(Symbol.Video),
PageType = typeof(MoviePage)
}
};
_hamburgerFrameBuilder.Hamburger.BottomItems = new ObservableCollection<HamburgerItem>
{
new PageHamburgerItem
{
Content = "Settings",
ContentIcon = new SymbolIcon(Symbol.Setting),
Icon = new SymbolIcon(Symbol.Setting),
PageType = typeof(SettingsPage)
}
};
return _hamburgerFrameBuilder.Hamburger;
}
public override MtFrame GetFrame(UIElement windowContentElement)
{
return _hamburgerFrameBuilder.Frame;
}
}
Check out the SampleUwpApp project for a complete sample.