Example #1
0
        private void AddJob(BuildJobViewModel job)
        {
            BuildJobView view;

            if (_jobViewPool.Count == 0)
            {
                view = new BuildJobView();
                this.Canvas.Children.Add(view);
            }
            else
            {
                view            = _jobViewPool.Dequeue();
                view.Visibility = Visibility.Visible;
            }

            view.DataContext       = job;
            _activeJobViewMap[job] = view;
        }
Example #2
0
 private void RecycleView(BuildJobView view)
 {
     view.Visibility  = Visibility.Hidden;
     view.DataContext = null;
     _jobViewPool.Enqueue(view);
 }