Ejemplo n.º 1
0
        private void OnSwimLanesSourceChanged(IEnumerable values)
        {
            DebugHelper.AssertUIThread();

            foreach (DataBar dataBar in this.dataBars)
            {
                this.RemoveDataBar(dataBar);
            }

            this.dataBars.Clear();

            if (values != null)
            {
                foreach (object value in values)
                {
                    DataBar          dataBar = null;
                    FrameworkElement sidebar = null;

                    KStudioSeekableEventStream seekableEventStream = value as KStudioSeekableEventStream;
                    if (seekableEventStream != null)
                    {
                        sidebar = new ContentControl()
                        {
                            Content                 = seekableEventStream,
                            ContentTemplate         = this.SidebarTemplate,
                            ContentTemplateSelector = this.SidebarTemplateSelector,
                        };

                        IEventLaneDataSource eventDataSource = seekableEventStream.UserState as IEventLaneDataSource;
                        if (eventDataSource != null)
                        {
                            EventLane2 eventDataBar = new EventLane2(eventDataSource.MinTime, eventDataSource.MaxTime)
                            {
                                DataContext = seekableEventStream,
                                DataSource  = eventDataSource,
                            };

                            dataBar = eventDataBar;
                        }
                    }

                    if (dataBar == null)
                    {
                        dataBar = new DataBar();
                    }

                    this.dataBars.Add(dataBar);

                    this.AddDataBar(dataBar, sidebar, GridLength.Auto);
                }
            }
        }
Ejemplo n.º 2
0
        private void OnSwimLanesSourceChanged(IEnumerable values)
        {
            DebugHelper.AssertUIThread();

            foreach (DataBar dataBar in this.dataBars)
            {
                this.RemoveDataBar(dataBar);
            }

            this.dataBars.Clear();

            if (values != null)
            {
                foreach (object value in values)
                {
                    DataBar dataBar = null;
                    FrameworkElement sidebar = null;

                    KStudioSeekableEventStream seekableEventStream = value as KStudioSeekableEventStream;
                    if (seekableEventStream != null)
                    {
                        sidebar = new ContentControl()
                            {
                                Content = seekableEventStream,
                                ContentTemplate = this.SidebarTemplate,
                                ContentTemplateSelector = this.SidebarTemplateSelector,
                            };

                        IEventLaneDataSource eventDataSource = seekableEventStream.UserState as IEventLaneDataSource;
                        if (eventDataSource != null)
                        {
                            EventLane2 eventDataBar = new EventLane2(eventDataSource.MinTime, eventDataSource.MaxTime)
                                {
                                    DataContext = seekableEventStream,
                                    DataSource = eventDataSource,
                                };

                            dataBar = eventDataBar;
                        }
                    }

                    if (dataBar == null)
                    {
                        dataBar = new DataBar();
                    }

                    this.dataBars.Add(dataBar);

                    this.AddDataBar(dataBar, sidebar, GridLength.Auto);
                }
            }
        }