BinaryRibbonControlSizingCollectionConverter
class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WPF.Controls.Office
Reads the XAML text of BinaryRibbonBarPanel.ResizableSizeProperty –
"Large,Medium,Small" or "L,M,S" – into a BinaryRibbonControlSizeCollection.
public class BinaryRibbonControlSizingCollectionConverter : TypeConverter
Inherits from / implements: TypeConverter
Remarks
XAML uses it on its own; there is no need to call it. Each comma-separated entry is
L, M, S or 0 (for BinaryRibbonControlSize.Minimized), in either
case, or a full BinaryRibbonControlSize name. A single letter must not have a space
before it: "L, M" fails where "L,M" and "Large, Medium" work.
See also
Members at a glance
| Methods | |
|---|---|
CanConvertFrom | Reports whether a value of the given type can be read: only a string can. |
ConvertFrom | Reads a comma-separated list of sizes into a BinaryRibbonControlSizeCollection. |
Methods
CanConvertFrom
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
Reports whether a value of the given type can be read: only a string can.
Parameters
context- Not used.
sourceType- The type of the value.
Returns
true for string; otherwise false.
ConvertFrom
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
Reads a comma-separated list of sizes into a BinaryRibbonControlSizeCollection.
Parameters
context- Not used.
culture- Not used.
value- The text, such as
"L,M,S".
Returns
The sizes in the order given, or null for text that is only white space.
Exceptions
System.NotSupportedExceptionvalueisnull, empty or not a string.System.ArgumentException- An entry is not a size.