protected override void Update(GameTime time) { var currentSprite = trackBackgroundImageSource?.GetSprite(); if (trackBackgroundSprite != currentSprite) { OnTrackBackgroundSpriteChanged(currentSprite); } }
protected override void Update(GameTime time) { var currentSprite = source?.GetSprite(); if (sprite != currentSprite) { OnSpriteChanged(currentSprite); } }
private static void InvalidateTrackBackground(object propertyowner, PropertyKey <ISpriteProvider> propertykey, ISpriteProvider propertyoldvalue) { var slider = (Slider)propertyowner; slider.InvalidateMeasure(); if (propertyoldvalue != null) { propertyoldvalue.GetSprite().SizeChanged -= slider.OnSizeChanged; } if (slider.TrackBackgroundImage != null) { slider.TrackBackgroundImage.GetSprite().SizeChanged += slider.OnSizeChanged; } }
private static void InvalidateTrackBackground(object propertyowner, PropertyKey<ISpriteProvider> propertykey, ISpriteProvider propertyoldvalue) { var slider = (Slider)propertyowner; slider.InvalidateMeasure(); if (propertyoldvalue != null) propertyoldvalue.GetSprite().SizeChanged -= slider.OnSizeChanged; if(slider.TrackBackgroundImage != null) slider.TrackBackgroundImage.GetSprite().SizeChanged += slider.OnSizeChanged; }