public void Dispose() { if (ActiveView == this) { ActiveView = null; } if (this.MainCanvas != null) { this.MainCanvas.clean(); this.MainCanvas = null; } if (this.TempCanvas != null) { this.TempCanvas.clean(); this.TempCanvas = null; } if (_view != null) { this.CoreView.destoryView(_view); _view.Dispose(); _view = null; } if (this.CoreView != null) { this.CoreView.Dispose(); this.CoreView = null; } WPFImageSourceHelper.Clean(); }
public WPFGraphView(Panel container) { this.CoreView = new GiCoreView(); this._view = new WPFViewAdapter(this); this.CoreView.createView(this._view); MainCanvas = new WPFMainCanvas(this.CoreView, _view) { Width = container.ActualWidth, Height = container.ActualHeight }; TempCanvas = new WPFTempCanvas(this.CoreView, _view) { Width = container.ActualWidth, Height = container.ActualHeight }; TempCanvas.Background = new SolidColorBrush(Colors.Transparent); container.Children.Add(MainCanvas); container.Children.Add(TempCanvas); Panel.SetZIndex(TempCanvas, 1); container.SizeChanged += new SizeChangedEventHandler(container_SizeChanged); this.CoreView.onSize(_view, (int)container.ActualWidth, (int)container.ActualHeight); }
private void init(Panel container) { MainCanvas = new WPFMainCanvas(this.CoreView, _view) { Width = container.ActualWidth, Height = container.ActualHeight }; TempCanvas = new WPFTempCanvas(this.CoreView, _view) { Width = container.ActualWidth, Height = container.ActualHeight }; TempCanvas.Background = new SolidColorBrush(Colors.Transparent); container.Children.Add(MainCanvas); container.Children.Add(TempCanvas); Panel.SetZIndex(TempCanvas, 1); container.SizeChanged += new SizeChangedEventHandler(container_SizeChanged); this.CoreView.onSize(_view, (int)container.ActualWidth, (int)container.ActualHeight); }