/// <summary> /// Initializes a new instance of the Chart class. /// </summary> public Chart() { #if SILVERLIGHT DefaultStyleKey = typeof(Chart); #endif // Create the backing collection for Series var series = new UniqueObservableCollection <ISeries>(); series.CollectionChanged += SeriesCollectionChanged; _series = series; // Create the backing collection for Axes var axes = new UniqueObservableCollection <IAxis>(); _axes = axes; ObservableCollection <IAxis> actualAxes = new SeriesHostAxesCollection(this, axes); actualAxes.CollectionChanged += ActualAxesCollectionChanged; InternalActualAxes = actualAxes; ActualAxes = new ReadOnlyCollection <IAxis>(InternalActualAxes); // Create collection for LegendItems LegendItems = new AggregatedObservableCollection <object>(); ChartAreaChildren = new AggregatedObservableCollection <UIElement>(); ChartAreaChildren.ChildCollections.Add(_edgeAxes); ChartAreaChildren.ChildCollections.Add(_backgroundElements); ChartAreaChildren.ChildCollections.Add(Series); ChartAreaChildren.ChildCollections.Add(_foregroundElements); _chartAreaChildrenListAdapter.Collection = ChartAreaChildren; // Create a dispenser ResourceDictionaryDispenser = new ResourceDictionaryDispenser(); ResourceDictionaryDispenser.ResourceDictionariesChanged += delegate { OnResourceDictionariesChanged(EventArgs.Empty); }; }
/// <summary> /// Instantiates a new instance of the SeriesHostAxesCollection class. /// </summary> /// <param name="seriesHost">The series host.</param> /// <param name="persistentAxes">A collection of axes that can never be /// removed from the chart.</param> internal SeriesHostAxesCollection(ISeriesHost seriesHost, UniqueObservableCollection <IAxis> persistentAxes) : this(seriesHost) { Debug.Assert(persistentAxes != null, "Persistent axes collection cannot be null."); this.SeriesHost = seriesHost; this.PersistentAxes = persistentAxes; this.PersistentAxes.CollectionChanged += PersistentAxesCollectionChanged; }
/// <summary> /// Создать <see cref="SecurityTypesComboBox"/>. /// </summary> public SecurityTypesComboBox() { Types.AddRange(Enum.GetValues(typeof(SecurityTypes)).Cast <SecurityTypes>()); ItemsSource = Types; SelectedTypes = new UniqueObservableCollection <SecurityTypes> { SecurityTypes.Stock }; }
/// <summary> /// Constructor. /// </summary> /// <param name="project">Project.</param> /// <param name="package">Package.</param> public PackageViewDocument(Project project, Package package) { if (project == null) { throw new ArgumentNullException("project"); } if (package == null) { throw new ArgumentNullException("package"); } Project = project; Package = package; Text = package.Name; View = new PackageViewControl(); Files = new UniqueObservableCollection <SourceFile>(); foreach (ManifestItemGroup group in Package.Manifest.Groups) { foreach (ManifestItem item in group.Items) { Files.Add(new SourceFile(group.Name, item.Name)); } } View.ItemsSource = Files; CollectionView cView = CollectionViewSource.GetDefaultView(View.ItemsSource) as CollectionView; cView.GroupDescriptions.Add(new PropertyGroupDescription("FileType")); cView.SortDescriptions.Add(new SortDescription("FileType", ListSortDirection.Ascending)); cView.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending)); StringBuilder titleBuilder = new StringBuilder(); titleBuilder.AppendFormat("This package was created on {0}.", package.CreatedDate); if (package.IsDestructive) { titleBuilder.AppendLine(); titleBuilder.Append("It is a destructive package."); } View.ViewTitle = titleBuilder.ToString(); }
/// <summary> /// Constructor. /// </summary> /// <param name="project">Project.</param> /// <param name="manifest">Manifest.</param> public ManifestEditorDocument(Project project, Manifest manifest) { if (project == null) { throw new ArgumentNullException("project"); } if (manifest == null) { throw new ArgumentNullException("manifest"); } Project = project; Manifest = manifest; Text = manifest.Name; _isDirty = false; View = new ManifestEditorControl(); View.ListDragOver += View_DragOver; View.ListDrop += View_Drop; View.RemoveItemsClicked += View_RemoveItemsClicked; Files = new UniqueObservableCollection <SourceFile>(); foreach (ManifestItemGroup group in Manifest.Groups) { foreach (ManifestItem item in group.Items) { Files.Add(new SourceFile(group.Name, item.Name)); } } View.ItemsSource = Files; CollectionView cView = CollectionViewSource.GetDefaultView(View.ItemsSource) as CollectionView; cView.GroupDescriptions.Add(new PropertyGroupDescription("FileType")); cView.SortDescriptions.Add(new SortDescription("FileType", ListSortDirection.Ascending)); cView.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending)); View.Comment = Manifest.Comment; View.CommentChanged += View_CommentChanged; }
/// <summary> /// Initializes a new instance of the Chart class. /// </summary> public Chart() { #if SILVERLIGHT DefaultStyleKey = typeof(Chart); #endif // Create the backing collection for Series UniqueObservableCollection <Series> series = new UniqueObservableCollection <Series>(); series.CollectionChanged += new NotifyCollectionChangedEventHandler(OnSeriesCollectionChanged); _series = series; // Create the backing collection for Axes UniqueObservableCollection <IAxis> axes = new UniqueObservableCollection <IAxis>(); _axes = axes; ObservableCollection <IAxis> actualAxes = new SeriesHostAxesCollection(this, axes); actualAxes.CollectionChanged += ActualAxesCollectionChanged; this.InternalActualAxes = actualAxes; this.ActualAxes = new ReadOnlyCollection <IAxis>(InternalActualAxes); // Create collection for LegendItems NoResetObservableCollection <UIElement> chartLegendItems = new AggregatedObservableCollection <UIElement>(); _legendChildrenLegendAdapter.Collection = chartLegendItems; LegendItems = chartLegendItems; ISeriesHost host = this as ISeriesHost; host.GlobalSeriesIndexesInvalidated += OnGlobalSeriesIndexesInvalidated; ChartAreaChildren = new AggregatedObservableCollection <UIElement>(); ChartAreaChildren.ChildCollections.Add(_edgeAxes); ChartAreaChildren.ChildCollections.Add(_backgroundElements); ChartAreaChildren.ChildCollections.Add(Series); ChartAreaChildren.ChildCollections.Add(_foregroundElements); _chartAreaChildrenListAdapter.Collection = ChartAreaChildren; // Create style dispenser StyleDispenser = new StyleDispenser(); }
/// <summary> /// Initializes a new instance of the Chart class. /// </summary> public Chart() { // Create the backing collection for Series UniqueObservableCollection <ISeries> series = new UniqueObservableCollection <ISeries>(); series.CollectionChanged += new NotifyCollectionChangedEventHandler(SeriesCollectionChanged); _series = series; // Create the backing collection for Axes UniqueObservableCollection <IAxis> axes = new UniqueObservableCollection <IAxis>(); _axes = axes; ObservableCollection <IAxis> actualAxes = new SeriesHostAxesCollection(this, axes); actualAxes.CollectionChanged += ActualAxesCollectionChanged; this.InternalActualAxes = actualAxes; this.ActualAxes = new ReadOnlyCollection <IAxis>(InternalActualAxes); // Create collection for LegendItems LegendItems = new AggregatedObservableCollection <object>(); ChartAreaChildren = new AggregatedObservableCollection <UIElement>(); ChartAreaChildren.ChildCollections.Add(_edgeAxes); ChartAreaChildren.ChildCollections.Add(_backgroundElements); ChartAreaChildren.ChildCollections.Add(Series); ChartAreaChildren.ChildCollections.Add(_foregroundElements); _chartAreaChildrenListAdapter.Collection = ChartAreaChildren; // Create a dispenser ResourceDictionaryDispenser = new ResourceDictionaryDispenser(); ResourceDictionaryDispenser.ResourceDictionariesChanged += delegate { OnResourceDictionariesChanged(EventArgs.Empty); }; }
/// <summary> /// Initializes a new instance of the Chart class. /// </summary> public Chart() { #if SILVERLIGHT DefaultStyleKey = typeof(Chart); #endif // Create the backing collection for Series UniqueObservableCollection<Series> series = new UniqueObservableCollection<Series>(); series.CollectionChanged += new NotifyCollectionChangedEventHandler(OnSeriesCollectionChanged); _series = series; // Create the backing collection for Axes UniqueObservableCollection<IAxis> axes = new UniqueObservableCollection<IAxis>(); _axes = axes; ObservableCollection<IAxis> actualAxes = new SeriesHostAxesCollection(this, axes); actualAxes.CollectionChanged += ActualAxesCollectionChanged; this.InternalActualAxes = actualAxes; this.ActualAxes = new ReadOnlyCollection<IAxis>(InternalActualAxes); // Create collection for LegendItems NoResetObservableCollection<UIElement> chartLegendItems = new AggregatedObservableCollection<UIElement>(); _legendChildrenLegendAdapter.Collection = chartLegendItems; LegendItems = chartLegendItems; ISeriesHost host = this as ISeriesHost; host.GlobalSeriesIndexesInvalidated += OnGlobalSeriesIndexesInvalidated; ChartAreaChildren = new AggregatedObservableCollection<UIElement>(); ChartAreaChildren.ChildCollections.Add(_edgeAxes); ChartAreaChildren.ChildCollections.Add(_backgroundElements); ChartAreaChildren.ChildCollections.Add(Series); ChartAreaChildren.ChildCollections.Add(_foregroundElements); _chartAreaChildrenListAdapter.Collection = ChartAreaChildren; // Create style dispenser StyleDispenser = new StyleDispenser(); }
/// <summary> /// Initializes a new instance of the Chart class. /// </summary> public Chart() { #if SILVERLIGHT DefaultStyleKey = typeof(Chart); #endif // Create the backing collection for Series UniqueObservableCollection<ISeries> series = new UniqueObservableCollection<ISeries>(); series.CollectionChanged += new NotifyCollectionChangedEventHandler(SeriesCollectionChanged); _series = series; // Create the backing collection for Axes UniqueObservableCollection<IAxis> axes = new UniqueObservableCollection<IAxis>(); _axes = axes; ObservableCollection<IAxis> actualAxes = new SeriesHostAxesCollection(this, axes); actualAxes.CollectionChanged += ActualAxesCollectionChanged; this.InternalActualAxes = actualAxes; this.ActualAxes = new ReadOnlyCollection<IAxis>(InternalActualAxes); // Create collection for LegendItems LegendItems = new AggregatedObservableCollection<object>(); ChartAreaChildren = new AggregatedObservableCollection<UIElement>(); ChartAreaChildren.ChildCollections.Add(_edgeAxes); ChartAreaChildren.ChildCollections.Add(_backgroundElements); ChartAreaChildren.ChildCollections.Add(Series); ChartAreaChildren.ChildCollections.Add(_foregroundElements); _chartAreaChildrenListAdapter.Collection = ChartAreaChildren; // Create a dispenser ResourceDictionaryDispenser = new ResourceDictionaryDispenser(); ResourceDictionaryDispenser.ResourceDictionariesChanged += delegate { OnResourceDictionariesChanged(EventArgs.Empty); }; }
protected override void CreateLegends() { plotItems = new UniqueObservableCollection<Plot2DItem>(); plotItems.CollectionChanged += new NotifyCollectionChangedEventHandler(annotations_CollectionChanged); base.CreateLegends(); }
protected void InitialiseChildenCollection() { plotItems = new UniqueObservableCollection<Plot2DItem>(); plotItems.CollectionChanged += new NotifyCollectionChangedEventHandler(plotItems_CollectionChanged); }
/// <summary> /// Instantiates a new instance of the SeriesHostAxesCollection class. /// </summary> /// <param name="seriesHost">The series host.</param> internal SeriesHostAxesCollection(ISeriesHost seriesHost) { this.SeriesHost = seriesHost; this.PersistentAxes = new UniqueObservableCollection <IAxis>(); this.CollectionChanged += ThisCollectionChanged; }