private void BorderBackground_Loaded(object sender, RoutedEventArgs e)
        {
            switch (WindowIndex.currSkin)
            {
            case WindowIndex.skin.Starry:
                BorderBackground.Background = new ImageBrush(WindowIndex.ChangeBitmapToImageSource(Properties.Resources.rentback));
                break;

            case WindowIndex.skin.ColorBox:
                BorderBackground.Background = new ImageBrush(WindowIndex.ChangeBitmapToImageSource(Properties.Resources.Color1));
                break;
            }
        }
        private void stackPanel_Loaded(object sender, RoutedEventArgs e)
        {
            switch (WindowIndex.currSkin)
            {
            case WindowIndex.skin.Starry:
                BorderBack.Background = new ImageBrush(WindowIndex.ChangeBitmapToImageSource(Properties.Resources.listback));
                break;

            case WindowIndex.skin.ColorBox:
                BorderBack.Background = new ImageBrush(WindowIndex.ChangeBitmapToImageSource(Properties.Resources.Color1));
                break;
            }

            foreach (Building building in Building.AllBuildings)
            {
                TextBlock tbTitle = new TextBlock();
                tbTitle.Padding      = new Thickness(24, 16, 26, 10);
                tbTitle.TextWrapping = TextWrapping.Wrap;
                tbTitle.Text         = building.Name;
                tbTitle.FontSize     = 24;
                //   tbTitle.Background = new SolidColorBrush(MyColor.NameColor(building.Name, 0.05));

                WrapPanel subPanel = new WrapPanel();
                subPanel.Orientation = Orientation.Horizontal;
                subPanel.Margin      = new Thickness(24, 0, 24, 0);

                foreach (Classroom classroom in building.Classrooms)
                {
                    TextBlock tb = new TextBlock();
                    tb.Height       = 125;
                    tb.Width        = 125;
                    tb.FontSize     = 16;
                    tb.Margin       = new Thickness(5);
                    tb.TextWrapping = TextWrapping.Wrap;

                    Rent rent = rentTable.GetClassroom(classroom.cId);
                    if (rent == null)
                    {
                        tb.Height     = 60;
                        tb.Width      = 60;
                        tb.FontSize   = 12;
                        tb.Text       = classroom.Name;
                        tb.Background = MyColor.NameBrush(tb.Text, 0.05); //new SolidColorBrush(MyColor.NameColor(tb.Text, 0.05));
                    }
                    else
                    {
                        tb.Text       = classroom.Name + ":" + rent.Info;
                        tb.Background = MyColor.NameBrush(tb.Text); //new SolidColorBrush(MyColor.NameColor(tb.Text));
                    }

                    tb.Tag         = classroom;
                    tb.MouseDown  += tb_MouseDown;
                    tb.MouseEnter += tb_MouseEnter;
                    tb.MouseLeave += tb_MouseLeave;

                    subPanel.Children.Add(tb);
                }

                stackPanel.Children.Add(tbTitle);
                stackPanel.Children.Add(subPanel);
            }
        }