Beispiel #1
0
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            BarModel barModel = item as BarModel;

            if (barModel != null)
            {
                return(barModel.IsMainMenu ? MainMenuTemplate : ToolbarTemplate);
            }
            return(base.SelectTemplate(item, container));
        }
        protected override List <BarModel> CreateBars()
        {
            List <BarModel> bars     = base.CreateBars();
            BarModel        model    = new BarModel("Standard");
            var             commands = CreateToolbarCommands();

            foreach (var cmd in commands)
            {
                model.Commands.Add(cmd);
            }
            bars.Add(model);
            return(bars);
        }
        protected virtual List <BarModel> CreateBars()
        {
            BarModel model = new BarModel("Main")
            {
                IsMainMenu = true
            };
            var commands = CreateCommands();

            foreach (var cmd in commands)
            {
                model.Commands.Add(cmd);
            }
            return(new List <BarModel>()
            {
                model
            });
        }