示例#1
0
        public MultiTrackConnectionAdorner(UIElement adornedElement, MultiTrackListBox multiTrackListBox)
            : base(adornedElement)
        {
            this.multiTrackListBox = multiTrackListBox;
            matches = new ObservableCollection <Match>();
            matches.CollectionChanged         += Matches_CollectionChanged;
            selectedMatches                    = new ObservableCollection <Match>();
            selectedMatches.CollectionChanged += Matches_CollectionChanged;

            ColorGradient gradient = new ColorGradient(0, 1);

            gradient.AddStop(Colors.DarkRed, 0);
            gradient.AddStop(Colors.Red, 0.5f);
            gradient.AddStop(Colors.Yellow, 0.65f);
            gradient.AddStop(Colors.Green, 0.8f);
            gradient.AddStop(Colors.DarkGreen, 1);
            colors = gradient.GetGradient(1024).ToArray();
        }
示例#2
0
 public override void OnApplyTemplate()
 {
     base.OnApplyTemplate();
     multiTrackListBox             = (MultiTrackListBox)GetTemplateChild("PART_TrackListBox");
     multiTrackListBox.ItemsSource = new TrackList <AudioTrack>();
 }