Example #1
0
        private void UpdateSeasonsSource()
        {
            SeasonsListView.ItemsSource = null;
            //SeasonsListView.ItemsSource = seasons;

            Binding myBinding = new Binding()
            {
                Source = seasons
            };

            SeasonsListView.SetBinding(ListView.ItemsSourceProperty, myBinding);
            seasonsBindingExpression = SeasonsListView.GetBindingExpression(ListView.ItemsSourceProperty);

            seasonsBindingExpression.UpdateTarget();
        }
Example #2
0
        //private void FindDuplicates()
        //{

        //}

        private void FillExistingSeasons()
        {
            //using (EntityContextGeneral ctxg = new EntityContextGeneral())
            using (FormMergedEntities ctxg = new FormMergedEntities())
            {
                seasons = ctxg.Recruit
                          .AsEnumerable()
                          //.ToList()
                          .Distinct(seasonComparer)
                          //.Select(p => new Season(p))
                          .Select(p => new SeasonMSSQL(p))
                          .OrderByDescending(p => p.DateTime)
                          .ToList();

                Binding myBinding = new Binding()
                {
                    Source = seasons
                };

                SeasonsListView.SetBinding(ListView.ItemsSourceProperty, myBinding);
                seasonsBindingExpression = SeasonsListView.GetBindingExpression(ListView.ItemsSourceProperty);
            }
        }