protected async override void OnInitialize()
 {
     if (null == PathTree)
     {
         await LoadContentsAsync();
     }
     else
     {
         var lastBreadcrumb = Breadcrumbs.LastOrDefault();
         SelectPath(lastBreadcrumb, insertInBackStack: false);
     }
 }
예제 #2
0
 /// <summary>
 /// Создает экземпляр и инициализирует поля класса.
 /// </summary>
 public SectionPage
 (
     SeoData seo,
     Navigation navigation,
     List <Breadcrumb> breadcrumbs,
     List <Product> products,
     int productsCount,
     CatalogFilters filters,
     Pagination pagination
 ) : base(seo, navigation, breadcrumbs)
 {
     SectionTitle  = Breadcrumbs.LastOrDefault()?.Title;
     Products      = products.Select(p => new ProductCard(p)).ToList();
     ProductsCount = productsCount;
     Filters       = filters;
     Pagination    = pagination;
 }
예제 #3
0
        private void BreadcrumbsOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            MainContainer.Clear();
            _ellipsis.Clear();
            if (Count > 3)
            {
                _ellipsis.Visibility = Visibility.Visible;

                for (var i = Count - 3; i < Count; i++)
                {
                    MainContainer.Add(Breadcrumbs[i]);
                }

                for (var i = 0; i < Count - 3; i++)
                {
                    EllipsisContainer.Add(Breadcrumbs[i]);
                }
            }
            else
            {
                _ellipsis.Visibility = Visibility.Collapsed;
                foreach (var breadcrumbItem in Breadcrumbs)
                {
                    MainContainer.Add(breadcrumbItem);
                }
            }

            var last = Breadcrumbs.LastOrDefault();

            if (last != null)
            {
                last.BreadcrumbData.HasVisibleProperties = App.UserStyle == UserStyle.Author;
            }

            // Mark the first breadcrumb
            var index = 0;

            foreach (var breadcrumbControl in Breadcrumbs)
            {
                breadcrumbControl.BreadcrumbData.IsFirst = index == 0;
                index++;
            }
        }