Skip to content

Commit 28d023b

Browse files
committed
More samples
1 parent 52b17af commit 28d023b

File tree

142 files changed

+5964
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+5964
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31611.283
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CollectionViewDemos", "CollectionViewDemos\CollectionViewDemos.csproj", "{890D9510-A2EB-41C7-B40E-7DFDB7C6C54E}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{890D9510-A2EB-41C7-B40E-7DFDB7C6C54E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{890D9510-A2EB-41C7-B40E-7DFDB7C6C54E}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{890D9510-A2EB-41C7-B40E-7DFDB7C6C54E}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17+
{890D9510-A2EB-41C7-B40E-7DFDB7C6C54E}.Release|Any CPU.ActiveCfg = Release|Any CPU
18+
{890D9510-A2EB-41C7-B40E-7DFDB7C6C54E}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{890D9510-A2EB-41C7-B40E-7DFDB7C6C54E}.Release|Any CPU.Deploy.0 = Release|Any CPU
20+
EndGlobalSection
21+
GlobalSection(SolutionProperties) = preSolution
22+
HideSolutionNode = FALSE
23+
EndGlobalSection
24+
GlobalSection(ExtensibilityGlobals) = postSolution
25+
SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572}
26+
EndGlobalSection
27+
EndGlobal
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version = "1.0" encoding = "UTF-8" ?>
2+
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
xmlns:local="clr-namespace:CollectionViewDemos"
5+
x:Class="CollectionViewDemos.App">
6+
<Application.Resources>
7+
<ResourceDictionary>
8+
<ResourceDictionary.MergedDictionaries>
9+
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
10+
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
11+
</ResourceDictionary.MergedDictionaries>
12+
13+
<Style TargetType="StackLayout">
14+
<Setter Property="Spacing" Value="6" />
15+
</Style>
16+
<Style TargetType="Grid">
17+
<Setter Property="RowSpacing" Value="6" />
18+
<Setter Property="ColumnSpacing" Value="6" />
19+
</Style>
20+
21+
</ResourceDictionary>
22+
</Application.Resources>
23+
</Application>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
namespace CollectionViewDemos;
2+
3+
public partial class App : Application
4+
{
5+
public App()
6+
{
7+
InitializeComponent();
8+
}
9+
10+
protected override Window CreateWindow(IActivationState activationState)
11+
{
12+
return new Window(new AppShell());
13+
}
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<Shell
3+
x:Class="CollectionViewDemos.AppShell"
4+
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
5+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
6+
xmlns:local="clr-namespace:CollectionViewDemos"
7+
Shell.FlyoutBehavior="Disabled">
8+
9+
<ShellContent
10+
Title="Home"
11+
ContentTemplate="{DataTemplate local:MainPage}"
12+
Route="MainPage" />
13+
14+
</Shell>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace CollectionViewDemos;
2+
3+
public partial class AppShell : Shell
4+
{
5+
public AppShell()
6+
{
7+
InitializeComponent();
8+
}
9+
}
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>net10.0-android;net10.0-ios;net10.0-maccatalyst</TargetFrameworks>
5+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net10.0-windows10.0.19041.0</TargetFrameworks>
6+
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
7+
<!-- <TargetFrameworks>$(TargetFrameworks);net10.0-tizen</TargetFrameworks> -->
8+
9+
<!-- Note for MacCatalyst:
10+
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
11+
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
12+
The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
13+
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
14+
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
15+
16+
<OutputType>Exe</OutputType>
17+
<RootNamespace>CollectionViewDemos</RootNamespace>
18+
<UseMaui>true</UseMaui>
19+
<SingleProject>true</SingleProject>
20+
<ImplicitUsings>enable</ImplicitUsings>
21+
<MauiEnableXamlCBindingWithSourceCompilation>true</MauiEnableXamlCBindingWithSourceCompilation>
22+
23+
<!-- Display name -->
24+
<ApplicationTitle>CollectionViewDemos</ApplicationTitle>
25+
26+
<!-- App Identifier -->
27+
<ApplicationId>com.companyname.collectionviewdemos</ApplicationId>
28+
29+
<!-- Versions -->
30+
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
31+
<ApplicationVersion>1</ApplicationVersion>
32+
33+
<!-- To develop, package, and publish an app to the Microsoft Store, see: https://aka.ms/MauiTemplateUnpackaged -->
34+
<WindowsPackageType>None</WindowsPackageType>
35+
36+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
37+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
38+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
39+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
40+
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
41+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
42+
</PropertyGroup>
43+
44+
<ItemGroup>
45+
<!-- App Icon -->
46+
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
47+
48+
<!-- Splash Screen -->
49+
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
50+
51+
<!-- Images -->
52+
<MauiImage Include="Resources\Images\*" />
53+
<MauiImage Update="Resources\Images\dotnet_bot.png" Resize="True" BaseSize="300,185" />
54+
55+
<!-- Custom Fonts -->
56+
<MauiFont Include="Resources\Fonts\*" />
57+
58+
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
59+
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
60+
</ItemGroup>
61+
62+
<ItemGroup>
63+
<MauiXaml Update="Controls\SpacingModifier.xaml">
64+
<Generator>MSBuild:Compile</Generator>
65+
</MauiXaml>
66+
<MauiXaml Update="Views\EmptyView\EmptyViewDataTemplateSelectorPage.xaml">
67+
<Generator>MSBuild:Compile</Generator>
68+
</MauiXaml>
69+
<MauiXaml Update="Views\EmptyView\EmptyViewFilteredPage.xaml">
70+
<Generator>MSBuild:Compile</Generator>
71+
</MauiXaml>
72+
<MauiXaml Update="Views\EmptyView\EmptyViewLoadSimulationPage.xaml">
73+
<Generator>MSBuild:Compile</Generator>
74+
</MauiXaml>
75+
<MauiXaml Update="Views\EmptyView\EmptyViewNullPage.xaml">
76+
<Generator>MSBuild:Compile</Generator>
77+
</MauiXaml>
78+
<MauiXaml Update="Views\EmptyView\EmptyViewSwapPage.xaml">
79+
<Generator>MSBuild:Compile</Generator>
80+
</MauiXaml>
81+
<MauiXaml Update="Views\EmptyView\EmptyViewTemplatePage.xaml">
82+
<Generator>MSBuild:Compile</Generator>
83+
</MauiXaml>
84+
<MauiXaml Update="Views\EmptyView\EmptyViewWithViewsFilteredPage.xaml">
85+
<Generator>MSBuild:Compile</Generator>
86+
</MauiXaml>
87+
<MauiXaml Update="Views\Grouping\VerticalListEmptyGroupsPage.xaml">
88+
<Generator>MSBuild:Compile</Generator>
89+
</MauiXaml>
90+
<MauiXaml Update="Views\Grouping\VerticalListGroupingPage.xaml">
91+
<Generator>MSBuild:Compile</Generator>
92+
</MauiXaml>
93+
<MauiXaml Update="Views\Grouping\VerticalListGroupingVariableSizeItemsPage.xaml">
94+
<Generator>MSBuild:Compile</Generator>
95+
</MauiXaml>
96+
<MauiXaml Update="Views\Grouping\VerticalListTextGroupingPage.xaml">
97+
<Generator>MSBuild:Compile</Generator>
98+
</MauiXaml>
99+
<MauiXaml Update="Views\HeadersAndFooters\HorizontalGridHeaderFooterViewPage.xaml">
100+
<Generator>MSBuild:Compile</Generator>
101+
</MauiXaml>
102+
<MauiXaml Update="Views\HeadersAndFooters\VerticalListHeaderFooterDataTemplatePage.xaml">
103+
<Generator>MSBuild:Compile</Generator>
104+
</MauiXaml>
105+
<MauiXaml Update="Views\HeadersAndFooters\VerticalListHeaderFooterStringPage.xaml">
106+
<Generator>MSBuild:Compile</Generator>
107+
</MauiXaml>
108+
<MauiXaml Update="Views\HeadersAndFooters\VerticalListHeaderFooterViewPage.xaml">
109+
<Generator>MSBuild:Compile</Generator>
110+
</MauiXaml>
111+
<MauiXaml Update="Views\Layout\HorizontalGridPage.xaml">
112+
<Generator>MSBuild:Compile</Generator>
113+
</MauiXaml>
114+
<MauiXaml Update="Views\Layout\HorizontalGridTextPage.xaml">
115+
<Generator>MSBuild:Compile</Generator>
116+
</MauiXaml>
117+
<MauiXaml Update="Views\Layout\HorizontalListPage.xaml">
118+
<Generator>MSBuild:Compile</Generator>
119+
</MauiXaml>
120+
<MauiXaml Update="Views\Layout\HorizontalListTextPage.xaml">
121+
<Generator>MSBuild:Compile</Generator>
122+
</MauiXaml>
123+
<MauiXaml Update="Views\Layout\VerticalGridPage.xaml">
124+
<Generator>MSBuild:Compile</Generator>
125+
</MauiXaml>
126+
<MauiXaml Update="Views\Layout\VerticalGridTextPage.xaml">
127+
<Generator>MSBuild:Compile</Generator>
128+
</MauiXaml>
129+
<MauiXaml Update="Views\Layout\VerticalListDataTemplateSelectorPage.xaml">
130+
<Generator>MSBuild:Compile</Generator>
131+
</MauiXaml>
132+
<MauiXaml Update="Views\Layout\VerticalListPage.xaml">
133+
<Generator>MSBuild:Compile</Generator>
134+
</MauiXaml>
135+
<MauiXaml Update="Views\Layout\VerticalListRTLPage.xaml">
136+
<Generator>MSBuild:Compile</Generator>
137+
</MauiXaml>
138+
<MauiXaml Update="Views\Layout\VerticalListTextPage.xaml">
139+
<Generator>MSBuild:Compile</Generator>
140+
</MauiXaml>
141+
<MauiXaml Update="Views\MainPage.xaml">
142+
<Generator>MSBuild:Compile</Generator>
143+
</MauiXaml>
144+
<MauiXaml Update="Views\PullToRefresh\HorizontalGridPullToRefreshPage.xaml">
145+
<Generator>MSBuild:Compile</Generator>
146+
</MauiXaml>
147+
<MauiXaml Update="Views\PullToRefresh\VerticalListPullToRefreshPage.xaml">
148+
<Generator>MSBuild:Compile</Generator>
149+
</MauiXaml>
150+
<MauiXaml Update="Views\Scrolling\IncrementalLoadingPage.xaml">
151+
<Generator>MSBuild:Compile</Generator>
152+
</MauiXaml>
153+
<MauiXaml Update="Views\Scrolling\ItemsUpdatingScrollModePage.xaml">
154+
<Generator>MSBuild:Compile</Generator>
155+
</MauiXaml>
156+
<MauiXaml Update="Views\Scrolling\ScrollToByIndexPage.xaml">
157+
<Generator>MSBuild:Compile</Generator>
158+
</MauiXaml>
159+
<MauiXaml Update="Views\Scrolling\ScrollToByIndexWithGroupingPage.xaml">
160+
<Generator>MSBuild:Compile</Generator>
161+
</MauiXaml>
162+
<MauiXaml Update="Views\Scrolling\ScrollToByObjectPage.xaml">
163+
<Generator>MSBuild:Compile</Generator>
164+
</MauiXaml>
165+
<MauiXaml Update="Views\Scrolling\ScrollToByObjectWithGroupingPage.xaml">
166+
<Generator>MSBuild:Compile</Generator>
167+
</MauiXaml>
168+
<MauiXaml Update="Views\Selection\VerticalListMultiplePreSelectionPage.xaml">
169+
<Generator>MSBuild:Compile</Generator>
170+
</MauiXaml>
171+
<MauiXaml Update="Views\Selection\VerticalListMultipleSelectionPage.xaml">
172+
<Generator>MSBuild:Compile</Generator>
173+
</MauiXaml>
174+
<MauiXaml Update="Views\Selection\VerticalListSelectionColorPage.xaml">
175+
<Generator>MSBuild:Compile</Generator>
176+
</MauiXaml>
177+
<MauiXaml Update="Views\Selection\VerticalListSinglePreSelectionPage.xaml">
178+
<Generator>MSBuild:Compile</Generator>
179+
</MauiXaml>
180+
<MauiXaml Update="Views\Selection\VerticalListSingleSelectionPage.xaml">
181+
<Generator>MSBuild:Compile</Generator>
182+
</MauiXaml>
183+
<MauiXaml Update="Views\Sizing\VerticalListDynamicSizeItemsPage.xaml">
184+
<Generator>MSBuild:Compile</Generator>
185+
</MauiXaml>
186+
<MauiXaml Update="Views\Sizing\VerticalListVariableSizeItemsPage.xaml">
187+
<Generator>MSBuild:Compile</Generator>
188+
</MauiXaml>
189+
<MauiXaml Update="Views\SnapPoints\VerticalListSnapPointsPage.xaml">
190+
<Generator>MSBuild:Compile</Generator>
191+
</MauiXaml>
192+
<MauiXaml Update="Views\Spacing\HorizontalGridSpacingPage.xaml">
193+
<Generator>MSBuild:Compile</Generator>
194+
</MauiXaml>
195+
<MauiXaml Update="Views\Spacing\HorizontalListSpacingPage.xaml">
196+
<Generator>MSBuild:Compile</Generator>
197+
</MauiXaml>
198+
<MauiXaml Update="Views\Spacing\VerticalGridSpacingPage.xaml">
199+
<Generator>MSBuild:Compile</Generator>
200+
</MauiXaml>
201+
<MauiXaml Update="Views\Spacing\VerticalListSpacingPage.xaml">
202+
<Generator>MSBuild:Compile</Generator>
203+
</MauiXaml>
204+
<MauiXaml Update="Views\Swipe\VerticalListSwipeContextItemsPage.xaml">
205+
<Generator>MSBuild:Compile</Generator>
206+
</MauiXaml>
207+
</ItemGroup>
208+
209+
<ItemGroup>
210+
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
211+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="10.0.0-preview.3.25171.5" />
212+
</ItemGroup>
213+
214+
</Project>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using System.Reflection;
2+
3+
namespace CollectionViewDemos.Controls
4+
{
5+
class EnumPicker : Picker
6+
{
7+
public static readonly BindableProperty EnumTypeProperty =
8+
BindableProperty.Create(nameof(EnumType), typeof(Type), typeof(EnumPicker),
9+
propertyChanged: (bindable, oldValue, newValue) =>
10+
{
11+
EnumPicker picker = (EnumPicker)bindable;
12+
13+
if (oldValue != null)
14+
{
15+
picker.ItemsSource = null;
16+
}
17+
if (newValue != null)
18+
{
19+
if (!((Type)newValue).GetTypeInfo().IsEnum)
20+
throw new ArgumentException("EnumPicker: EnumType property must be enumeration type");
21+
22+
picker.ItemsSource = Enum.GetValues((Type)newValue);
23+
}
24+
});
25+
26+
public Type EnumType
27+
{
28+
set => SetValue(EnumTypeProperty, value);
29+
get => (Type)GetValue(EnumTypeProperty);
30+
}
31+
}
32+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace CollectionViewDemos.Controls
2+
{
3+
public class FilterData : BindableObject
4+
{
5+
public static readonly BindableProperty FilterProperty = BindableProperty.Create(nameof(Filter), typeof(string), typeof(FilterData), null);
6+
7+
public string Filter
8+
{
9+
get { return (string)GetValue(FilterProperty); }
10+
set { SetValue(FilterProperty, value); }
11+
}
12+
}
13+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using CollectionViewDemos.Models;
2+
3+
namespace CollectionViewDemos.Controls
4+
{
5+
public class MonkeyDataTemplateSelector : DataTemplateSelector
6+
{
7+
public DataTemplate AmericanMonkey { get; set; }
8+
public DataTemplate OtherMonkey { get; set; }
9+
10+
protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
11+
{
12+
return ((Monkey)item).Location.Contains("America") ? AmericanMonkey : OtherMonkey;
13+
}
14+
}
15+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
namespace CollectionViewDemos.Controls
2+
{
3+
public class SearchTermDataTemplateSelector : DataTemplateSelector
4+
{
5+
public DataTemplate DefaultTemplate { get; set; }
6+
public DataTemplate OtherTemplate { get; set; }
7+
8+
protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
9+
{
10+
string query = (string)item;
11+
return query.ToLower().Equals("xamarin") ? OtherTemplate : DefaultTemplate;
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)