Skip to content

Commit 45d4955

Browse files
committed
More samples
1 parent 5e47cd5 commit 45d4955

File tree

230 files changed

+8284
-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.

230 files changed

+8284
-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}") = "ListViewDemos", "ListViewDemos\ListViewDemos.csproj", "{1E0BC93B-4B65-45FC-8070-6A00304BE027}"
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+
{1E0BC93B-4B65-45FC-8070-6A00304BE027}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{1E0BC93B-4B65-45FC-8070-6A00304BE027}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{1E0BC93B-4B65-45FC-8070-6A00304BE027}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17+
{1E0BC93B-4B65-45FC-8070-6A00304BE027}.Release|Any CPU.ActiveCfg = Release|Any CPU
18+
{1E0BC93B-4B65-45FC-8070-6A00304BE027}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{1E0BC93B-4B65-45FC-8070-6A00304BE027}.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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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:ListViewDemos"
5+
x:Class="ListViewDemos.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="Grid">
14+
<Setter Property="RowSpacing" Value="6" />
15+
<Setter Property="ColumnSpacing" Value="6" />
16+
</Style>
17+
18+
</ResourceDictionary>
19+
</Application.Resources>
20+
</Application>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
namespace ListViewDemos;
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="ListViewDemos.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:ListViewDemos"
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 ListViewDemos;
2+
3+
public partial class AppShell : Shell
4+
{
5+
public AppShell()
6+
{
7+
InitializeComponent();
8+
}
9+
}
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 ListViewDemos.Controls
4+
{
5+
public 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: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
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>ListViewDemos</RootNamespace>
18+
<UseMaui>true</UseMaui>
19+
<SingleProject>true</SingleProject>
20+
<ImplicitUsings>enable</ImplicitUsings>
21+
<MauiEnableXamlCBindingWithSourceCompilation>true</MauiEnableXamlCBindingWithSourceCompilation>
22+
23+
<!-- Display name -->
24+
<ApplicationTitle>ListViewDemos</ApplicationTitle>
25+
26+
<!-- App Identifier -->
27+
<ApplicationId>com.companyname.listviewdemos</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="Views\ContextMenuItemsPage.xaml">
64+
<Generator>MSBuild:Compile</Generator>
65+
</MauiXaml>
66+
<MauiXaml Update="Views\DataTemplateSelectorPage.xaml">
67+
<Generator>MSBuild:Compile</Generator>
68+
</MauiXaml>
69+
<MauiXaml Update="Views\GroupingPage.xaml">
70+
<Generator>MSBuild:Compile</Generator>
71+
</MauiXaml>
72+
<MauiXaml Update="Views\MainPage.xaml">
73+
<Generator>MSBuild:Compile</Generator>
74+
</MauiXaml>
75+
<MauiXaml Update="Views\PullToRefreshPage.xaml">
76+
<Generator>MSBuild:Compile</Generator>
77+
</MauiXaml>
78+
<MauiXaml Update="Views\RightToLeftListPage.xaml">
79+
<Generator>MSBuild:Compile</Generator>
80+
</MauiXaml>
81+
<MauiXaml Update="Views\RuntimeItemSizingPage.xaml">
82+
<Generator>MSBuild:Compile</Generator>
83+
</MauiXaml>
84+
<MauiXaml Update="Views\ScrollByItemPage.xaml">
85+
<Generator>MSBuild:Compile</Generator>
86+
</MauiXaml>
87+
<MauiXaml Update="Views\ScrollByItemWithGroupingPage.xaml">
88+
<Generator>MSBuild:Compile</Generator>
89+
</MauiXaml>
90+
<MauiXaml Update="Views\SelectionPage.xaml">
91+
<Generator>MSBuild:Compile</Generator>
92+
</MauiXaml>
93+
<MauiXaml Update="Views\TemplatedHeaderFooterPage.xaml">
94+
<Generator>MSBuild:Compile</Generator>
95+
</MauiXaml>
96+
<MauiXaml Update="Views\TextHeaderFooterPage.xaml">
97+
<Generator>MSBuild:Compile</Generator>
98+
</MauiXaml>
99+
<MauiXaml Update="Views\TextListPage.xaml">
100+
<Generator>MSBuild:Compile</Generator>
101+
</MauiXaml>
102+
<MauiXaml Update="Views\VerticalListPage.xaml">
103+
<Generator>MSBuild:Compile</Generator>
104+
</MauiXaml>
105+
<MauiXaml Update="Views\ViewHeaderFooterPage.xaml">
106+
<Generator>MSBuild:Compile</Generator>
107+
</MauiXaml>
108+
</ItemGroup>
109+
110+
<ItemGroup>
111+
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
112+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="10.0.0-preview.3.25171.5" />
113+
</ItemGroup>
114+
115+
</Project>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
namespace ListViewDemos;
2+
3+
public static class MauiProgram
4+
{
5+
public static MauiApp CreateMauiApp()
6+
{
7+
var builder = MauiApp.CreateBuilder();
8+
builder
9+
.UseMauiApp<App>()
10+
.ConfigureFonts(fonts =>
11+
{
12+
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
13+
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
14+
});
15+
16+
return builder.Build();
17+
}
18+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace ListViewDemos.Models
2+
{
3+
public class Animal
4+
{
5+
public string Name { get; set; }
6+
public string Location { get; set; }
7+
public string Details { get; set; }
8+
public string ImageUrl { get; set; }
9+
10+
public override string ToString()
11+
{
12+
return Name;
13+
}
14+
}
15+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace ListViewDemos.Models
2+
{
3+
public class AnimalGroup : List<Animal>
4+
{
5+
public string Name { get; private set; }
6+
7+
public AnimalGroup(string name, List<Animal> animals) : base(animals)
8+
{
9+
Name = name;
10+
}
11+
12+
public override string ToString()
13+
{
14+
return Name;
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)