using System.Collections.Generic;
using System.Windows;

namespace ComboBox_MissingValuesOnScroll
{
	/// <summary>
	/// Interaction logic for MainWindow.xaml
	/// </summary>
	public partial class MainWindow : Window
	{
		private List<ExpositionType> _expositionTypes;
		private static List<Exposition> _expositions;

		public MainWindow()
        {
            InitializeComponent();
            //
            InitObjects();
			this.Resources.Add("DynamicExpositionTypes", this._expositionTypes);
			this.ExpositionRules.ItemsSource = _expositions;
        }
         
        private void InitObjects()
        {
			this._expositionTypes = new List<ExpositionType>();
			//
			this._expositionTypes.Add(new ExpositionType("Number1") { Numerator = 1 });
			this._expositionTypes.Add(new ExpositionType("Number2") { Numerator = 2 });
			this._expositionTypes.Add(new ExpositionType("Number3") { Numerator = 3 });
			this._expositionTypes.Add(new ExpositionType("Number4") { Numerator = 4 });
			this._expositionTypes.Add(new ExpositionType("Number5") { Numerator = 5 });
            
            _expositions = new List<Exposition>();
            //
            for (int i = 0; i < 20; i++)
            {
                _expositions.Add(new Exposition() { Netto = i * 10 });
            }
        }
    }
}
	
