Skip to content

A WPF/MVVM control for selection of values in different units with automatic unit conversion

License

Notifications You must be signed in to change notification settings

Dirkster99/UnitComboLib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build status Release NuGet

Net4 NetCore3

Overview

The WPF UnitComboBox Control implements a combobox that allows the selection of values from different lists. Each list can represent a different unit (eg.: Celsius, Farenheit) and the viewmodel takes care of always converting to one unit (e.g. Celsius). This conversion is independent of what the user selected unit or value actually was.

This means, the application always sees only one unit and a different value while the user can use whatever unit he prefers to pick the aproppriate value.

Details are explained in a CodeProject article: https://www.codeproject.com/Articles/575645/Inheriting-from-a-Look-Less-WPF-Control

Sample Applications:

Theming

Load Light or Dark brush resources in you resource dictionary to take advantage of existing definitions.

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/UnitComboLib;component/Themes/DarkBrushs.xaml" />
    </ResourceDictionary.MergedDictionaries>
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/UnitComboLib;component/Themes/LightBrushs.xaml" />
    </ResourceDictionary.MergedDictionaries>

These definitions do not theme all controls used within this library. You should use a standard theming library, such as:

to also theme standard elements, such as, button and textblock etc.