示例#1
0
        protected override void Update(GameTime time)
        {
            var currentSprite = trackBackgroundImageSource?.GetSprite();

            if (trackBackgroundSprite != currentSprite)
            {
                OnTrackBackgroundSpriteChanged(currentSprite);
            }
        }
示例#2
0
        protected override void Update(GameTime time)
        {
            var currentSprite = source?.GetSprite();

            if (sprite != currentSprite)
            {
                OnSpriteChanged(currentSprite);
            }
        }
示例#3
0
文件: Slider.cs 项目: zetz/xenko
        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;
            }
        }
示例#4
0
文件: Slider.cs 项目: cg123/xenko
        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;
        }