예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Plotter"/> class.
        /// </summary>
        protected Plotter(PlotterLoadMode loadMode)
        {
            current = this;

            this.loadMode = loadMode;

            SetPlotter(this, this);

            if (loadMode == PlotterLoadMode.Normal)
            {
                UpdateUIParts();
            }

            children = new PlotterChildrenCollection(this);
            children.CollectionChanged += OnChildrenCollectionChanged;
            Loaded   += Plotter_Loaded;
            Unloaded += Plotter_Unloaded;

            genericResources = (ResourceDictionary)Application.LoadComponent(new Uri("/DynamicDataDisplay;component/Themes/Generic.xaml", UriKind.Relative));

            ContextMenu = null;

            foreach (var panel in GetAllPanels().Where(panel => panel != null))
            {
                Plotter.SetIsDefaultPanel(panel, true);
            }
        }
        public static void RemoveAll <T>(this PlotterChildrenCollection children)
        {
            var childrenToDelete = children.OfType <T>().ToList();

            foreach (var child in childrenToDelete)
            {
                children.Remove(child as IPlotterElement);
            }
        }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Plotter"/> class.
        /// </summary>
        protected Plotter(PlotterLoadMode loadMode)
        {
            this.loadMode = loadMode;

            SetPlotter(this, this);

            if (loadMode == PlotterLoadMode.Normal)
            {
                UpdateUIParts();
            }

            children = new PlotterChildrenCollection(this);
            children.CollectionChanged += OnChildrenCollectionChanged;
            Loaded   += Plotter_Loaded;
            Unloaded += Plotter_Unloaded;

            genericResources = (ResourceDictionary)Application.LoadComponent(new Uri("/DynamicDataDisplay;component/Themes/Generic.xaml", UriKind.Relative));

            ContextMenu = null;
        }
 public static void BeginRemove(this PlotterChildrenCollection children, IPlotterElement child)
 {
     children.Plotter.Dispatcher.BeginInvoke(((Action)(() => { children.Remove(child); })), DispatcherPriority.Send);
 }