Enables explicit conversion from one data type to another during data-binding.
Namespace: MindFusion.Scheduling.DataBinding
Assembly: MindFusion.Scheduling
C# Copy Code |
---|
public interface IValueConverter |
Visual Basic Copy Code |
---|
Public Interface IValueConverter |
When you need to perform explicit type conversion during databinding, you need to implement this interface and supply an instance of your class to the LoadFromDataSource method of the Calendar class. During loading the Supports method of the IValueConverter interface is invoked every time a value from the data source is transferred to the respective destination property to check whether the value should be converted. If Supports returns true, then Convert is invoked in order to perform the actual conversion.
The following example demonstrates a sample implementation of the IValueConverter interface which converts all byte values to boolean:
C# Copy Code |
---|
public class ByteToBoolConverter : IValueConverter |
Visual Basic Copy Code |
---|
Public Class ByteToBoolConverter |