├── .editorconfig
├── .gitattributes
├── .github
└── workflows
│ └── nuget.yml
├── .gitignore
├── Directory.build.props
├── LICENSE
├── README.md
├── WhatIsThisSheet.Sample
├── App.xaml
├── App.xaml.cs
├── AppShell.xaml
├── AppShell.xaml.cs
├── MainPage.xaml
├── MainPage.xaml.cs
├── MauiProgram.cs
├── Platforms
│ ├── Android
│ │ ├── AndroidManifest.xml
│ │ ├── MainActivity.cs
│ │ ├── MainApplication.cs
│ │ └── Resources
│ │ │ └── values
│ │ │ └── colors.xml
│ ├── MacCatalyst
│ │ ├── AppDelegate.cs
│ │ ├── Entitlements.plist
│ │ ├── Info.plist
│ │ └── Program.cs
│ ├── Tizen
│ │ ├── Main.cs
│ │ └── tizen-manifest.xml
│ ├── Windows
│ │ ├── App.xaml
│ │ ├── App.xaml.cs
│ │ ├── Package.appxmanifest
│ │ └── app.manifest
│ └── iOS
│ │ ├── AppDelegate.cs
│ │ ├── Info.plist
│ │ └── Program.cs
├── Properties
│ └── launchSettings.json
├── Resources
│ ├── AppIcon
│ │ ├── appicon.svg
│ │ └── appiconfg.svg
│ ├── Fonts
│ │ ├── OpenSans-Regular.ttf
│ │ └── OpenSans-Semibold.ttf
│ ├── Images
│ │ └── dotnet_bot.png
│ ├── Raw
│ │ └── AboutAssets.txt
│ ├── Splash
│ │ └── splash.svg
│ └── Styles
│ │ ├── Colors.xaml
│ │ └── Styles.xaml
└── WhatIsThisSheet.Sample.csproj
├── WhatIsThisSheet.sln
├── WhatIsThisSheet
├── AssemblyInfo.cs
├── BottomSheet.cs
├── NumericExtensions.cs
├── SheetStop.cs
├── SheetStopMeasurement.cs
├── ViewExtensions.cs
└── WhatIsThisSheet.csproj
├── global.json
├── images
└── logo.png
└── stylecop.json
/.editorconfig:
--------------------------------------------------------------------------------
1 | # editorconfig.org
2 |
3 | # top-most EditorConfig file
4 | root = true
5 |
6 | # Default settings:
7 | # A newline ending every file
8 | # Use 4 spaces as indentation
9 | [*]
10 | insert_final_newline = true
11 | indent_style = space
12 | indent_size = 4
13 |
14 | [project.json]
15 | indent_size = 2
16 |
17 | # C# files
18 | [*.cs]
19 | # New line preferences
20 | csharp_new_line_before_open_brace = all
21 | csharp_new_line_before_else = true
22 | csharp_new_line_before_catch = true
23 | csharp_new_line_before_finally = true
24 | csharp_new_line_before_members_in_object_initializers = true
25 | csharp_new_line_before_members_in_anonymous_types = true
26 | csharp_new_line_between_query_expression_clauses = true
27 |
28 | # Indentation preferences
29 | csharp_indent_block_contents = true
30 | csharp_indent_braces = false
31 | csharp_indent_case_contents = true
32 | csharp_indent_case_contents_when_block = true
33 | csharp_indent_switch_labels = true
34 | csharp_indent_labels = one_less_than_current
35 |
36 | # Modifier preferences
37 | csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
38 |
39 | # use this.
40 | dotnet_style_qualification_for_field = true:none
41 | dotnet_style_qualification_for_property = true:none
42 | dotnet_style_qualification_for_method = true:none
43 | dotnet_style_qualification_for_event = true:none
44 |
45 | # only use var when it's obvious what the variable type is
46 | csharp_style_var_for_built_in_types = true:none
47 | csharp_style_var_when_type_is_apparent = true:none
48 | csharp_style_var_elsewhere = true:none
49 |
50 | # Types: use keywords instead of BCL types, and permit var only when the type is clear
51 | csharp_style_var_for_built_in_types = false:suggestion
52 | csharp_style_var_when_type_is_apparent = false:none
53 | csharp_style_var_elsewhere = false:suggestion
54 | dotnet_style_predefined_type_for_locals_parameters_members = true:warning
55 | dotnet_style_predefined_type_for_member_access = true:warning
56 |
57 | # name all constant fields using PascalCase
58 | dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
59 | dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
60 | dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
61 | dotnet_naming_symbols.constant_fields.applicable_kinds = field
62 | dotnet_naming_symbols.constant_fields.required_modifiers = const
63 | dotnet_naming_style.pascal_case_style.capitalization = pascal_case
64 |
65 | # static fields should have s_ prefix
66 | dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
67 | dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
68 | dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
69 | dotnet_naming_symbols.static_fields.applicable_kinds = field
70 | dotnet_naming_symbols.static_fields.required_modifiers = static
71 | dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected
72 | dotnet_naming_style.static_prefix_style.required_prefix = s_
73 | dotnet_naming_style.static_prefix_style.capitalization = camel_case
74 |
75 | # internal and private fields should be _camelCase
76 | dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
77 | dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
78 | dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
79 | dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
80 | dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
81 | dotnet_naming_style.camel_case_underscore_style.required_prefix = _
82 | dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
83 |
84 | # Code style defaults
85 | csharp_using_directive_placement = outside_namespace:warning
86 | dotnet_separate_import_directive_groups = false
87 | dotnet_sort_system_directives_first = true
88 | csharp_prefer_braces = true:silent
89 | csharp_preserve_single_line_blocks = true:none
90 | csharp_preserve_single_line_statements = false:none
91 | csharp_prefer_static_local_function = true:suggestion
92 | csharp_prefer_simple_using_statement = false:none
93 |
94 | # Code quality
95 | dotnet_style_readonly_field = true:suggestion
96 | dotnet_code_quality_unused_parameters = non_public:suggestion
97 |
98 | # Parentheses preferences
99 | dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
100 | dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
101 | dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
102 | dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
103 |
104 | # Modifier preferences
105 | dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning
106 |
107 | # Field preferences
108 | dotnet_style_readonly_field = true:warning
109 |
110 | # Expression-level preferences
111 | dotnet_style_object_initializer = true:suggestion
112 | dotnet_style_collection_initializer = true:suggestion
113 | dotnet_style_explicit_tuple_names = true:suggestion
114 | dotnet_style_coalesce_expression = true:suggestion
115 | dotnet_style_null_propagation = true:suggestion
116 | dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
117 | dotnet_style_prefer_inferred_tuple_names = true:suggestion
118 | dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
119 | dotnet_style_prefer_auto_properties = true:suggestion
120 | dotnet_style_prefer_conditional_expression_over_assignment = true:silent
121 | dotnet_style_prefer_conditional_expression_over_return = true:silent
122 | csharp_prefer_simple_default_expression = true:suggestion
123 | dotnet_style_prefer_compound_assignment = true:warning
124 | dotnet_style_prefer_simplified_interpolation = true:suggestion
125 |
126 | # Expression-bodied members
127 | csharp_style_expression_bodied_methods = true:suggestion
128 | csharp_style_expression_bodied_constructors = true:suggestion
129 | csharp_style_expression_bodied_operators = true:suggestion
130 | csharp_style_expression_bodied_properties = true:suggestion
131 | csharp_style_expression_bodied_indexers = true:suggestion
132 | csharp_style_expression_bodied_accessors = true:suggestion
133 | csharp_style_expression_bodied_lambdas = true:suggestion
134 | csharp_style_expression_bodied_local_functions = true:suggestion
135 |
136 | # Pattern matching
137 | csharp_style_pattern_matching_over_as_with_null_check = true:warning
138 | csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
139 | csharp_style_inlined_variable_declaration = true:suggestion
140 | csharp_style_prefer_switch_expression = true:suggestion
141 |
142 | # Null checking preferences
143 | csharp_style_throw_expression = true:suggestion
144 | csharp_style_conditional_delegate_call = true:suggestion
145 |
146 | # Other features
147 | csharp_style_prefer_index_operator = false:none
148 | csharp_style_prefer_range_operator = false:none
149 | csharp_style_pattern_local_over_anonymous_function = false:none
150 |
151 | # Space preferences
152 | csharp_space_after_cast = false
153 | csharp_space_after_colon_in_inheritance_clause = true
154 | csharp_space_after_comma = true
155 | csharp_space_after_dot = false
156 | csharp_space_after_keywords_in_control_flow_statements = true
157 | csharp_space_after_semicolon_in_for_statement = true
158 | csharp_space_around_binary_operators = before_and_after
159 | csharp_space_around_declaration_statements = do_not_ignore
160 | csharp_space_before_colon_in_inheritance_clause = true
161 | csharp_space_before_comma = false
162 | csharp_space_before_dot = false
163 | csharp_space_before_open_square_brackets = false
164 | csharp_space_before_semicolon_in_for_statement = false
165 | csharp_space_between_empty_square_brackets = false
166 | csharp_space_between_method_call_empty_parameter_list_parentheses = false
167 | csharp_space_between_method_call_name_and_opening_parenthesis = false
168 | csharp_space_between_method_call_parameter_list_parentheses = false
169 | csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
170 | csharp_space_between_method_declaration_name_and_open_parenthesis = false
171 | csharp_space_between_method_declaration_parameter_list_parentheses = false
172 | csharp_space_between_parentheses = false
173 | csharp_space_between_square_brackets = false
174 |
175 | # analyzers
176 | # CA1851: Possible multiple enumerations of 'IEnumerable' collection - https://github.com/dotnet/roslyn-analyzers/issues/6379
177 | dotnet_diagnostic.CA1851.severity = suggestion
178 |
179 | dotnet_diagnostic.AvoidAsyncVoid.severity = suggestion
180 |
181 | dotnet_diagnostic.CA1000.severity = none
182 | dotnet_diagnostic.CA1001.severity = error
183 | dotnet_diagnostic.CA1009.severity = error
184 | dotnet_diagnostic.CA1016.severity = error
185 | dotnet_diagnostic.CA1030.severity = none
186 | dotnet_diagnostic.CA1031.severity = none
187 | dotnet_diagnostic.CA1033.severity = none
188 | dotnet_diagnostic.CA1036.severity = none
189 | dotnet_diagnostic.CA1049.severity = error
190 | dotnet_diagnostic.CA1056.severity = suggestion
191 | dotnet_diagnostic.CA1060.severity = error
192 | dotnet_diagnostic.CA1061.severity = error
193 | dotnet_diagnostic.CA1063.severity = error
194 | dotnet_diagnostic.CA1065.severity = error
195 | dotnet_diagnostic.CA1301.severity = error
196 | dotnet_diagnostic.CA1303.severity = none
197 | dotnet_diagnostic.CA1308.severity = none
198 | dotnet_diagnostic.CA1400.severity = error
199 | dotnet_diagnostic.CA1401.severity = error
200 | dotnet_diagnostic.CA1403.severity = error
201 | dotnet_diagnostic.CA1404.severity = error
202 | dotnet_diagnostic.CA1405.severity = error
203 | dotnet_diagnostic.CA1410.severity = error
204 | dotnet_diagnostic.CA1415.severity = error
205 | dotnet_diagnostic.CA1507.severity = error
206 | dotnet_diagnostic.CA1710.severity = suggestion
207 | dotnet_diagnostic.CA1724.severity = none
208 | dotnet_diagnostic.CA1810.severity = none
209 | dotnet_diagnostic.CA1821.severity = error
210 | dotnet_diagnostic.CA1900.severity = error
211 | dotnet_diagnostic.CA1901.severity = error
212 | dotnet_diagnostic.CA2000.severity = none
213 | dotnet_diagnostic.CA2002.severity = error
214 | dotnet_diagnostic.CA2007.severity = none
215 | dotnet_diagnostic.CA2100.severity = error
216 | dotnet_diagnostic.CA2101.severity = error
217 | dotnet_diagnostic.CA2108.severity = error
218 | dotnet_diagnostic.CA2111.severity = error
219 | dotnet_diagnostic.CA2112.severity = error
220 | dotnet_diagnostic.CA2114.severity = error
221 | dotnet_diagnostic.CA2116.severity = error
222 | dotnet_diagnostic.CA2117.severity = error
223 | dotnet_diagnostic.CA2122.severity = error
224 | dotnet_diagnostic.CA2123.severity = error
225 | dotnet_diagnostic.CA2124.severity = error
226 | dotnet_diagnostic.CA2126.severity = error
227 | dotnet_diagnostic.CA2131.severity = error
228 | dotnet_diagnostic.CA2132.severity = error
229 | dotnet_diagnostic.CA2133.severity = error
230 | dotnet_diagnostic.CA2134.severity = error
231 | dotnet_diagnostic.CA2137.severity = error
232 | dotnet_diagnostic.CA2138.severity = error
233 | dotnet_diagnostic.CA2140.severity = error
234 | dotnet_diagnostic.CA2141.severity = error
235 | dotnet_diagnostic.CA2146.severity = error
236 | dotnet_diagnostic.CA2147.severity = error
237 | dotnet_diagnostic.CA2149.severity = error
238 | dotnet_diagnostic.CA2200.severity = error
239 | dotnet_diagnostic.CA2202.severity = error
240 | dotnet_diagnostic.CA2207.severity = error
241 | dotnet_diagnostic.CA2212.severity = error
242 | dotnet_diagnostic.CA2213.severity = error
243 | dotnet_diagnostic.CA2214.severity = error
244 | dotnet_diagnostic.CA2216.severity = error
245 | dotnet_diagnostic.CA2220.severity = error
246 | dotnet_diagnostic.CA2229.severity = error
247 | dotnet_diagnostic.CA2231.severity = error
248 | dotnet_diagnostic.CA2232.severity = error
249 | dotnet_diagnostic.CA2235.severity = error
250 | dotnet_diagnostic.CA2236.severity = error
251 | dotnet_diagnostic.CA2237.severity = error
252 | dotnet_diagnostic.CA2238.severity = error
253 | dotnet_diagnostic.CA2240.severity = error
254 | dotnet_diagnostic.CA2241.severity = error
255 | dotnet_diagnostic.CA2242.severity = error
256 |
257 | dotnet_diagnostic.CS1701.severity = silent
258 |
259 | dotnet_diagnostic.RCS1001.severity = error
260 | dotnet_diagnostic.RCS1018.severity = error
261 | dotnet_diagnostic.RCS1037.severity = error
262 | dotnet_diagnostic.RCS1055.severity = error
263 | dotnet_diagnostic.RCS1062.severity = error
264 | dotnet_diagnostic.RCS1066.severity = error
265 | dotnet_diagnostic.RCS1069.severity = suggestion
266 | dotnet_diagnostic.RCS1071.severity = error
267 | dotnet_diagnostic.RCS1074.severity = error
268 | dotnet_diagnostic.RCS1090.severity = suggestion
269 | dotnet_diagnostic.RCS1138.severity = error
270 | dotnet_diagnostic.RCS1139.severity = error
271 | dotnet_diagnostic.RCS1163.severity = suggestion
272 | dotnet_diagnostic.RCS1168.severity = suggestion
273 | dotnet_diagnostic.RCS1188.severity = error
274 | dotnet_diagnostic.RCS1201.severity = error
275 | dotnet_diagnostic.RCS1207.severity = error
276 | dotnet_diagnostic.RCS1211.severity = error
277 | dotnet_diagnostic.RCS1507.severity = error
278 |
279 | dotnet_diagnostic.SA1000.severity = error
280 | dotnet_diagnostic.SA1001.severity = error
281 | dotnet_diagnostic.SA1002.severity = error
282 | dotnet_diagnostic.SA1003.severity = error
283 | dotnet_diagnostic.SA1004.severity = error
284 | dotnet_diagnostic.SA1005.severity = error
285 | dotnet_diagnostic.SA1006.severity = error
286 | dotnet_diagnostic.SA1007.severity = error
287 | dotnet_diagnostic.SA1008.severity = error
288 | dotnet_diagnostic.SA1009.severity = error
289 | dotnet_diagnostic.SA1010.severity = error
290 | dotnet_diagnostic.SA1011.severity = error
291 | dotnet_diagnostic.SA1012.severity = error
292 | dotnet_diagnostic.SA1013.severity = error
293 | dotnet_diagnostic.SA1014.severity = error
294 | dotnet_diagnostic.SA1015.severity = error
295 | dotnet_diagnostic.SA1016.severity = error
296 | dotnet_diagnostic.SA1017.severity = error
297 | dotnet_diagnostic.SA1018.severity = error
298 | dotnet_diagnostic.SA1019.severity = error
299 | dotnet_diagnostic.SA1020.severity = error
300 | dotnet_diagnostic.SA1021.severity = error
301 | dotnet_diagnostic.SA1022.severity = error
302 | dotnet_diagnostic.SA1023.severity = error
303 | dotnet_diagnostic.SA1024.severity = error
304 | dotnet_diagnostic.SA1025.severity = error
305 | dotnet_diagnostic.SA1026.severity = error
306 | dotnet_diagnostic.SA1027.severity = error
307 | dotnet_diagnostic.SA1028.severity = error
308 | dotnet_diagnostic.SA1100.severity = error
309 | dotnet_diagnostic.SA1101.severity = silent
310 | dotnet_diagnostic.SA1102.severity = error
311 | dotnet_diagnostic.SA1103.severity = error
312 | dotnet_diagnostic.SA1104.severity = error
313 | dotnet_diagnostic.SA1105.severity = error
314 | dotnet_diagnostic.SA1106.severity = error
315 | dotnet_diagnostic.SA1107.severity = error
316 | dotnet_diagnostic.SA1108.severity = error
317 | dotnet_diagnostic.SA1110.severity = error
318 | dotnet_diagnostic.SA1111.severity = error
319 | dotnet_diagnostic.SA1112.severity = error
320 | dotnet_diagnostic.SA1113.severity = error
321 | dotnet_diagnostic.SA1114.severity = error
322 | dotnet_diagnostic.SA1115.severity = error
323 | dotnet_diagnostic.SA1116.severity = error
324 | dotnet_diagnostic.SA1117.severity = suggestion
325 | dotnet_diagnostic.SA1118.severity = error
326 | dotnet_diagnostic.SA1119.severity = error
327 | dotnet_diagnostic.SA1120.severity = error
328 | dotnet_diagnostic.SA1121.severity = error
329 | dotnet_diagnostic.SA1122.severity = error
330 | dotnet_diagnostic.SA1123.severity = error
331 | dotnet_diagnostic.SA1124.severity = error
332 | dotnet_diagnostic.SA1125.severity = error
333 | dotnet_diagnostic.SA1127.severity = error
334 | dotnet_diagnostic.SA1128.severity = error
335 | dotnet_diagnostic.SA1129.severity = error
336 | dotnet_diagnostic.SA1130.severity = error
337 | dotnet_diagnostic.SA1131.severity = error
338 | dotnet_diagnostic.SA1132.severity = suggestion
339 | dotnet_diagnostic.SA1133.severity = error
340 | dotnet_diagnostic.SA1134.severity = error
341 | dotnet_diagnostic.SA1135.severity = error
342 | dotnet_diagnostic.SA1136.severity = error
343 | dotnet_diagnostic.SA1137.severity = error
344 | dotnet_diagnostic.SA1139.severity = error
345 | dotnet_diagnostic.SA1200.severity = none
346 | dotnet_diagnostic.SA1201.severity = suggestion
347 | dotnet_diagnostic.SA1202.severity = suggestion
348 | dotnet_diagnostic.SA1203.severity = error
349 | dotnet_diagnostic.SA1204.severity = suggestion
350 | dotnet_diagnostic.SA1205.severity = error
351 | dotnet_diagnostic.SA1206.severity = error
352 | dotnet_diagnostic.SA1207.severity = error
353 | dotnet_diagnostic.SA1208.severity = error
354 | dotnet_diagnostic.SA1209.severity = error
355 | dotnet_diagnostic.SA1210.severity = error
356 | dotnet_diagnostic.SA1211.severity = error
357 | dotnet_diagnostic.SA1212.severity = error
358 | dotnet_diagnostic.SA1213.severity = error
359 | dotnet_diagnostic.SA1214.severity = error
360 | dotnet_diagnostic.SA1216.severity = error
361 | dotnet_diagnostic.SA1217.severity = error
362 | dotnet_diagnostic.SA1300.severity = suggestion
363 | dotnet_diagnostic.SA1302.severity = error
364 | dotnet_diagnostic.SA1303.severity = error
365 | dotnet_diagnostic.SA1304.severity = error
366 | dotnet_diagnostic.SA1306.severity = none
367 | dotnet_diagnostic.SA1307.severity = error
368 | dotnet_diagnostic.SA1308.severity = error
369 | dotnet_diagnostic.SA1309.severity = none
370 | dotnet_diagnostic.SA1310.severity = error
371 | dotnet_diagnostic.SA1311.severity = none
372 | dotnet_diagnostic.SA1312.severity = error
373 | dotnet_diagnostic.SA1313.severity = error
374 | dotnet_diagnostic.SA1314.severity = error
375 | dotnet_diagnostic.SA1316.severity = none
376 | dotnet_diagnostic.SA1400.severity = error
377 | dotnet_diagnostic.SA1401.severity = suggestion
378 | dotnet_diagnostic.SA1402.severity = suggestion
379 | dotnet_diagnostic.SA1403.severity = error
380 | dotnet_diagnostic.SA1404.severity = error
381 | dotnet_diagnostic.SA1405.severity = error
382 | dotnet_diagnostic.SA1406.severity = error
383 | dotnet_diagnostic.SA1407.severity = error
384 | dotnet_diagnostic.SA1408.severity = error
385 | dotnet_diagnostic.SA1410.severity = error
386 | dotnet_diagnostic.SA1411.severity = error
387 | dotnet_diagnostic.SA1413.severity = error
388 | dotnet_diagnostic.SA1500.severity = error
389 | dotnet_diagnostic.SA1501.severity = error
390 | dotnet_diagnostic.SA1502.severity = error
391 | dotnet_diagnostic.SA1503.severity = error
392 | dotnet_diagnostic.SA1504.severity = error
393 | dotnet_diagnostic.SA1505.severity = error
394 | dotnet_diagnostic.SA1506.severity = error
395 | dotnet_diagnostic.SA1507.severity = error
396 | dotnet_diagnostic.SA1508.severity = error
397 | dotnet_diagnostic.SA1509.severity = error
398 | dotnet_diagnostic.SA1510.severity = error
399 | dotnet_diagnostic.SA1511.severity = error
400 | dotnet_diagnostic.SA1512.severity = error
401 | dotnet_diagnostic.SA1513.severity = error
402 | dotnet_diagnostic.SA1514.severity = error
403 | dotnet_diagnostic.SA1515.severity = error
404 | dotnet_diagnostic.SA1516.severity = error
405 | dotnet_diagnostic.SA1517.severity = error
406 | dotnet_diagnostic.SA1518.severity = error
407 | dotnet_diagnostic.SA1519.severity = error
408 | dotnet_diagnostic.SA1520.severity = error
409 | dotnet_diagnostic.SA1600.severity = suggestion
410 | dotnet_diagnostic.SA1601.severity = error
411 | dotnet_diagnostic.SA1602.severity = error
412 | dotnet_diagnostic.SA1604.severity = error
413 | dotnet_diagnostic.SA1605.severity = error
414 | dotnet_diagnostic.SA1606.severity = error
415 | dotnet_diagnostic.SA1607.severity = error
416 | dotnet_diagnostic.SA1608.severity = error
417 | dotnet_diagnostic.SA1610.severity = error
418 | dotnet_diagnostic.SA1611.severity = error
419 | dotnet_diagnostic.SA1612.severity = error
420 | dotnet_diagnostic.SA1613.severity = error
421 | dotnet_diagnostic.SA1614.severity = error
422 | dotnet_diagnostic.SA1615.severity = error
423 | dotnet_diagnostic.SA1616.severity = error
424 | dotnet_diagnostic.SA1617.severity = error
425 | dotnet_diagnostic.SA1618.severity = error
426 | dotnet_diagnostic.SA1619.severity = error
427 | dotnet_diagnostic.SA1620.severity = error
428 | dotnet_diagnostic.SA1621.severity = error
429 | dotnet_diagnostic.SA1622.severity = error
430 | dotnet_diagnostic.SA1623.severity = error
431 | dotnet_diagnostic.SA1624.severity = error
432 | dotnet_diagnostic.SA1625.severity = error
433 | dotnet_diagnostic.SA1626.severity = error
434 | dotnet_diagnostic.SA1627.severity = error
435 | dotnet_diagnostic.SA1629.severity = error
436 | dotnet_diagnostic.SA1633.severity = none
437 | dotnet_diagnostic.SA1634.severity = error
438 | dotnet_diagnostic.SA1635.severity = error
439 | dotnet_diagnostic.SA1636.severity = none
440 | dotnet_diagnostic.SA1637.severity = none
441 | dotnet_diagnostic.SA1638.severity = none
442 | dotnet_diagnostic.SA1640.severity = error
443 | dotnet_diagnostic.SA1641.severity = error
444 | dotnet_diagnostic.SA1642.severity = error
445 | dotnet_diagnostic.SA1643.severity = error
446 | dotnet_diagnostic.SA1649.severity = warning
447 | dotnet_diagnostic.SA1651.severity = error
448 |
449 | dotnet_diagnostic.SX1101.severity = none
450 | dotnet_diagnostic.SX1309.severity = error
451 | dotnet_diagnostic.SX1623.severity = none
452 |
453 | # C++ Files
454 | [*.{cpp,h,in}]
455 | curly_bracket_next_line = true
456 | indent_brace_style = Allman
457 |
458 | # Xml project files
459 | [*.{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
460 | indent_size = 2
461 |
462 | # Xml build files
463 | [*.builds]
464 | indent_size = 2
465 |
466 | # Xml files
467 | [*.{xml,stylecop,resx,ruleset}]
468 | indent_size = 2
469 |
470 | # Xml config files
471 | [*.{props,targets,config,nuspec}]
472 | indent_size = 2
473 |
474 | # Shell scripts
475 | [*.sh]
476 | end_of_line = lf
477 | [*.{cmd, bat}]
478 | end_of_line = crlf
479 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Set the default behavior, in case people don't have core.autocrlf set.
2 | * text=auto
3 |
4 | # Explicitly declare text files you want to always be normalized and converted
5 | # to native line endings on checkout.
6 | *.cs text
7 |
8 | # Declare files that will always have CRLF line endings on checkout.
9 | *.sln text eol=crlf
--------------------------------------------------------------------------------
/.github/workflows/nuget.yml:
--------------------------------------------------------------------------------
1 | # This workflow will build a .NET project
2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3 |
4 | name: .NET
5 |
6 | on:
7 | push:
8 | tags:
9 | - "v**"
10 |
11 | jobs:
12 | build:
13 | runs-on: macos-latest
14 |
15 | steps:
16 | - uses: actions/checkout@v3
17 | - uses: actions/setup-dotnet@v3
18 | with:
19 | dotnet-version: "8.x"
20 | source-url: https://nuget.pkg.github.com/theeightbot/index.json
21 | env:
22 | NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
23 |
24 | - name: Install MAUI Workloads
25 | run: dotnet workload install maui --ignore-failed-sources
26 |
27 | - name: Semver Parse
28 | id: version
29 | uses: release-kit/semver@v1.0.10
30 |
31 | - name: Build
32 | run: dotnet build WhatIsThisSheet/WhatIsThisSheet.csproj
33 |
34 | - name: Create the package
35 | run: dotnet pack --configuration Release /p:AssemblyVersion=${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }} /p:Version=${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}.${{ steps.version.outputs.patch }} WhatIsThisSheet/WhatIsThisSheet.csproj
36 |
37 | - name: Publish the package to GPR
38 | run: dotnet nuget push WhatIsThisSheet/bin/Release/*.nupkg
39 |
40 | - name: Publish the package to NuGet
41 | run: dotnet nuget push WhatIsThisSheet/bin/Release/*.nupkg --api-key "${{ secrets.EIGHTBOT_NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json
42 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Ll]og/
33 | [Ll]ogs/
34 |
35 | # Visual Studio 2015/2017 cache/options directory
36 | .vs/
37 | # Uncomment if you have tasks that create the project's static files in wwwroot
38 | #wwwroot/
39 |
40 | # Visual Studio 2017 auto generated files
41 | Generated\ Files/
42 |
43 | # MSTest test Results
44 | [Tt]est[Rr]esult*/
45 | [Bb]uild[Ll]og.*
46 |
47 | # NUnit
48 | *.VisualState.xml
49 | TestResult.xml
50 | nunit-*.xml
51 |
52 | # Build Results of an ATL Project
53 | [Dd]ebugPS/
54 | [Rr]eleasePS/
55 | dlldata.c
56 |
57 | # Benchmark Results
58 | BenchmarkDotNet.Artifacts/
59 |
60 | # .NET Core
61 | project.lock.json
62 | project.fragment.lock.json
63 | artifacts/
64 |
65 | # ASP.NET Scaffolding
66 | ScaffoldingReadMe.txt
67 |
68 | # StyleCop
69 | StyleCopReport.xml
70 |
71 | # Files built by Visual Studio
72 | *_i.c
73 | *_p.c
74 | *_h.h
75 | *.ilk
76 | *.meta
77 | *.obj
78 | *.iobj
79 | *.pch
80 | *.pdb
81 | *.ipdb
82 | *.pgc
83 | *.pgd
84 | *.rsp
85 | *.sbr
86 | *.tlb
87 | *.tli
88 | *.tlh
89 | *.tmp
90 | *.tmp_proj
91 | *_wpftmp.csproj
92 | *.log
93 | *.tlog
94 | *.vspscc
95 | *.vssscc
96 | .builds
97 | *.pidb
98 | *.svclog
99 | *.scc
100 |
101 | # Chutzpah Test files
102 | _Chutzpah*
103 |
104 | # Visual C++ cache files
105 | ipch/
106 | *.aps
107 | *.ncb
108 | *.opendb
109 | *.opensdf
110 | *.sdf
111 | *.cachefile
112 | *.VC.db
113 | *.VC.VC.opendb
114 |
115 | # Visual Studio profiler
116 | *.psess
117 | *.vsp
118 | *.vspx
119 | *.sap
120 |
121 | # Visual Studio Trace Files
122 | *.e2e
123 |
124 | # TFS 2012 Local Workspace
125 | $tf/
126 |
127 | # Guidance Automation Toolkit
128 | *.gpState
129 |
130 | # ReSharper is a .NET coding add-in
131 | _ReSharper*/
132 | *.[Rr]e[Ss]harper
133 | *.DotSettings.user
134 |
135 | # TeamCity is a build add-in
136 | _TeamCity*
137 |
138 | # DotCover is a Code Coverage Tool
139 | *.dotCover
140 |
141 | # AxoCover is a Code Coverage Tool
142 | .axoCover/*
143 | !.axoCover/settings.json
144 |
145 | # Coverlet is a free, cross platform Code Coverage Tool
146 | coverage*.json
147 | coverage*.xml
148 | coverage*.info
149 |
150 | # Visual Studio code coverage results
151 | *.coverage
152 | *.coveragexml
153 |
154 | # NCrunch
155 | _NCrunch_*
156 | .*crunch*.local.xml
157 | nCrunchTemp_*
158 |
159 | # MightyMoose
160 | *.mm.*
161 | AutoTest.Net/
162 |
163 | # Web workbench (sass)
164 | .sass-cache/
165 |
166 | # Installshield output folder
167 | [Ee]xpress/
168 |
169 | # DocProject is a documentation generator add-in
170 | DocProject/buildhelp/
171 | DocProject/Help/*.HxT
172 | DocProject/Help/*.HxC
173 | DocProject/Help/*.hhc
174 | DocProject/Help/*.hhk
175 | DocProject/Help/*.hhp
176 | DocProject/Help/Html2
177 | DocProject/Help/html
178 |
179 | # Click-Once directory
180 | publish/
181 |
182 | # Publish Web Output
183 | *.[Pp]ublish.xml
184 | *.azurePubxml
185 | # Note: Comment the next line if you want to checkin your web deploy settings,
186 | # but database connection strings (with potential passwords) will be unencrypted
187 | *.pubxml
188 | *.publishproj
189 |
190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
191 | # checkin your Azure Web App publish settings, but sensitive information contained
192 | # in these scripts will be unencrypted
193 | PublishScripts/
194 |
195 | # NuGet Packages
196 | *.nupkg
197 | # NuGet Symbol Packages
198 | *.snupkg
199 | # The packages folder can be ignored because of Package Restore
200 | **/[Pp]ackages/*
201 | # except build/, which is used as an MSBuild target.
202 | !**/[Pp]ackages/build/
203 | # Uncomment if necessary however generally it will be regenerated when needed
204 | #!**/[Pp]ackages/repositories.config
205 | # NuGet v3's project.json files produces more ignorable files
206 | *.nuget.props
207 | *.nuget.targets
208 |
209 | # Microsoft Azure Build Output
210 | csx/
211 | *.build.csdef
212 |
213 | # Microsoft Azure Emulator
214 | ecf/
215 | rcf/
216 |
217 | # Windows Store app package directories and files
218 | AppPackages/
219 | BundleArtifacts/
220 | Package.StoreAssociation.xml
221 | _pkginfo.txt
222 | *.appx
223 | *.appxbundle
224 | *.appxupload
225 |
226 | # Visual Studio cache files
227 | # files ending in .cache can be ignored
228 | *.[Cc]ache
229 | # but keep track of directories ending in .cache
230 | !?*.[Cc]ache/
231 |
232 | # Others
233 | ClientBin/
234 | ~$*
235 | *~
236 | *.dbmdl
237 | *.dbproj.schemaview
238 | *.jfm
239 | *.pfx
240 | *.publishsettings
241 | orleans.codegen.cs
242 |
243 | # Including strong name files can present a security risk
244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
245 | #*.snk
246 |
247 | # Since there are multiple workflows, uncomment next line to ignore bower_components
248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
249 | #bower_components/
250 |
251 | # RIA/Silverlight projects
252 | Generated_Code/
253 |
254 | # Backup & report files from converting an old project file
255 | # to a newer Visual Studio version. Backup files are not needed,
256 | # because we have git ;-)
257 | _UpgradeReport_Files/
258 | Backup*/
259 | UpgradeLog*.XML
260 | UpgradeLog*.htm
261 | ServiceFabricBackup/
262 | *.rptproj.bak
263 |
264 | # SQL Server files
265 | *.mdf
266 | *.ldf
267 | *.ndf
268 |
269 | # Business Intelligence projects
270 | *.rdl.data
271 | *.bim.layout
272 | *.bim_*.settings
273 | *.rptproj.rsuser
274 | *- [Bb]ackup.rdl
275 | *- [Bb]ackup ([0-9]).rdl
276 | *- [Bb]ackup ([0-9][0-9]).rdl
277 |
278 | # Microsoft Fakes
279 | FakesAssemblies/
280 |
281 | # GhostDoc plugin setting file
282 | *.GhostDoc.xml
283 |
284 | # Node.js Tools for Visual Studio
285 | .ntvs_analysis.dat
286 | node_modules/
287 |
288 | # Visual Studio 6 build log
289 | *.plg
290 |
291 | # Visual Studio 6 workspace options file
292 | *.opt
293 |
294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
295 | *.vbw
296 |
297 | # Visual Studio 6 auto-generated project file (contains which files were open etc.)
298 | *.vbp
299 |
300 | # Visual Studio 6 workspace and project file (working project files containing files to include in project)
301 | *.dsw
302 | *.dsp
303 |
304 | # Visual Studio 6 technical files
305 | *.ncb
306 | *.aps
307 |
308 | # Visual Studio LightSwitch build output
309 | **/*.HTMLClient/GeneratedArtifacts
310 | **/*.DesktopClient/GeneratedArtifacts
311 | **/*.DesktopClient/ModelManifest.xml
312 | **/*.Server/GeneratedArtifacts
313 | **/*.Server/ModelManifest.xml
314 | _Pvt_Extensions
315 |
316 | # Paket dependency manager
317 | .paket/paket.exe
318 | paket-files/
319 |
320 | # FAKE - F# Make
321 | .fake/
322 |
323 | # CodeRush personal settings
324 | .cr/personal
325 |
326 | # Python Tools for Visual Studio (PTVS)
327 | __pycache__/
328 | *.pyc
329 |
330 | # Cake - Uncomment if you are using it
331 | # tools/**
332 | # !tools/packages.config
333 |
334 | # Tabs Studio
335 | *.tss
336 |
337 | # Telerik's JustMock configuration file
338 | *.jmconfig
339 |
340 | # BizTalk build output
341 | *.btp.cs
342 | *.btm.cs
343 | *.odx.cs
344 | *.xsd.cs
345 |
346 | # OpenCover UI analysis results
347 | OpenCover/
348 |
349 | # Azure Stream Analytics local run output
350 | ASALocalRun/
351 |
352 | # MSBuild Binary and Structured Log
353 | *.binlog
354 |
355 | # NVidia Nsight GPU debugger configuration file
356 | *.nvuser
357 |
358 | # MFractors (Xamarin productivity tool) working folder
359 | .mfractor/
360 |
361 | # Local History for Visual Studio
362 | .localhistory/
363 |
364 | # Visual Studio History (VSHistory) files
365 | .vshistory/
366 |
367 | # BeatPulse healthcheck temp database
368 | healthchecksdb
369 |
370 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
371 | MigrationBackup/
372 |
373 | # Ionide (cross platform F# VS Code tools) working folder
374 | .ionide/
375 |
376 | # Fody - auto-generated XML schema
377 | FodyWeavers.xsd
378 |
379 | # VS Code files for those working on multiple tools
380 | .vscode/*
381 | !.vscode/settings.json
382 | !.vscode/tasks.json
383 | !.vscode/launch.json
384 | !.vscode/extensions.json
385 | *.code-workspace
386 |
387 | # Local History for Visual Studio Code
388 | .history/
389 |
390 | # Windows Installer files from build outputs
391 | *.cab
392 | *.msi
393 | *.msix
394 | *.msm
395 | *.msp
396 |
397 | # JetBrains Rider
398 | *.sln.iml
399 |
400 | *.DS_Store
401 |
402 | .idea/
403 |
404 | *.meteor/
405 |
--------------------------------------------------------------------------------
/Directory.build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 | latest
5 | $(NoWarn);CS1591
6 |
7 |
8 | https://eight.bot
9 | https://github.com/TheEightBot/WhatIsThisSheet
10 | git
11 | .NET MAUI;Bottom Sheet;Navigation;Component;UI Control;Eight-Bot
12 | The .NET MAUI Bottom Sheet component is a user interface element that slides up from the bottom of the screen to reveal more content. It's a versatile component that can be used for various purposes such as displaying additional information, presenting a list of options, or providing a secondary navigation.
13 | logo.png
14 |
15 |
16 |
19 |
22 |
25 |
26 |
27 |
30 |
31 |
32 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Eight-Bot
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # WhatIsThisSheet - .NET MAUI Bottom Sheet Component
2 |
3 | The .NET MAUI Bottom Sheet component is a user interface element that slides up from the bottom of the screen to reveal more content. It's a versatile component that can be used for various purposes such as displaying additional information, presenting a list of options, or providing a secondary navigation.
4 |
5 | 
6 |
7 |
8 | ## Features
9 |
10 | - **Sliding Panel:** The bottom sheet slides up and down, providing a smooth user experience.
11 | - **Customizable Content:** You can customize the content of the bottom sheet according to your needs.
12 | - **Gesture Support:** The bottom sheet supports user gestures, allowing users to drag it up or down.
13 | - **Partial and Full Expansion:** The bottom sheet can be expanded partially or fully based on the content size or user interaction.
14 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/App.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace MauiDrawer.Sample;
2 |
3 | public partial class App : Application
4 | {
5 | public App()
6 | {
7 | InitializeComponent();
8 |
9 | MainPage = new AppShell();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/AppShell.xaml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/AppShell.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace MauiDrawer.Sample;
2 |
3 | public partial class AppShell : Shell
4 | {
5 | public AppShell()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
20 |
21 |
25 |
26 |
30 |
31 |
35 |
36 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace MauiDrawer.Sample;
2 |
3 | public partial class MainPage : ContentPage
4 | {
5 | private readonly int _count = 0;
6 |
7 | public MainPage()
8 | {
9 | InitializeComponent();
10 | }
11 |
12 | private int _incrementer = 0;
13 |
14 | private void Button_Clicked(object sender, System.EventArgs e)
15 | {
16 | _incrementer++;
17 | (sender as Button).Text = $"Tapped {_incrementer} Times";
18 | }
19 |
20 | private void Dismiss_Clicked(object sender, System.EventArgs e)
21 | {
22 | MainBottomSheet.Dismiss();
23 | }
24 |
25 | private void Switch_Toggled(object sender, Microsoft.Maui.Controls.ToggledEventArgs e)
26 | {
27 | MainBottomSheet.AllowFullDismiss = !MainBottomSheet.AllowFullDismiss;
28 | }
29 |
30 | private void Show_Clicked(object sender, System.EventArgs e)
31 | {
32 | MainBottomSheet.Show(.65d);
33 | }
34 |
35 | private void GetTapped_Clicked(object sender, System.EventArgs e)
36 | {
37 | Console.WriteLine("Tapped Out!");
38 | }
39 |
40 | private void ToggleBackgroundInteraction_Clicked(object sender, System.EventArgs e)
41 | {
42 | MainBottomSheet.AllowBackgroundInteraction = !MainBottomSheet.AllowBackgroundInteraction;
43 | }
44 |
45 | private void LockPosition_Clicked(object sender, System.EventArgs e)
46 | {
47 | MainBottomSheet.LockPosition = !MainBottomSheet.LockPosition;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/MauiProgram.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Extensions.Logging;
2 |
3 | namespace MauiDrawer.Sample;
4 |
5 | public static class MauiProgram
6 | {
7 | public static MauiApp CreateMauiApp()
8 | {
9 | var builder = MauiApp.CreateBuilder();
10 | builder
11 | .UseMauiApp()
12 | .ConfigureFonts(fonts =>
13 | {
14 | fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
15 | fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
16 | });
17 |
18 | #if DEBUG
19 | builder.Logging.AddDebug();
20 | #endif
21 |
22 | return builder.Build();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Platforms/Android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Platforms/Android/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Content.PM;
3 | using Android.OS;
4 |
5 | namespace MauiDrawer.Sample;
6 |
7 | [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
8 | public class MainActivity : MauiAppCompatActivity
9 | {
10 | }
11 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Platforms/Android/MainApplication.cs:
--------------------------------------------------------------------------------
1 | using Android.App;
2 | using Android.Runtime;
3 |
4 | namespace MauiDrawer.Sample;
5 |
6 | [Application]
7 | public class MainApplication : MauiApplication
8 | {
9 | public MainApplication(IntPtr handle, JniHandleOwnership ownership)
10 | : base(handle, ownership)
11 | {
12 | }
13 |
14 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
15 | }
16 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Platforms/Android/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #512BD4
4 | #2B0B98
5 | #2B0B98
6 |
7 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Platforms/MacCatalyst/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using Foundation;
2 |
3 | namespace MauiDrawer.Sample;
4 |
5 | [Register("AppDelegate")]
6 | public class AppDelegate : MauiUIApplicationDelegate
7 | {
8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
9 | }
10 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Platforms/MacCatalyst/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | com.apple.security.app-sandbox
8 |
9 |
10 | com.apple.security.network.client
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Platforms/MacCatalyst/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | UIDeviceFamily
15 |
16 | 2
17 |
18 | UIRequiredDeviceCapabilities
19 |
20 | arm64
21 |
22 | UISupportedInterfaceOrientations
23 |
24 | UIInterfaceOrientationPortrait
25 | UIInterfaceOrientationLandscapeLeft
26 | UIInterfaceOrientationLandscapeRight
27 |
28 | UISupportedInterfaceOrientations~ipad
29 |
30 | UIInterfaceOrientationPortrait
31 | UIInterfaceOrientationPortraitUpsideDown
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | XSAppIconAssets
36 | Assets.xcassets/appicon.appiconset
37 |
38 |
39 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Platforms/MacCatalyst/Program.cs:
--------------------------------------------------------------------------------
1 | using ObjCRuntime;
2 | using UIKit;
3 |
4 | namespace MauiDrawer.Sample;
5 |
6 | public static class Program
7 | {
8 | // This is the main entry point of the application.
9 | private static void Main(string[] args)
10 | {
11 | // if you want to use a different Application Delegate class from "AppDelegate"
12 | // you can specify it here.
13 | UIApplication.Main(args, null, typeof(AppDelegate));
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Platforms/Tizen/Main.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.Maui;
3 | using Microsoft.Maui.Hosting;
4 |
5 | namespace MauiDrawer.Sample;
6 |
7 | class Program : MauiApplication
8 | {
9 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
10 |
11 | static void Main(string[] args)
12 | {
13 | var app = new Program();
14 | app.Run(args);
15 | }
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Platforms/Tizen/tizen-manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | maui-appicon-placeholder
7 |
8 |
9 |
10 |
11 | http://tizen.org/privilege/internet
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Platforms/Windows/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Platforms/Windows/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Xaml;
2 |
3 | // To learn more about WinUI, the WinUI project structure,
4 | // and more about our project templates, see: http://aka.ms/winui-project-info.
5 |
6 | namespace MauiDrawer.Sample.WinUI;
7 |
8 | ///
9 | /// Provides application-specific behavior to supplement the default Application class.
10 | ///
11 | public partial class App : MauiWinUIApplication
12 | {
13 | ///
14 | /// Initializes the singleton application object. This is the first line of authored code
15 | /// executed, and as such is the logical equivalent of main() or WinMain().
16 | ///
17 | public App()
18 | {
19 | this.InitializeComponent();
20 | }
21 |
22 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
23 | }
24 |
25 |
26 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Platforms/Windows/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | $placeholder$
15 | User Name
16 | $placeholder$.png
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Platforms/Windows/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 | true/PM
12 | PerMonitorV2, PerMonitor
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Platforms/iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using Foundation;
2 |
3 | namespace MauiDrawer.Sample;
4 |
5 | [Register("AppDelegate")]
6 | public class AppDelegate : MauiUIApplicationDelegate
7 | {
8 | protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
9 | }
10 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Platforms/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | LSRequiresIPhoneOS
6 |
7 | UIDeviceFamily
8 |
9 | 1
10 | 2
11 |
12 | UIRequiredDeviceCapabilities
13 |
14 | arm64
15 |
16 | UISupportedInterfaceOrientations
17 |
18 | UIInterfaceOrientationPortrait
19 | UIInterfaceOrientationLandscapeLeft
20 | UIInterfaceOrientationLandscapeRight
21 |
22 | UISupportedInterfaceOrientations~ipad
23 |
24 | UIInterfaceOrientationPortrait
25 | UIInterfaceOrientationPortraitUpsideDown
26 | UIInterfaceOrientationLandscapeLeft
27 | UIInterfaceOrientationLandscapeRight
28 |
29 | XSAppIconAssets
30 | Assets.xcassets/appicon.appiconset
31 |
32 |
33 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Platforms/iOS/Program.cs:
--------------------------------------------------------------------------------
1 | using ObjCRuntime;
2 | using UIKit;
3 |
4 | namespace MauiDrawer.Sample;
5 |
6 | public static class Program
7 | {
8 | // This is the main entry point of the application.
9 | private static void Main(string[] args)
10 | {
11 | // if you want to use a different Application Delegate class from "AppDelegate"
12 | // you can specify it here.
13 | UIApplication.Main(args, null, typeof(AppDelegate));
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "Windows Machine": {
4 | "commandName": "MsixPackage",
5 | "nativeDebugging": false
6 | }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Resources/AppIcon/appicon.svg:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Resources/AppIcon/appiconfg.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Resources/Fonts/OpenSans-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheEightBot/WhatIsThisSheet/99f5e1bd67df490ba870100e25d618bb5945df20/WhatIsThisSheet.Sample/Resources/Fonts/OpenSans-Regular.ttf
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Resources/Fonts/OpenSans-Semibold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheEightBot/WhatIsThisSheet/99f5e1bd67df490ba870100e25d618bb5945df20/WhatIsThisSheet.Sample/Resources/Fonts/OpenSans-Semibold.ttf
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Resources/Images/dotnet_bot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheEightBot/WhatIsThisSheet/99f5e1bd67df490ba870100e25d618bb5945df20/WhatIsThisSheet.Sample/Resources/Images/dotnet_bot.png
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Resources/Raw/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories). Deployment of the asset to your application
3 | is automatically handled by the following `MauiAsset` Build Action within your `.csproj`.
4 |
5 |
6 |
7 | These files will be deployed with you package and will be accessible using Essentials:
8 |
9 | async Task LoadMauiAsset()
10 | {
11 | using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt");
12 | using var reader = new StreamReader(stream);
13 |
14 | var contents = reader.ReadToEnd();
15 | }
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Resources/Splash/splash.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Resources/Styles/Colors.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 | #512BD4
10 | #ac99ea
11 | #242424
12 | #DFD8F7
13 | #9880e5
14 | #2B0B98
15 |
16 | White
17 | Black
18 | #D600AA
19 | #190649
20 | #1f1f1f
21 |
22 | #E1E1E1
23 | #C8C8C8
24 | #ACACAC
25 | #919191
26 | #6E6E6E
27 | #404040
28 | #212121
29 | #141414
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/Resources/Styles/Styles.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
10 |
11 |
15 |
16 |
21 |
22 |
25 |
26 |
51 |
52 |
69 |
70 |
90 |
91 |
112 |
113 |
134 |
135 |
140 |
141 |
162 |
163 |
181 |
182 |
185 |
186 |
192 |
193 |
199 |
200 |
204 |
205 |
227 |
228 |
243 |
244 |
264 |
265 |
268 |
269 |
292 |
293 |
313 |
314 |
320 |
321 |
340 |
341 |
344 |
345 |
373 |
374 |
394 |
395 |
399 |
400 |
412 |
413 |
418 |
419 |
425 |
426 |
427 |
428 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.Sample/WhatIsThisSheet.Sample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0-android;net8.0-ios;net8.0-maccatalyst
5 | $(TargetFrameworks);net8.0-windows10.0.19041.0
6 |
7 |
8 |
9 |
14 |
15 |
16 | Exe
17 | MauiDrawer.Sample
18 | true
19 | true
20 | enable
21 | enable
22 |
23 |
24 | MauiDrawer.Sample
25 |
26 |
27 | com.companyname.mauidrawer.sample
28 |
29 |
30 | 1.0
31 | 1
32 |
33 | 11.0
34 | 13.1
35 | 21.0
36 | 10.0.17763.0
37 | 10.0.17763.0
38 | 6.5
39 |
40 |
41 |
42 | false
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 |
--------------------------------------------------------------------------------
/WhatIsThisSheet.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 25.0.1706.7
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WhatIsThisSheet", "WhatIsThisSheet\WhatIsThisSheet.csproj", "{C3ED6C8E-641F-4AD0-B090-816868DFC85A}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WhatIsThisSheet.Sample", "WhatIsThisSheet.Sample\WhatIsThisSheet.Sample.csproj", "{D1551D4C-6395-4FA9-A849-52D7110913BD}"
9 | EndProject
10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "[ Actions ]", "[ Actions ]", "{2BBE5391-A783-4CAB-80B6-5FEF32AF7663}"
11 | ProjectSection(SolutionItems) = preProject
12 | .github\workflows\nuget.yml = .github\workflows\nuget.yml
13 | EndProjectSection
14 | EndProject
15 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "[ Solution Items ]", "[ Solution Items ]", "{0FDCE5C6-6D4A-40E6-9C01-94EAC8AA0D97}"
16 | ProjectSection(SolutionItems) = preProject
17 | README.md = README.md
18 | .gitignore = .gitignore
19 | stylecop.json = stylecop.json
20 | global.json = global.json
21 | LICENSE = LICENSE
22 | Directory.build.props = Directory.build.props
23 | .gitattributes = .gitattributes
24 | .editorconfig = .editorconfig
25 | WhatIsThisSheet.sln = WhatIsThisSheet.sln
26 | EndProjectSection
27 | EndProject
28 | Global
29 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
30 | Debug|Any CPU = Debug|Any CPU
31 | Release|Any CPU = Release|Any CPU
32 | EndGlobalSection
33 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
34 | {C3ED6C8E-641F-4AD0-B090-816868DFC85A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
35 | {C3ED6C8E-641F-4AD0-B090-816868DFC85A}.Debug|Any CPU.Build.0 = Debug|Any CPU
36 | {C3ED6C8E-641F-4AD0-B090-816868DFC85A}.Release|Any CPU.ActiveCfg = Release|Any CPU
37 | {C3ED6C8E-641F-4AD0-B090-816868DFC85A}.Release|Any CPU.Build.0 = Release|Any CPU
38 | {D1551D4C-6395-4FA9-A849-52D7110913BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
39 | {D1551D4C-6395-4FA9-A849-52D7110913BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
40 | {D1551D4C-6395-4FA9-A849-52D7110913BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
41 | {D1551D4C-6395-4FA9-A849-52D7110913BD}.Release|Any CPU.Build.0 = Release|Any CPU
42 | EndGlobalSection
43 | GlobalSection(SolutionProperties) = preSolution
44 | HideSolutionNode = FALSE
45 | EndGlobalSection
46 | GlobalSection(ExtensibilityGlobals) = postSolution
47 | SolutionGuid = {E3F910E2-2904-4059-9369-543EAFBB01AE}
48 | EndGlobalSection
49 | EndGlobal
50 |
--------------------------------------------------------------------------------
/WhatIsThisSheet/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | [assembly: XmlnsDefinition("http://what.is.this.sheet/schemas/controls", $"{nameof(WhatIsThisSheet)}")]
2 |
--------------------------------------------------------------------------------
/WhatIsThisSheet/BottomSheet.cs:
--------------------------------------------------------------------------------
1 | using System.Security.Cryptography.X509Certificates;
2 | using Microsoft.Maui.Controls.PlatformConfiguration;
3 | using Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;
4 | using Microsoft.Maui.Controls.Shapes;
5 | using Page = Microsoft.Maui.Controls.Page;
6 |
7 | namespace WhatIsThisSheet;
8 |
9 | [ContentProperty(nameof(SheetContent))]
10 | public class BottomSheet : Grid
11 | {
12 | private readonly TapGestureRecognizer _backgroundInteractionTapGesture = new();
13 |
14 | private readonly Grid _contentContainer;
15 |
16 | private readonly Shape _grabbler;
17 |
18 | private readonly Border _mainContainer;
19 |
20 | private readonly double _touchBarHeight = 32d;
21 |
22 | private readonly BoxView _touchOverlay;
23 |
24 | private readonly PanGestureRecognizer _touchOverlayPanGesture;
25 |
26 | private bool _hasInitialHeight;
27 |
28 | private double _sheetStartingTranslationY;
29 |
30 | public static BindableProperty LockPositionProperty =
31 | BindableProperty.Create(nameof(LockPosition), typeof(bool), typeof(BottomSheet), default(bool));
32 |
33 | public static BindableProperty SheetStopsProperty =
34 | BindableProperty.Create(
35 | nameof(SheetStops),
36 | typeof(List),
37 | typeof(BottomSheet),
38 | defaultValueCreator: _ => new List());
39 |
40 | public static BindableProperty SheetContentProperty =
41 | BindableProperty.Create(
42 | nameof(SheetContent),
43 | typeof(View),
44 | typeof(BottomSheet),
45 | propertyChanged:
46 | (bindable, oldValue, newValue) =>
47 | {
48 | if (bindable is not BottomSheet sheet)
49 | {
50 | return;
51 | }
52 |
53 | if (oldValue is View oldView)
54 | {
55 | sheet._contentContainer.Remove(oldView);
56 | }
57 |
58 | if (newValue is View newView)
59 | {
60 | SetColumn(newView, 0);
61 | SetRow(newView, 1);
62 | sheet._contentContainer.Add(newView);
63 | }
64 | });
65 |
66 | public static BindableProperty AllowFullDismissProperty =
67 | BindableProperty.Create(nameof(AllowFullDismiss), typeof(bool), typeof(BottomSheet), false);
68 |
69 | public static BindableProperty StartExpandedProperty =
70 | BindableProperty.Create(nameof(StartExpanded), typeof(bool), typeof(BottomSheet), true);
71 |
72 | public static BindableProperty AllowBackgroundInteractionProperty =
73 | BindableProperty.Create(
74 | nameof(AllowBackgroundInteraction),
75 | typeof(bool),
76 | typeof(BottomSheet),
77 | true,
78 | propertyChanged:
79 | (bindable, _, newValue) =>
80 | {
81 | if (bindable is not BottomSheet bs || newValue is not bool newBool)
82 | {
83 | return;
84 | }
85 |
86 | bs.GestureRecognizers.Clear();
87 |
88 | bs.InputTransparent = newBool;
89 |
90 | if (newBool)
91 | {
92 | return;
93 | }
94 |
95 | bs.GestureRecognizers.Add(bs._backgroundInteractionTapGesture);
96 | });
97 |
98 | public static BindableProperty SheetColorProperty =
99 | BindableProperty.Create(
100 | nameof(SheetColor),
101 | typeof(Color),
102 | typeof(BottomSheet),
103 | Colors.White,
104 | propertyChanged:
105 | (bindable, _, newValue) =>
106 | {
107 | if (bindable is not BottomSheet sheet)
108 | {
109 | return;
110 | }
111 |
112 | if (newValue is Color newColor)
113 | {
114 | sheet._mainContainer.BackgroundColor = newColor;
115 | }
116 | });
117 |
118 | public bool LockPosition
119 | {
120 | get => (bool)this.GetValue(LockPositionProperty);
121 | set => this.SetValue(LockPositionProperty, value);
122 | }
123 |
124 | public List SheetStops
125 | {
126 | get => (List)this.GetValue(SheetStopsProperty);
127 | private set => this.SetValue(SheetStopsProperty, value);
128 | }
129 |
130 | public View SheetContent
131 | {
132 | get => (View)this.GetValue(SheetContentProperty);
133 | set => this.SetValue(SheetContentProperty, value);
134 | }
135 |
136 | public bool AllowFullDismiss
137 | {
138 | get => (bool)this.GetValue(AllowFullDismissProperty);
139 | set => this.SetValue(AllowFullDismissProperty, value);
140 | }
141 |
142 | public bool StartExpanded
143 | {
144 | get => (bool)this.GetValue(StartExpandedProperty);
145 | set => this.SetValue(StartExpandedProperty, value);
146 | }
147 |
148 | public bool AllowBackgroundInteraction
149 | {
150 | get => (bool)this.GetValue(AllowBackgroundInteractionProperty);
151 | set => this.SetValue(AllowBackgroundInteractionProperty, value);
152 | }
153 |
154 | public Color SheetColor
155 | {
156 | get => (Color)this.GetValue(SheetColorProperty);
157 | set => this.SetValue(SheetColorProperty, value);
158 | }
159 |
160 | public BottomSheet()
161 | {
162 | this.CascadeInputTransparent = false;
163 | this.IgnoreSafeArea = true;
164 | this.InputTransparent = this.AllowBackgroundInteraction;
165 |
166 | if (!this.AllowBackgroundInteraction)
167 | {
168 | this.GestureRecognizers.Add(this._backgroundInteractionTapGesture);
169 | }
170 |
171 | this._grabbler =
172 | new RoundRectangle
173 | {
174 | HeightRequest = 4,
175 | WidthRequest = this._touchBarHeight,
176 | CornerRadius = 2,
177 | BackgroundColor = Colors.DarkGray,
178 | HorizontalOptions = LayoutOptions.Center,
179 | };
180 |
181 | this._contentContainer =
182 | new Grid
183 | {
184 | ColumnDefinitions = { new ColumnDefinition(GridLength.Star) },
185 | RowDefinitions = { new RowDefinition(this._touchBarHeight), new RowDefinition(GridLength.Star) },
186 | };
187 |
188 | this._contentContainer.Add(this._grabbler, 0);
189 | Grid.SetColumn(this._grabbler, 0);
190 | Grid.SetRow(this._grabbler, 0);
191 |
192 | this._mainContainer =
193 | new Border
194 | {
195 | InputTransparent = false,
196 | GestureRecognizers =
197 | {
198 | // TODO: We shouldn't need this and should just be able to use input transparent
199 | new TapGestureRecognizer(),
200 | },
201 | StrokeShape = new RoundRectangle { CornerRadius = new CornerRadius(24, 24, 0, 0) },
202 | BackgroundColor = this.SheetColor,
203 | Content = this._contentContainer,
204 | Margin = -.5f,
205 | };
206 |
207 | this._touchOverlayPanGesture = new PanGestureRecognizer();
208 |
209 | this._touchOverlay =
210 | new BoxView
211 | {
212 | GestureRecognizers = { this._touchOverlayPanGesture },
213 | BackgroundColor = Colors.Transparent,
214 | HeightRequest = this._touchBarHeight,
215 | VerticalOptions = LayoutOptions.Start,
216 | };
217 |
218 | this.Children.Add(this._mainContainer);
219 | this.Children.Add(this._touchOverlay);
220 |
221 | this.Loaded += this.BottomSheet_Loaded;
222 | }
223 |
224 | protected override void OnPropertyChanged(string? propertyName = null)
225 | {
226 | base.OnPropertyChanged(propertyName);
227 |
228 | if (!(propertyName?.Equals(HeightProperty.PropertyName) ?? false))
229 | {
230 | return;
231 | }
232 |
233 | var height = this.Height;
234 |
235 | if (!this._hasInitialHeight && height > 0.0d)
236 | {
237 | this._hasInitialHeight = true;
238 |
239 | AnimateToPosition(StartExpanded ? 0.0d : height);
240 | }
241 | else
242 | {
243 | double currTranslationY = this._mainContainer.TranslationY;
244 | this.AnimateToPosition(currTranslationY);
245 | }
246 | }
247 |
248 | private void BottomSheet_Loaded(object? sender, EventArgs e)
249 | {
250 | this.Loaded -= this.BottomSheet_Loaded;
251 |
252 | this.Unloaded -= this.BottomSheet_Unloaded;
253 | this.Unloaded += this.BottomSheet_Unloaded;
254 |
255 | this._touchOverlayPanGesture.PanUpdated -= this._touchOverlayPanGesture_PanUpdated;
256 | this._touchOverlayPanGesture.PanUpdated += this._touchOverlayPanGesture_PanUpdated;
257 | }
258 |
259 | private void BottomSheet_Unloaded(object? sender, EventArgs e)
260 | {
261 | this.Unloaded -= this.BottomSheet_Unloaded;
262 |
263 | this._touchOverlayPanGesture.PanUpdated -= this._touchOverlayPanGesture_PanUpdated;
264 | }
265 |
266 | public void Dismiss()
267 | {
268 | if (this.LockPosition)
269 | {
270 | return;
271 | }
272 |
273 | this._touchOverlay.GestureRecognizers.Clear();
274 |
275 | double visibleHeight = this.Height;
276 |
277 | bool allowDismiss = this.AllowFullDismiss;
278 |
279 | double bottomSafeArea = allowDismiss ? this.ParentPage()?.On()?.SafeAreaInsets().Bottom ?? 0 : 0;
280 |
281 | double touchBarDisplayHeight = allowDismiss ? 0 : this._touchBarHeight;
282 |
283 | Animation dismissAnimation =
284 | new(
285 | x =>
286 | {
287 | this._mainContainer.TranslationY = x;
288 | this._mainContainer.Padding = new Thickness(
289 | this._mainContainer.Margin.Left,
290 | this._mainContainer.Margin.Top,
291 | this._mainContainer.Margin.Right,
292 | x);
293 | },
294 | this._mainContainer.TranslationY,
295 | visibleHeight + bottomSafeArea - touchBarDisplayHeight,
296 | Easing.SinInOut);
297 |
298 | dismissAnimation
299 | .Commit(
300 | this,
301 | nameof(this.Dismiss),
302 | finished:
303 | (_, __) =>
304 | {
305 | this.Dispatcher.Dispatch(
306 | () =>
307 | {
308 | this._touchOverlay.TranslationY = this._mainContainer.TranslationY;
309 | this._touchOverlay.GestureRecognizers.Add(this._touchOverlayPanGesture);
310 | });
311 | });
312 | }
313 |
314 | public void Show(double displayPercentage)
315 | {
316 | if (this.LockPosition)
317 | {
318 | return;
319 | }
320 |
321 | this._touchOverlay.GestureRecognizers.Clear();
322 |
323 | double visibleHeight = this.Height;
324 |
325 | bool allowDismiss = this.AllowFullDismiss;
326 |
327 | double touchBarDisplayHeight = allowDismiss ? 0 : this._touchBarHeight;
328 |
329 | Animation dismissAnimation =
330 | new(
331 | x =>
332 | {
333 | this._mainContainer.TranslationY = x;
334 | this._mainContainer.Padding = new Thickness(
335 | this._mainContainer.Margin.Left,
336 | this._mainContainer.Margin.Top,
337 | this._mainContainer.Margin.Right,
338 | x);
339 | },
340 | this._mainContainer.TranslationY,
341 | (visibleHeight * (1d - Math.Max(Math.Min(displayPercentage, 1.0d), 0d))) - touchBarDisplayHeight,
342 | Easing.SinInOut);
343 |
344 | dismissAnimation
345 | .Commit(
346 | this,
347 | nameof(this.Dismiss),
348 | finished:
349 | (_, __) =>
350 | {
351 | this.Dispatcher.Dispatch(
352 | () =>
353 | {
354 | this._touchOverlay.TranslationY = this._mainContainer.TranslationY;
355 | this._touchOverlay.GestureRecognizers.Add(this._touchOverlayPanGesture);
356 | });
357 | });
358 | }
359 |
360 | private void _touchOverlayPanGesture_PanUpdated(object? sender, PanUpdatedEventArgs e)
361 | {
362 | if (this.LockPosition)
363 | {
364 | return;
365 | }
366 |
367 | Page? parentPage = this.ParentPage();
368 |
369 | if (parentPage is null)
370 | {
371 | return;
372 | }
373 |
374 | double visibleHeight = this.Height;
375 |
376 | double totalTranslation = this._sheetStartingTranslationY + e.TotalY;
377 |
378 | bool allowDismiss = this.AllowFullDismiss;
379 |
380 | double bottomSafeArea = allowDismiss ? this.ParentPage()?.On()?.SafeAreaInsets().Bottom ?? 0 : 0;
381 |
382 | double touchBarDisplayHeight = allowDismiss ? 0 : this._touchBarHeight;
383 |
384 | switch (e.StatusType)
385 | {
386 | case GestureStatus.Started:
387 | this._sheetStartingTranslationY = this._mainContainer.TranslationY;
388 | break;
389 | case GestureStatus.Running:
390 | double clampedTranslation = totalTranslation.Clamp(0, visibleHeight - touchBarDisplayHeight);
391 | this._mainContainer.TranslationY = clampedTranslation;
392 | this._mainContainer.Padding = new Thickness(
393 | this._mainContainer.Margin.Left,
394 | this._mainContainer.Margin.Top,
395 | this._mainContainer.Margin.Right,
396 | clampedTranslation);
397 | break;
398 | default:
399 | double currTranslationY = this._mainContainer.TranslationY;
400 |
401 | this.AnimateToPosition(currTranslationY);
402 |
403 | break;
404 | }
405 | }
406 |
407 | private void AnimateToPosition(double yTranslation)
408 | {
409 | double visibleHeight = this.Height;
410 |
411 | bool allowDismiss = this.AllowFullDismiss;
412 |
413 | double bottomSafeArea = allowDismiss ? this.ParentPage()?.On()?.SafeAreaInsets().Bottom ?? 0 : 0;
414 |
415 | double touchBarDisplayHeight = allowDismiss ? 0 : this._touchBarHeight;
416 |
417 | (SheetStop sheetStop, double Position, double Distance) closestSheetStop = this.SheetStops
418 | .Select(
419 | x =>
420 | {
421 | double position =
422 | x.Measurement switch
423 | {
424 | SheetStopMeasurement.Percentage => visibleHeight * (1d - Math.Max(Math.Min(x.Value, 1.0d), 0d)),
425 | _ => x.Value,
426 | };
427 |
428 | return (sheetStop: x, Position: position, Distance: Math.Abs(yTranslation - position));
429 | })
430 | .OrderBy(x => x.Distance)
431 | .FirstOrDefault();
432 |
433 | this._touchOverlay.GestureRecognizers.Clear();
434 |
435 | Animation animateToPosition =
436 | new(
437 | x =>
438 | {
439 | this._mainContainer.TranslationY = x;
440 | this._mainContainer.Padding = new Thickness(
441 | this._mainContainer.Margin.Left,
442 | this._mainContainer.Margin.Top,
443 | this._mainContainer.Margin.Right,
444 | x);
445 | },
446 | this._mainContainer.TranslationY,
447 | closestSheetStop.Position.Clamp(0, visibleHeight + bottomSafeArea - touchBarDisplayHeight),
448 | Easing.SinInOut);
449 |
450 | animateToPosition.Commit(
451 | this,
452 | nameof(animateToPosition),
453 | finished:
454 | (_, __) =>
455 | {
456 | this.Dispatcher.Dispatch(
457 | () =>
458 | {
459 | this._touchOverlay.TranslationY = this._mainContainer.TranslationY;
460 | this._touchOverlay.GestureRecognizers.Add(this._touchOverlayPanGesture);
461 | });
462 | });
463 | }
464 | }
465 |
--------------------------------------------------------------------------------
/WhatIsThisSheet/NumericExtensions.cs:
--------------------------------------------------------------------------------
1 | namespace WhatIsThisSheet;
2 |
3 | public static class NumericExtensions
4 | {
5 | public static double Clamp(this double val, double min, double max)
6 | {
7 | if (val < min)
8 | {
9 | return min;
10 | }
11 |
12 | if (val > max)
13 | {
14 | return max;
15 | }
16 |
17 | return val;
18 | }
19 | }
--------------------------------------------------------------------------------
/WhatIsThisSheet/SheetStop.cs:
--------------------------------------------------------------------------------
1 | namespace WhatIsThisSheet;
2 |
3 | public struct SheetStop
4 | {
5 | public SheetStopMeasurement Measurement { get; set; }
6 |
7 | public double Value { get; set; }
8 | }
--------------------------------------------------------------------------------
/WhatIsThisSheet/SheetStopMeasurement.cs:
--------------------------------------------------------------------------------
1 | namespace WhatIsThisSheet;
2 |
3 | public enum SheetStopMeasurement
4 | {
5 | Fixed = 0,
6 | Percentage = 1,
7 | }
--------------------------------------------------------------------------------
/WhatIsThisSheet/ViewExtensions.cs:
--------------------------------------------------------------------------------
1 | namespace WhatIsThisSheet;
2 |
3 | public static class ViewExtensions
4 | {
5 | public static Page? ParentPage(this Element view)
6 | {
7 | var currentParent = view.Parent;
8 |
9 | while (currentParent is not null)
10 | {
11 | if (currentParent is Page parentPage)
12 | {
13 | return parentPage;
14 | }
15 |
16 | currentParent = currentParent.Parent;
17 | }
18 |
19 | return default;
20 | }
21 | }
--------------------------------------------------------------------------------
/WhatIsThisSheet/WhatIsThisSheet.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WhatIsThisSheet
4 |
5 |
6 | net8.0-android;net8.0-ios;net8.0-maccatalyst
7 | $(TargetFrameworks);net8.0-windows10.0.19041.0
8 |
9 |
10 | true
11 | true
12 | enable
13 | enable
14 | 11.0
15 | 13.1
16 | 21.0
17 | 10.0.17763.0
18 | 10.0.17763.0
19 | 6.5
20 |
21 |
22 | false
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/global.json:
--------------------------------------------------------------------------------
1 | {
2 | "sdk": {
3 | "allowPrerelease": false,
4 | "rollForward": "latestMajor"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TheEightBot/WhatIsThisSheet/99f5e1bd67df490ba870100e25d618bb5945df20/images/logo.png
--------------------------------------------------------------------------------
/stylecop.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
3 | "settings": {
4 | "indentation": {
5 | "useTabs": false,
6 | "indentationSize": 4
7 | },
8 | "documentationRules": {
9 | "documentExposedElements": false,
10 | "documentInternalElements": false,
11 | "documentPrivateElements": false,
12 | "documentInterfaces": false,
13 | "documentPrivateFields": false,
14 | "documentationCulture": "en-US",
15 | "xmlHeader": false
16 | },
17 | "layoutRules": {
18 | "newlineAtEndOfFile": "allow",
19 | "allowConsecutiveUsings": true
20 | },
21 | "maintainabilityRules": {
22 | "topLevelTypes": [
23 | "class",
24 | "interface",
25 | "struct",
26 | "enum",
27 | "delegate"
28 | ]
29 | },
30 | "orderingRules": {
31 | "usingDirectivesPlacement": "outsideNamespace",
32 | "systemUsingDirectivesFirst": true
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------