rds1983 / Myra

UI Library for MonoGame, FNA and Stride
MIT License
704 stars 93 forks source link

Bug? Setting a default slider style with a null KnobStyle throws exception #311

Closed minimalism closed 3 years ago

minimalism commented 3 years ago

Setting a default slider with null KnobStyle, e.g.

styles.VerticalSliderStyle = styles.HorizontalSliderStyle = new SliderStyle {
      Background = DefaultBackground,
      Padding = Sizes.ThinPadding,
  };

will throw a NullReferenceException from Widget.ApplyWidgetStyle (via Slider.ApplySliderStyle -> ImageButton.ApplyImageButtonStyle -> ButtonBase<Image>.ApplyButtonStyle) when later instantiating a slider with that style.