private void TextArticle_TextChanged(object sender, TextChangedEventArgs e)
 {
     NewsRepository nr = new NewsRepository();
     var query = (from a in nr.ListaArtykulow
                  where a.Tytul.ToLower().Contains(TextArticle.Text.ToLower())
                  select new { a.Tytul, a.Kanal.Nazwa, a.PublicationDate });
     ArticleGrid.ItemsSource = query;
 }
        private void TextChannel_TextChanged(object sender, TextChangedEventArgs e)
        {
            NewsRepository nr = new NewsRepository();
            var query = (from channel in nr.ListaKanalow
                         where channel.Nazwa.ToLower().Contains(TextChannel.Text.ToLower())
                         select new { channel.Nazwa, channel.Opis, channel.Url });

            GridChannel.ItemsSource = query;
        }
 public static void DisplayTitle(ComboBox comboBox)
 {
     NewsRepository nr = new NewsRepository();
     foreach (var item in nr.ListaKanalow)
     {
         comboBox.Items.Add(item.Nazwa);
     }
     comboBox.Text = comboBox.Items[0].ToString();
 }
        public DataGridArticle()
        {
            InitializeComponent();
                NewsRepository nr = new NewsRepository();

                var query = (from a in nr.ListaArtykulow
                             select new {a.Tytul, a.Kanal.Nazwa, a.PublicationDate});

                ArticleGrid.ItemsSource = query;
        }
        public DataGridChannel()
        {
            InitializeComponent();

            NewsRepository nr = new NewsRepository();

            var query = (from channel in nr.ListaKanalow
                         select new { channel.Nazwa, channel.Opis, channel.Url});

            GridChannel.ItemsSource = query;
        }
 public MainWindow()
 {
     isFirstRun = true; // przy pierwszym uruchomieniu, ComboBox odwołoje się sam do siebie w zdarzeniu SelectionChanged, zanim się zainiciuje (zapobiega NullReferenceExeption)
     InitializeComponent();
     DataBaseCreator.CreateDatabase();
     iterator = 0;
     currentData = new NewsRepository();
     Displayer.DisplayTitle(ComboChannel);
     currentArticles = currentData.ListaArtykulowPerKanal(ComboChannel.Text);
     cutContent();
     Displayer.DisplayArticle(currentArticles[iterator], ArticleBox);
     ChangePublicationDate();
 }