Skip to content

RectConverter

JaykeBird edited this page Feb 21, 2023 · 4 revisions

Back to home | Back to Reference | View raw text

RectConverter class

Description

A MultiValueConverter that takes 4 values and creates a Rect. This class can be used to get around the fact that a Rect cannot be used for XAML binding.

Diagram

  flowchart LR
  classDef interfaceStyle stroke-dasharray: 5 5;
  classDef abstractStyle stroke-width:4px
  subgraph SolidShineUi
  SolidShineUi.RectConverter[[RectConverter]]
  end
  subgraph System.Windows.Data
System.Windows.Data.IMultiValueConverter[[IMultiValueConverter]]
  end
System.Windows.Data.IMultiValueConverter --> SolidShineUi.RectConverter
Loading

Members

Methods

Public methods

Returns Name
object Convert(object``[] values, Type targetType, object parameter, CultureInfo culture)
Convert 4 doubles to a Rect structure.
object``[] ConvertBack(object value, Type``[] targetTypes, object parameter, CultureInfo culture)
Convert a Rect into an array of doubles representing its X, Y, Width, and Height values respectively.

Details

Summary

A MultiValueConverter that takes 4 values and creates a Rect. This class can be used to get around the fact that a Rect cannot be used for XAML binding.

Inheritance

  • IMultiValueConverter

Constructors

RectConverter

public RectConverter()

Methods

Convert

public virtual object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
Arguments
Type Name Description
object``[] values The four doubles to use to measure the Rect's X, Y, Width, and Height values respectively.
Type targetType Not used, always returns a Rect
object parameter Not used
CultureInfo culture Not used
Summary

Convert 4 doubles to a Rect structure.

Returns

ConvertBack

public virtual object ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
Arguments
Type Name Description
object value
Type``[] targetTypes
object parameter
CultureInfo culture
Summary

Convert a Rect into an array of doubles representing its X, Y, Width, and Height values respectively.

Exceptions
Name Description
InvalidCastException Thrown if the value passed in is not a Rect structure.

Generated with ModularDoc

Clone this wiki locally