Replies: 1 comment 2 replies
-
Hi, so if I understand correctly you would have something like this: var selectedUnits = new Dictionary<string, Enum>
{
{ "Length", LengthUnit.Centimeter },
{ "Mass", MassUnit.Kilogram },
// etc.
};
var maxLength = Length.MaxValue.As((LengthUnit)selectedUnits["Length"]); // Max length in centimeters. There is no such concept in the library today, but there is work in progress to redesign our This is a breaking change and would have to be part of #563 . |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When interacting with a user interface it would be nice to have a way to get the numerical value of a generic unit by passing a unit setting container. An example use would be this below. Here in this generic, the SelectedUnits would have settings for each specific unit type. This would enable this list to be modified by the user and have all locations where that unit is use to be updated and have the values updated at the same time throughout the program (or on a specific screen or table if desired). The class SelectedUnits would be just a list of enums that each specific unit class would pick out the appropriate enum and return a double.
Does something like this already exist or is it something that can be added?
Beta Was this translation helpful? Give feedback.
All reactions