Clear() public method

public Clear ( ) : void
return void
Beispiel #1
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++;
            }
        }