示例#1
0
        private static void OnDataSourceChanged(DependencyObject d,
                                                DependencyPropertyChangedEventArgs e)
        {
            var hub = d as Hub;

            if (hub == null)
            {
                return;
            }

            var data = e.NewValue as IList;

            if (data == null)
            {
                return;
            }

            var binder = hub.GetValue(BoundSourceProperty) as HubListMonitor;

            if (binder != null)
            {
                binder.Dispose();
            }

            binder = new HubListMonitor(hub, data);
            hub.SetValue(BoundSourceProperty, binder);

            binder.Apply();
        }
示例#2
0
        private static void OnDataSourceChanged(DependencyObject d,
            DependencyPropertyChangedEventArgs e)
        {
            var hub = d as Hub;
            if (hub == null)
                return;

            var data = e.NewValue as IList;
            if (data == null)
                return;

            var binder = hub.GetValue(BoundSourceProperty) as HubListMonitor;
            if (binder != null)
                binder.Dispose();

            binder = new HubListMonitor(hub, data);
            hub.SetValue(BoundSourceProperty, binder);

            binder.Apply();
        }