internal StocShowroomContext() : base()
 {
     StocShowRepository = new StocShowRepository();
     ListaStocShow      = new ObservableCollection <StocShowroom>(StocShowRepository.ListaStocShowroom);
     Summary            = ListaStocShow.Count + " entries.";
     ListaStocShow.CollectionChanged += Borderou_CollectionChanged;
 }
        private void Borderou_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        {
            if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
            {
                int newIndex = e.NewStartingIndex;
                StocShowRepository.AddNewRecord(ListaStocShow[newIndex]);
            }
            else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove)
            {
                List <StocShowroom> tempListOfRemovedItems = e.OldItems.OfType <StocShowroom>().ToList();
                // ComenziRepository.DelRecord(tempListOfRemovedItems[0].Factura);
            }

            /*else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Replace)
             * {
             *  List<Movie> tempListOfMovies = e.NewItems.OfType<Movie>().ToList();
             *  MovieRepository.UpdateRecord(tempListOfMovies[0]);      // As the IDs are unique, only one row will be effected hence first index only
             * }
             */
        }