/// <summary> /// Create a <c>PropertyChangeEventArgs</c> /// </summary> /// <param name="property">The enumeration for the property that changed</param> public PropertyChangeEventArgs(ImagePanelProperties property) { this.property = property ; }
/// <summary> /// React to property changes, including firing <see cref="PropertyChange"/> events /// </summary> /// <param name="imagePanelProperty">Enumeration for the property that changed</param> protected virtual void OnPropertyChange(ImagePanelProperties imagePanelProperty) { switch(imagePanelProperty) { case ImagePanelProperties.BackColorProperty: case ImagePanelProperties.PanelGridSizeProperty: case ImagePanelProperties.GridColorProperty: case ImagePanelProperties.ImagesProperty: case ImagePanelProperties.DimensionsProperty: if (panelImage != null) { panelImage.Dispose() ; panelImage = null ; } if (Visible) { Invalidate() ; } break ; case ImagePanelProperties.SelectedColorsProperty: case ImagePanelProperties.DefaultImageProperty: if (Visible) { Invalidate() ; } break ; // Note: We dont do anything if these change dynamically // If we are animating they will be picked up and nothing bad // will happen case ImagePanelProperties.MinBounceRatioProperty: case ImagePanelProperties.MaxBounceRatioProperty: case ImagePanelProperties.BounceFactorProperty: case ImagePanelProperties.AutoSelectProperty: break ; } if (propertyChangeListeners != null) { propertyChangeListeners(this,new PropertyChangeEventArgs(imagePanelProperty)) ; } }