コード例 #1
0
 public void UpdateView()
 {
     SetNewsPriview();
     NewsList.ItemsSource = null;
     NewsList.ItemsSource = View;
     if (News.Count() == 0)
     {
         NoNews.Visibility = Visibility.Visible;
     }
     else
     {
         NoNews.Visibility = Visibility.Hidden;
     }
 }
コード例 #2
0
 private void SetNewsPriview()
 {
     NewsPreview.Items.Clear();
     NewsPreview.Items.Add(new TextBlock(new Run("Fast switching between news")));
     for (int i = 0; i < News.Count(); i++)
     {
         Button temp = new Button()
         {
             Content             = News.ElementAt(i).title,
             ClickMode           = ClickMode.Release,
             Name                = "button" + i.ToString(),
             HorizontalAlignment = HorizontalAlignment.Stretch,
             MinWidth            = 1200
         };
         temp.Click += Preview_Click;
         NewsPreview.Items.Add(temp);
     }
     NewsPreview.SelectedIndex = 0;
 }