void OnUnLoaded(object sender, RoutedEventArgs e) { DeInitInputEventRouting(); if (dragNDropController != null) { dragNDropController.Dispose(); dragNDropController = null; } autoScroller = null; Selection = null; isInitialized = false; }
void OnLoaded(object sender, RoutedEventArgs e) { if (!isInitialized) { autoScroller = new AutoScroller(this); dragNDropController = new DragNDropController(this, autoScroller) { Enabled = IsDragNDropEnabled }; Selection = new SelectionMultiple(this); InitInputEventRouting(); isInitialized = true; } }