Exemplo n.º 1
0
        private static void OnLabelPathChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            LabelExtractor v = sender as LabelExtractor;

            if (v != null && v.LabelPath != null && v.Items != null)
            {
                v.GenerateLabelList();
            }
        }
Exemplo n.º 2
0
        private static void OnItemsChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            LabelExtractor v        = sender as LabelExtractor;
            ItemCollection oldItems = args.OldValue as ItemCollection;
            ItemCollection newItems = args.NewValue as ItemCollection;

            if (oldItems != null)
            {
                ((INotifyCollectionChanged)oldItems).CollectionChanged -= v.OnLabelsCollectionChanged;
            }

            if (v != null && v.Items != null)
            {
                ((INotifyCollectionChanged)v.Items).CollectionChanged += v.OnLabelsCollectionChanged;
                if (v.LabelPath != null)
                {
                    v.GenerateLabelList();
                }
            }
        }