void _panelImage_HandleDestroyed(object sender, EventArgs e) { if (_model != null) { _model.Dispose(); _model = null; } }
/// ------------------------------------------------------------------------------------ private void Initialize(string imageFileName) { var clickZoomPercentages = PortableSettingsProvider.GetIntArrayFromString( Settings.Default.ImageViewerClickImageZoomPercentages); if (_model != null) { _model.Dispose(); _model = null; } _model = new ImageViewerViewModel(imageFileName, clickZoomPercentages); }