Exemplo n.º 1
0
        private void UnsubscribeFromItemsUpdating(GraphItemCollection collection)
        {
            if (collection == null)
            {
                return;
            }

            collection.CollectionChanged -= GraphItemsCollectionChanged;
            foreach (var item in collection)
            {
                item.Updated -= ItemUpdated;
            }
        }
Exemplo n.º 2
0
        private void SubscribeToItemsUpdating(GraphItemCollection collection)
        {
            if (collection == null)
            {
                return;
            }

            collection.CollectionChanged += GraphItemsCollectionChanged;
            foreach (var item in collection)
            {
                PrepareItem(item);
            }
        }
Exemplo n.º 3
0
        public GraphControlBase()
        {
            Items = new UIElementCollection(this, this);

            mInternalItems = new GraphControlItems();
            AddLogicalChild(mInternalItems);
            AddVisualChild(mInternalItems);

            GraphItems = new GraphItemCollection();
            SubscribeToItemsUpdating(GraphItems);
            mInternalItems.ItemsSource = GraphItems;

            DataContextChanged += (s, e) =>
            { mInternalItems.DataContext = e.NewValue; };
        }