forked from xamarin/XamarinCommunityToolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConvertersGalleryViewModel.cs
More file actions
128 lines (127 loc) · 6.01 KB
/
Copy pathConvertersGalleryViewModel.cs
File metadata and controls
128 lines (127 loc) · 6.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
using System.Collections.Generic;
using Xamarin.CommunityToolkit.Converters;
using Xamarin.CommunityToolkit.Sample.Models;
using Xamarin.CommunityToolkit.Sample.Pages.Converters;
using Xamarin.Forms;
namespace Xamarin.CommunityToolkit.Sample.ViewModels.Converters
{
public class ConvertersGalleryViewModel : BaseGalleryViewModel
{
protected override IEnumerable<SectionModel> CreateItems() => new[]
{
new SectionModel(
typeof(BoolToObjectConverterPage),
nameof(BoolToObjectConverter),
"A converter that allows users to convert a bool value binding to a specific object."),
new SectionModel(
typeof(IsNullOrEmptyConverterPage),
nameof(IsNullOrEmptyConverter),
"A converter that allows users to convert an incoming binding to a bool value. This value represents if the incoming binding value is null or empty."),
new SectionModel(
typeof(IsNotNullOrEmptyConverterPage),
nameof(IsNotNullOrEmptyConverter),
"A converter that allows users to convert an incoming binding to a bool value. This value represents if the incoming binding value is Not null or empty."),
new SectionModel(
typeof(InvertedBoolConverterPage),
nameof(InvertedBoolConverter),
"A converter that allows users to convert a bool value binding to its inverted value.."),
new SectionModel(
typeof(EqualConverterPage),
nameof(EqualConverter),
"A converter that allows users to convert any value binding to a bool depending on whether or not it is equal to a different value. "),
new SectionModel(
typeof(NotEqualConverterPage),
nameof(NotEqualConverter),
"A converter that allows users to convert any value binding to a bool depending on whether or not it is not equal to a different value. "),
new SectionModel(
typeof(DoubleToIntConverterPage),
nameof(DoubleToIntConverter),
"A converter that allows users to convert an incoming double value to an int."),
new SectionModel(
typeof(IndexToArrayItemConverterPage),
nameof(IndexToArrayItemConverter),
"A converter that allows users to convert a int value binding to an item in an array."),
new SectionModel(
typeof(IntToBoolConverterPage),
nameof(IntToBoolConverter),
"A converter that allows users to convert an incoming int value to a bool."),
new SectionModel(
typeof(ItemTappedEventArgsPage),
nameof(ItemTappedEventArgsConverter),
"A converter that allows you to extract the value from ItemTappedEventArgs that can be used in combination with EventToCommandBehavior"),
new SectionModel(
typeof(TextCaseConverterPage),
nameof(TextCaseConverter),
"A converter that allows users to convert the casing of an incoming string type binding. The Type property is used to define what kind of casing will be applied to the string."),
new SectionModel(
typeof(ByteArrayToImageSourcePage),
nameof(ByteArrayToImageSourceConverter),
Color.FromHex("#498205"),
"A converter that allows you to convert byte array to an object of a type ImageSource"),
new SectionModel(
typeof(MultiConverterPage),
nameof(MultiConverter),
"This sample demonstrates how to use Multibinding Converter"),
new SectionModel(
typeof(DateTimeOffsetConverterPage),
nameof(DateTimeOffsetConverter),
"A converter that allows to convert from a DateTimeOffset type to a DateTime type"),
new SectionModel(
typeof(VariableMultiValueConverterPage),
nameof(VariableMultiValueConverter),
"A converter that allows you to combine multiple boolean bindings into a single binding."),
new SectionModel(
typeof(ListIsNullOrEmptyPage),
nameof(ListIsNullOrEmptyConverter),
"A converter that allows you to check if collection is null or empty"),
new SectionModel(
typeof(ListIsNotNullOrEmptyConverterPage),
nameof(ListIsNotNullOrEmptyConverter),
"A converter that allows you to check if collection is not null or empty"),
new SectionModel(
typeof(ListToStringConverterPage),
nameof(ListToStringConverter),
"A converter that allows users to convert an incoming binding that implements IEnumerable to a single string value. The Separator property is used to join the items in the IEnumerable."),
new SectionModel(
typeof(EnumToBoolConverterPage),
nameof(EnumToBoolConverter),
"A converter that allows you to convert an Enum to boolean value"),
new SectionModel(
typeof(EnumToIntConverterPage),
nameof(EnumToIntConverter),
"A converter that allows you to convert an Enum to its underlying int value"),
new SectionModel(
typeof(ImageResourceConverterPage),
nameof(ImageResourceConverter),
"A converter that allows you to convert embeded ressource image id to an ImageSource"),
new SectionModel(
typeof(IsInRangeConverterPage),
nameof(IsInRangeConverter),
"A converter that allows you to check if a value is in a range"),
new SectionModel(
typeof(MathExpressionConverterPage),
nameof(MathExpressionConverter),
"A converter that allows users to calculate an expression at runtime."),
new SectionModel(
typeof(StringToListConverterPage),
nameof(StringToListConverter),
"A converter that splits a string by the separator and returns the enumerable sequence of strings as the result."),
new SectionModel(
typeof(EnumToListConverterPage),
nameof(EnumToListConverter),
"A converter that returns the enumerable sequence of enum as the result."),
new SectionModel(
typeof(CompareConverterPage),
nameof(CompareConverter),
"A converter that allows you to convert an object of a type implementing IComparable, to a boolean or a specific object based on the result of a comparaison specified by a comparison operator and ComparingValue."),
new SectionModel(
typeof(ImageResourceConverterPage),
nameof(ImageResourceConverter),
"A converter that allows you to convert embeded ressource image id to an ImageSource"),
new SectionModel(
typeof(ColorsConverterPage),
"Colors converters",
"A group of converters that convert a Color to your strings values (RGB, HEX, HSL, etc)"),
};
}
}