Skip to content

Version 1.9.8 - Font weights and split buttons!

Latest
Compare
Choose a tag to compare
@JaykeBird JaykeBird released this 24 Feb 18:40

Well, here we are! Turns out one of the changes I made for 1.9.7 caused the FontSelectDialog to cause program crashes. Soooo that's not great.

I figured that while I was taking the time to make changes to the FontSelectDialog for this, I would also add in a few more things that I could backport from 2.0. This did end up creating some breaking changes, but I think the net positive makes it all worth it.

After this, my focus is back to working on version 2.0. I'm still aiming to release it in the first half of 2024, but it probably won't be before April, let's be realistic. But I am still making progress! I did have to take a short break to avoid burnout though (and also to care for a medical issue our pet dog was dealing with lol). But hopefully now I'll be good to focus more time on programming now!

Consume the library

🍔🍦
One of three ways:

  • Get the library from NuGet
  • Download the binaries below!
    • Versions for .NET Framework 4.7.1 and 4.8, .NET 6, and .NET 7!
  • Build it yourself from code!

Breaking Changes

  • FlatButton's IsSelectedChanged event is changed to use SolidShineUi's ItemSelectionChangedEventHandler (rather than DependencyPropertyChangedEventHandler). The only change you'll need to do will be updating the actual method definitions as follows:
    • Change myButton_IsSelectionChanged(object sender, DependencyPropertyChangedEventArgs e) to myButton_IsSelectionChanged(object sender, ItemSelectionChangedEventArgs e)
  • SelectableUserControl's IsSelectedChanged event is changed to use SolidShineUi.ItemSelectionChangedEventHandler, rather than SolidShineUi.SelectableUserControl.ItemSelectionChangedEventHandler - no functional difference, just easier to type!
    • The obsolete SelectionChanged event is still using the old event handler delegate
  • SelectableUserControl's Click event and RightClick event have been changed to routed events - if you listen to these events, make sure to update your listeners to use RoutedEventArgs and RoutedEventHandler
  • The Items and ItemsSource properties in SelectPanel are changed to an enumerable/collection of IClickSelectableControl, rather than SelectableUserControl
    • If you refer to these properties' types, you'll have to change them to IEnumerable<IClickSelectableControl> or SelectableCollection<IClickSelectableControl>
    • This also affects the type of SelectPanel.Items.SelectedItems - this is also now ReadOnlyCollection<IClickSelectableControl>
    • IClickSelectableControl has a notably smaller set of methods/properties than a UserControl (such as SelectableUserControl); if you need to access a method or property not in IClickSelectableControl, you'll need to cast to a SelectableUserControl or whatever type is relevant for you
  • Most IValueConverter objects in SolidShineUi now return DependencyProperty.UnsetValue when an invalid value is passed in, rather than returning null or throwing an exception
    • This seems to be more in line with what's expected from IValueConverters in WPF

Reminders for version 2.0

For version 2.0, here's some info to keep in mind. I'm trying to avoid too drastic of breaking changes, but there's no better time to introduce such changes than in a major version number increase like this.

So that in mind, keep this handy for when version 2.0 ends up dropping:

  • Support for .NET Core 3.1 will be dropped in version 2.0. I suggest upgrading to .NET 6 or .NET 8, the new LTS releases.
  • ExperimentalPropertyList will be renamed to just PropertyList
  • ISelectableCollectionSource is being renamed to just ISelectableCollection
  • The obsolete methods in SelectPanel and MessageDialog will be removed - please adjust to the suggested replacements

The breaking changes in this version are all stuff backported from 2.0, so if you adjust to these changes here, it'll be less to transition when you upgrade to 2.0!

Changelog

  • Rewrote how FontSelectDialog handles font weight
    • Font weight is now displayed and stored as an integer, rather than just being a list of items to select from
      • This way, more fine weight control is possible - for the few fonts that actually support this
      • With this, the crashes and issues present in 1.9.7 are no longer present
    • Added more buttons!
      • Backported from 2.0
      • FlatRepeatButton
        • Like a regular FlatButton, but its Execute event continues to activate while you're holding the button down
        • Also has PressBegan and PressEnded events too
        • And it also supports commands for all of these!
      • SplitButton
        • Basically a FlatButton and MenuButton smashed into one! Click the main button on the left for the primary action, or click on the menu to display additional options.
        • A staple for more advanced UI designs, in my eyes, but it is surprisingly not present in WPF
        • Feels like it covers everything needed of a split button, but if I have ideas of what more to do with it later, I'll add it after 2.0
    • Added IClickSelectableCollection interface
      • Backported from 2.0
      • FlatButton, MenuButton, SplitButton, and SelectableUserControl all follow this interface
      • If you build a control or UserControl that implements this interface, it can be used with SelectPanel! - you no longer need to build from SelectableUserControl
    • Changes to SelectPanel, SelectableUserControl
      • SelectPanel's Items property is now a collection of IClickSelectableControl, rather than SelectableUserControl
        • This provides more flexibility for other developers to build controls that can be used with SelectPanel
      • SelectableUserControl's Click and RightClick events are now routed events
    • Other changes
      • FlatButton's IsSelectedChanged event args has changed - see the breaking changes section
      • Most WPF converters (IValueConverter objects) now return DependencyProperty.UnsetValue when an invalid value is passed on
        • Rather than returning null or throwing an exception
        • This seems to be more in line with what's expected with WPF, although I don't think WPF itself always adheres to this
      • Hidden tabs in TabControl will now also be hidden in the tab list menu
      • Minor change to AutoCompleteBehavior to quick-exit if we already have a suggested string
      • New WPF value converters: PartialThicknessConverter and PartialCornerRadiusConverter
        • Use this to select which edges or corners of an element to apply a uniform Thickness or CornerRadius value onto
        • Pass in the Thickness or CornerRadius as the value, and pass a filter value as the converter parameter (which can be a string of a comma-separated list of edges/corners)
        • Use PartialValueHelper if you need assistance on getting the filter values
        • Used with SplitButton, but may have other uses in more controls