In This Article

FontSizeBarGalleryItemViewModel Class

Represents a gallery item view model for a font size.

public class FontSizeBarGalleryItemViewModel : BarGalleryItemViewModel<double>, IBarGalleryItemViewModel, INotifyPropertyChanged, IEquatable<IBarGalleryItemViewModel>
Inheritance:
System.Object ObservableObjectBase BarGalleryItemViewModel<System.Double> Object
Implements:
IBarGalleryItemViewModel System.IEquatable<IBarGalleryItemViewModel>

Constructors

FontSizeBarGalleryItemViewModel()

Initializes a new instance of the class with a default font size.

public FontSizeBarGalleryItemViewModel()

FontSizeBarGalleryItemViewModel(Double)

Initializes a new instance of the class with the specified size and a default category.

public FontSizeBarGalleryItemViewModel(double value)
Parameter Type Description
value System.Double

The font size.

FontSizeBarGalleryItemViewModel(Double, String)

Initializes a new instance of the class with the specified size and category.

public FontSizeBarGalleryItemViewModel(double value, string category)
Parameter Type Description
value System.Double

The font size.

category System.String

The item's category, or null if categorization is not supported.

FontSizeBarGalleryItemViewModel(Double, String, String)

Initializes a new instance of the class with the specified size, category, and label.

public FontSizeBarGalleryItemViewModel(double value, string category, string label)
Parameter Type Description
value System.Double

The font size.

category System.String

The item's category, or null if categorization is not supported.

label System.String

The text label to display, or null if the label can be coerced from the current value.

Properties

DefaultCategory

Gets the localizable default category to be used for view models of this type.

public static string DefaultCategory { get; }

Property Value

System.String:

The string category name.

IsLabelVisible

public override bool IsLabelVisible { get; }

Property Value

System.Boolean

Value

Gets or sets the value associated with this view model.

public override double Value { get; set; }

Property Value

System.Double:

An object of type TValue.

Methods

ConvertFontSizeFromWpfFontSize(Double)

Converts a WPF font size to a display font size (used in this view model).

public static double ConvertFontSizeFromWpfFontSize(double wpfFontSize)
Parameter Type Description
wpfFontSize System.Double

The WPF font size to convert.

Returns

System.Double:

The converted font size.

ConvertFontSizeToWpfFontSize(Double)

Converts a display font size (used in this view model) to a WPF font size.

public static double ConvertFontSizeToWpfFontSize(double fontSize)
Parameter Type Description
fontSize System.Double

The display font size to convert.

Returns

System.Double:

The converted font size.

CreateDefaultCollection()

Creates a default collection of gallery item view models representing common font sizes.

public static IEnumerable<FontSizeBarGalleryItemViewModel> CreateDefaultCollection()

Returns

System.Collections.Generic.IEnumerable<FontSizeBarGalleryItemViewModel>:

The collection of gallery item view models that was created.

CreateDefaultCollectionViewSource(Boolean)

Creates an System.Windows.Data.CollectionViewSource of gallery item view models representing common font sizes, allowing for possible categorization and filtering.

public static CollectionViewSource CreateDefaultCollectionViewSource(bool categorize)
Parameter Type Description
categorize System.Boolean

Whether the collection view source should support categorization by including a group description based on Category property values.

Returns

System.Windows.Data.CollectionViewSource:

The System.Windows.Data.CollectionViewSource of gallery item view models that was created.

Inherited Members