private void InitScatterViewHost(ScatterView mainScatterView) { this.ScatterHost.Width = mainScatterView.ActualWidth; this.ScatterHost.Height = mainScatterView.ActualHeight; this.ScatterHost.Background = mainScatterView.Background; //@@@this.ScatterHost.ItemTemplateSelector = this.ItemTemplateSelector; }
/// <summary> /// Handles changes to the ScatterArea property. /// </summary> /// <param name="d">Source dependendency o bject</param> /// <param name="e">Event argument</param> private static void OnScatterAreaChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { MiniMap target = (MiniMap)d; ScatterView oldValue = (ScatterView)e.OldValue; ScatterView newValue = target.ScatterArea; target.OnScatterAreaChanged(oldValue, newValue); }
private void UpdateScatterViewInfo(object sender, SizeChangedEventArgs e) { ScatterView source = (ScatterView)sender; this.areaWidth = source.ActualWidth; this.areaHeight = source.ActualHeight; this.InitRatios(); this.InitScatterViewHost(source); }
/// <summary> /// Provides derived classes an opportunity to handle changes to the ScatterArea property. /// </summary> /// <param name="oldValue">Parameter old value</param> /// <param name="newValue">Paramenter new value </param>] protected virtual void OnScatterAreaChanged(ScatterView oldValue, ScatterView newValue) { if (newValue != null) { this.areaWidth = newValue.ActualWidth; this.areaHeight = newValue.ActualHeight; this.InitRatios(); this.InitScatterViewHost(newValue); //newValue.ZoomFactorChanged += this.OnZoomFactorChanged; newValue.SizeChanged += this.UpdateScatterViewInfo; } else { this.areaWidth = -1; this.areaHeight = -1; this.ratioX = 1; this.ratioY = 1; } }
public ScatterViewItem(ScatterView scatterView) : base(scatterView) { this.DefaultStyleKey = typeof(ScatterViewItem); }
/// <summary> /// Initializes a new instance of the <see cref="ConnectableViewItem"/> class. /// </summary> /// <param name="scatterView"></param> protected ConnectableViewItem(ScatterView scatterView) : base(scatterView) { this.SubscribeUIChanges(); }