Example #1
0
        public override FrameworkElement CreateWindowContentElement()
        {
            _hamburgerFrameBuilder = new HamburgerFrameBuilder();

            var searchItem = new SearchHamburgerItem
            {
                PlaceholderText = "Search",
            };
            searchItem.QuerySubmitted += async (sender, args) =>
            {
                await _hamburgerFrameBuilder.MoveOrNavigateToPageAsync(typeof (DataGridPage));
                var dataGridPage = (DataGridPage) _hamburgerFrameBuilder.Frame.CurrentPage.Page;
                dataGridPage.Model.Filter = args.QueryText;
            };
            
            _hamburgerFrameBuilder.Hamburger.Header = new HamburgerHeader();
            _hamburgerFrameBuilder.Hamburger.TopItems = new ObservableCollection<HamburgerItem>
            {
                new PageHamburgerItem
                {
                    Content = "Home",
                    ContentIcon = new SymbolIcon(Symbol.Home),
                    Icon = new SymbolIcon(Symbol.Home),
                    PageType = typeof(MainPage)
                },
                searchItem,
                new PageHamburgerItem
                {
                    Content = "Movie",
                    ContentIcon = new SymbolIcon(Symbol.Video),
                    Icon = new SymbolIcon(Symbol.Video),
                    PageType = typeof(MoviePage)
                },
                new PageHamburgerItem
                {
                    Content = "Article",
                    ContentIcon = new SymbolIcon(Symbol.PreviewLink),
                    Icon = new SymbolIcon(Symbol.PreviewLink),
                    PageType = typeof(ArticlePage)
                }, 
                new PageHamburgerItem
                {
                    Content = "DataGrid",
                    ContentIcon = new SymbolIcon(Symbol.ViewAll),
                    Icon = new SymbolIcon(Symbol.ViewAll),
                    PageType = typeof(DataGridPage)
                }
            };
            _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;
        }
Example #2
0
        public override FrameworkElement CreateWindowContentElement()
        {
            _hamburgerFrameBuilder = new HamburgerFrameBuilder();

            //var searchItem = new SearchHamburgerItem
            //{
            //    PlaceholderText = "Search",
            //};
            //searchItem.QuerySubmitted += async (sender, args) =>
            //{
            //    await _hamburgerFrameBuilder.Frame.NavigateToExistingOrNewPageAsync(typeof(DataGridPage));
            //    var dataGridPage = (DataGridPage)_hamburgerFrameBuilder.Frame.CurrentPage.Page;
            //    dataGridPage.Model.Filter = args.QueryText;
            //};

           // _hamburgerFrameBuilder.Hamburger.Header = new HamburgerHeader();
            _hamburgerFrameBuilder.Hamburger.TopItems = new ObservableCollection<HamburgerItem>
            {
                new PageHamburgerItem
                {
                    Content = "Main",
                    ContentIcon = new SymbolIcon(Symbol.Home),
                    Icon = new SymbolIcon(Symbol.Home),
                    PageType = typeof(MainPage)
                },
           //     searchItem,
                new PageHamburgerItem
                {
                    Content = "Pain",
                    ContentIcon = new SymbolIcon(Symbol.Clock),
                    Icon = new SymbolIcon(Symbol.Clock),
                    PageType = typeof(PainPage)
                }
            };
            _hamburgerFrameBuilder.Hamburger.BottomItems = new ObservableCollection<HamburgerItem>
            {
                new PageHamburgerItem
                {
                    Content = "Settings",
                    ContentIcon = new SymbolIcon(Symbol.Setting),
                    Icon = new SymbolIcon(Symbol.Setting),
                    PageType = typeof(SettingsPage)
                }
            };
            _hamburgerFrameBuilder.Frame.PageAnimation = new ScalePageTransition();
            return _hamburgerFrameBuilder.Hamburger;
        }