Beispiel #1
0
        internal static ShellItem GetShellItemFromRouteName(string route)
        {
            var shellContent = new ShellContent {
                Route = route, Content = Routing.GetOrCreateContent(route)
            };
            var result       = new ShellItem();
            var shellSection = new ShellSection();

            shellSection.Items.Add(shellContent);
            result.Route = Routing.GenerateImplicitRoute(shellSection.Route);
            result.Items.Add(shellSection);
            result.SetBinding(TitleProperty, new Binding(nameof(Title), BindingMode.OneWay, source: shellSection));
            result.SetBinding(IconProperty, new Binding(nameof(Icon), BindingMode.OneWay, source: shellSection));
            result.SetBinding(FlyoutDisplayOptionsProperty, new Binding(nameof(FlyoutDisplayOptions), BindingMode.OneTime, source: shellSection));
            return(result);
        }