Ejemplo n.º 1
0
        internal static ShellItem CreateFromShellSection(ShellSection shellSection)
        {
            if (shellSection.Parent != null)
            {
                return((ShellItem)shellSection.Parent);
            }

            ShellItem result = null;

            if (shellSection is Tab)
            {
                result = new TabBar();
            }
            else
            {
                result = new ShellItem();
            }

            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));
            result.SetBinding(FlyoutIconProperty, new Binding(nameof(FlyoutIcon), BindingMode.OneWay, source: shellSection));

            return(result);
        }
Ejemplo n.º 2
0
        internal static ShellItem CreateFromShellSection(ShellSection shellSection)
        {
            var result = new ShellItem();

            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);
        }
Ejemplo n.º 3
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);
        }