Пример #1
0
 private void CreateBullets(int count)
 {
     if (_panel == null)
     {
         return;
     }
     foreach (var child in _panel.Children)
     {
         var bullet = child as FrameworkElement;
         bullet.RemoveHandler(FrameworkElement.MouseLeftButtonUpEvent, new MouseButtonEventHandler(this.OnBulletMouseLeftButtonUp));
     }
     _panel.Children.Clear();
     if (count < 0)
     {
         return;
     }
     for (int i = 0; i < count; i++)
     {
         var bullet = new BreadcrumbBullet();
         bullet.AddHandler(FrameworkElement.MouseLeftButtonUpEvent, new MouseButtonEventHandler(this.OnBulletMouseLeftButtonUp));
         _panel.Children.Add(bullet);
     }
     if (count > 0)
     {
         ((BreadcrumbBullet)_panel.Children[0]).IsActive = true;
         this.SelectedIndex = 0;
     }
     this.OnBulletCountChanged();
 }
 private void CreateBullets(int count)
 {
     if (_panel == null) return;
     foreach (var child in _panel.Children)
     {
         var bullet = child as FrameworkElement;
         bullet.RemoveHandler(FrameworkElement.TappedEvent, new RoutedEventHandler(this.OnBulletMouseLeftButtonUp));
     }
     _panel.Children.Clear();
     if (count < 0) return;
     for (int i = 0; i < count; i++)
     {
         var bullet = new BreadcrumbBullet();
         bullet.AddHandler(FrameworkElement.TappedEvent, new RoutedEventHandler(this.OnBulletMouseLeftButtonUp), false);
         _panel.Children.Add(bullet);
     }
     if (count > 0)
     {
         ((BreadcrumbBullet)_panel.Children[0]).IsActive = true;
         this.SelectedIndex = 0;
     }
     this.OnBulletCountChanged();
 }