This returns a sequence of union cases for a given discriminated union type, the values in this sequence can be passed into any place that expects a case of that discriminated union. Useful for use as the option values for a combobox, or for printing out all available options for that given discriminated union.
7 people like thisPosted: 6 years ago by Micael Morais
A generic value converter for discriminated unions, it allows to use a single converter for any discriminated union along with facilitating the creation of new ones with a default option value for when an incompatible union case is provided. Large part of this snippet uses http://fssnip.net/62 as a base, all credit on the ConverterBase goes to him, one of the authors also has a new version of it http://fssnip.net/7Q
1 people like thisPosted: 6 years ago by Micael Morais
This shows an alternative to using spaces in the discriminated union cases, which makes it harder to write in code, and tends to be needed when interoping with the likes of WPF or any other element that uses the ToString of the union case to display its value. Also useful as an alternative to using special characters like á or ç which make it harder to work with colleagues that don't have keyboards with those characters. Uses code from snippet http://fssnip.net/9l
0 people like thisPosted: 6 years ago by Micael Morais