public Program(ProgramJSON js, int Day)
 {
     day      = Day;
     id       = count[day]++;
     name     = js.name;
     start    = js.start;
     length   = js.length;
     category = js.category;
     speakers = js.speakers;
     location = js.location;
 }
        public Events()
        {
            InitializeComponent();

            //swFav.Background = new SolidColorBrush(Colors.LightGray);
            //swFav.Opacity = 0.5;

            txtSearch.Background         = new SolidColorBrush(Colors.White);
            txtSearch.Foreground         = new SolidColorBrush(Colors.LightGray);
            txtSearch.Background.Opacity = 0.25;
            txtSearch.Foreground.Opacity = 0.5;

            for (int i = 0; i < Progs.Length; i++)
            {
                Progs[i] = new List <Program>();
                Descs[i] = new List <String>();
            }
            Program.count = new int[Progs.Length];

            List <ProgramJSON> progs = JsonConvert.DeserializeObject <List <ProgramJSON> >(File.ReadAllText(@"..\..\otafest.json"));

            for (int i = 0; i < progs.Count; i++)
            {
                ProgramJSON p = progs[i];
                Progs[p.day].Add(new Program(p, p.day));
                Descs[p.day].Add(p.desc);
            }

            //AddHandler(Mouse.PreviewMouseDownOutsideCapturedElementEvent, new MouseButtonEventHandler(HandleClickOutsideOfControl));
            AddHandler(Mouse.PreviewMouseDownEvent, new MouseButtonEventHandler(HandleMouseDown));
            Schedule.ColumnDefinitions.Add(new ColumnDefinition());
            //string description = Enumerations.GetEnumDescription((MyEnum)value);

            grdFilters.ColumnDefinitions.Add(new ColumnDefinition());
            //FieldInfo[] fields = typeof(Categories).GetFields();
            //filterCat = new bool[fields.Length];
            filterCat = new bool[Categories.Length];
            for (int i = 0; i < Categories.Length; i++)
            {
                grdFilters.RowDefinitions.Add(new RowDefinition()
                {
                    Height = new GridLength(25.0)
                });
                CheckBox chck = new CheckBox()
                {
                    Content = Categories[i].name, IsChecked = true
                };
                chck.Click += chckCategory_Clicked;
                Grid.SetColumn(chck, 0);
                Grid.SetRow(chck, i);
                grdFilters.Children.Add(chck);
                chckFilters[i]     = chck;
                chckFilters[i].Tag = i;
                filterCat[i]       = true;
            }

            chckAll.IsChecked = true;
            for (int i = 0; i < date.Length; i++)
            {
                CreateDay(date[i], Progs[i]);
            }
            //Schedule.ShowGridLines = true;
            //CreateDay("Friday September 21, 2018", FriProg);
            //CreateDay("Saturday September 22, 2018", SatProg);
            //CreateDay("Sunday September 23, 2018", SunProg);
        }