private void NavItemClick(object sender, RoutedEventArgs e)
        {
            InfoIndexItem item = sender as InfoIndexItem;

            this.OnSelectedIndexChanged(this, new SelectedIndexChangedArgs {
                PreviousIndex = this.ActiveItemList.SelectedIndex, NewIndex = item.Id
            });
            this.HighlightSelectedItems(this.ActiveItemList.SelectedIndex, item.Id);
        }
 private void SetupNavItems(int count)
 {
     for (int i = 0; i < count; i++)
     {
         InfoIndexItem item = new InfoIndexItem
         {
             Id = i
         };
         item.Click = (RoutedEventHandler)Delegate.Combine(item.Click, new RoutedEventHandler(NavItemClick));
         this.ActiveItemList.Items.Add(item);
     }
     VisualStateManager.GoToState(this, "Reveal", false);
 }
Exemple #3
0
        private void initIndexImage(Info info, int index)
        {
            InfoIndexItem item = new InfoIndexItem();

            if (info.ImageSource != null)
            {
                Image s = new Image();
                s.Margin               = new Thickness(2.0, 1.0, 2.0, 1.0);
                s.Height               = 45.0;
                s.Width                = 57.0;
                s.Stretch              = Stretch.Fill;
                s.Source               = info.ImageSource;
                s.Tag                  = index;
                s.MouseLeftButtonDown += (objects, arts) =>
                {
                    Image source = objects as Image;
                    int   Index  = (int)source.Tag;
                    Content.DataContext = InfoList[Index];
                    _currentIndex       = Index;
                };
                s.MouseEnter += new MouseEventHandler(Content_MouseEnter);
                s.MouseLeave += new MouseEventHandler(Content_MouseLeave);
            }
        }
Exemple #4
0
 private void SetupNavItems(int count)
 {
     for (int i = 0; i < count; i++)
     {
         InfoIndexItem item = new InfoIndexItem
         {
             Id = i
         };
         item.Click = (RoutedEventHandler)Delegate.Combine(item.Click, new RoutedEventHandler(NavItemClick));
         this.ActiveItemList.Items.Add(item);
     }
     VisualStateManager.GoToState(this, "Reveal", false);
 }
Exemple #5
0
 private void initIndexImage(Info info, int index)
 {
     InfoIndexItem item = new InfoIndexItem();
     if (info.ImageSource != null)
     {
         Image s = new Image();
         s.Margin = new Thickness(2.0, 1.0, 2.0, 1.0);
         s.Height = 45.0;
         s.Width = 57.0;
         s.Stretch = Stretch.Fill;
         s.Source = info.ImageSource;
         s.Tag = index;
         s.MouseLeftButtonDown += (objects, arts) =>
         {
             Image source = objects as Image;
             int Index = (int)source.Tag;
             Content.DataContext = InfoList[Index];
             _currentIndex = Index;
         };
         s.MouseEnter += new MouseEventHandler(Content_MouseEnter);
         s.MouseLeave += new MouseEventHandler(Content_MouseLeave);
     }
 }