示例#1
0
        private void fillArtist()
        {
            foreach (Grid g in grid.Children)
            {
                grid.Children.Remove(g);
            }

            if (Misc.artists.Count == 0)
            {
                Misc.loadArtist();
            }

            foreach (Artist art in Misc.artists)
            {
                Grid rectangle = new Grid();
                rectangle.Background = new SolidColorBrush(Color.FromRgb(179, 225, 247));
                rectangle.Margin     = new Thickness(0, 0, 0, 0);
                rectangle.Height     = (double)(art.Length.TotalMinutes / 5);

                TextBlock tb = new TextBlock();
                tb.Margin = new Thickness(10, 10, 0, 0);
                tb.Text   = art.Name;

                rectangle.Children.Add(tb);
                grid.Children.Add(rectangle);
            }
        }
示例#2
0
        public Timeline()
        {
            if (Misc.artists.Count == 0)
            {
                Misc.loadArtist();
            }

            InitializeComponent();
            actualTime = new Rectangle();

            timer       = new DispatcherTimer();
            timer.Tick += timer_Tick;
            timer.Start();
            timer.Interval = new TimeSpan(0, 5, 0);

            fillTime();
            fillArtist();

            actualLine();
            actualTime.Fill = new SolidColorBrush(Color.FromRgb(0, 0, 255));
            grid.Children.Add(actualTime);
        }
示例#3
0
 public ShowArtist()
 {
     Misc.loadArtist();
     InitializeComponent();
 }