Skip to content

Commit 52b17af

Browse files
committed
More UI samples
1 parent 77c200c commit 52b17af

File tree

151 files changed

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

151 files changed

+5693
-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}") = "CarouselViewDemos", "CarouselViewDemos\CarouselViewDemos.csproj", "{D24D6565-62CE-4AE5-B065-D99DFDE649D4}"
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+
{D24D6565-62CE-4AE5-B065-D99DFDE649D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{D24D6565-62CE-4AE5-B065-D99DFDE649D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{D24D6565-62CE-4AE5-B065-D99DFDE649D4}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17+
{D24D6565-62CE-4AE5-B065-D99DFDE649D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
18+
{D24D6565-62CE-4AE5-B065-D99DFDE649D4}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{D24D6565-62CE-4AE5-B065-D99DFDE649D4}.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:CarouselViewDemos"
5+
x:Class="CarouselViewDemos.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 CarouselViewDemos;
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="CarouselViewDemos.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:CarouselViewDemos"
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 CarouselViewDemos;
2+
3+
public partial class AppShell : Shell
4+
{
5+
public AppShell()
6+
{
7+
InitializeComponent();
8+
}
9+
}
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
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>CarouselViewDemos</RootNamespace>
18+
<UseMaui>true</UseMaui>
19+
<SingleProject>true</SingleProject>
20+
<ImplicitUsings>enable</ImplicitUsings>
21+
<MauiEnableXamlCBindingWithSourceCompilation>true</MauiEnableXamlCBindingWithSourceCompilation>
22+
23+
<!-- Display name -->
24+
<ApplicationTitle>CarouselViewDemos</ApplicationTitle>
25+
26+
<!-- App Identifier -->
27+
<ApplicationId>com.companyname.carouselviewdemos</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\Indicators\HorizontalLayoutWithIndicatorsPage.xaml">
88+
<Generator>MSBuild:Compile</Generator>
89+
</MauiXaml>
90+
<MauiXaml Update="Views\Interaction\CurrentItemAndPositionBindingsPage.xaml">
91+
<Generator>MSBuild:Compile</Generator>
92+
</MauiXaml>
93+
<MauiXaml Update="Views\Interaction\CurrentItemAndPositionPage.xaml">
94+
<Generator>MSBuild:Compile</Generator>
95+
</MauiXaml>
96+
<MauiXaml Update="Views\Interaction\SetCurrentItemAndPositionPage.xaml">
97+
<Generator>MSBuild:Compile</Generator>
98+
</MauiXaml>
99+
<MauiXaml Update="Views\Interaction\VisualStatesPage.xaml">
100+
<Generator>MSBuild:Compile</Generator>
101+
</MauiXaml>
102+
<MauiXaml Update="Views\Layout\HorizontalLayoutDataTemplateSelectorPage.xaml">
103+
<Generator>MSBuild:Compile</Generator>
104+
</MauiXaml>
105+
<MauiXaml Update="Views\Layout\HorizontalLayoutPeekAreaPage.xaml">
106+
<Generator>MSBuild:Compile</Generator>
107+
</MauiXaml>
108+
<MauiXaml Update="Views\Layout\HorizontalTemplateLayoutPage.xaml">
109+
<Generator>MSBuild:Compile</Generator>
110+
</MauiXaml>
111+
<MauiXaml Update="Views\Layout\HorizontalTemplateLayoutRTLPage.xaml">
112+
<Generator>MSBuild:Compile</Generator>
113+
</MauiXaml>
114+
<MauiXaml Update="Views\Layout\HorizontalTextLayoutPage.xaml">
115+
<Generator>MSBuild:Compile</Generator>
116+
</MauiXaml>
117+
<MauiXaml Update="Views\Layout\VerticalTemplateLayoutPage.xaml">
118+
<Generator>MSBuild:Compile</Generator>
119+
</MauiXaml>
120+
<MauiXaml Update="Views\Layout\VerticalTextLayoutPage.xaml">
121+
<Generator>MSBuild:Compile</Generator>
122+
</MauiXaml>
123+
<MauiXaml Update="Views\MainPage.xaml">
124+
<Generator>MSBuild:Compile</Generator>
125+
</MauiXaml>
126+
<MauiXaml Update="Views\PullToRefresh\HorizontalPullToRefreshPage.xaml">
127+
<Generator>MSBuild:Compile</Generator>
128+
</MauiXaml>
129+
<MauiXaml Update="Views\PullToRefresh\VerticalPullToRefreshPage.xaml">
130+
<Generator>MSBuild:Compile</Generator>
131+
</MauiXaml>
132+
<MauiXaml Update="Views\Scrolling\IncrementalLoadingPage.xaml">
133+
<Generator>MSBuild:Compile</Generator>
134+
</MauiXaml>
135+
<MauiXaml Update="Views\Scrolling\ItemsUpdatingScrollModePage.xaml">
136+
<Generator>MSBuild:Compile</Generator>
137+
</MauiXaml>
138+
<MauiXaml Update="Views\Scrolling\ScrollToByIndexPage.xaml">
139+
<Generator>MSBuild:Compile</Generator>
140+
</MauiXaml>
141+
<MauiXaml Update="Views\Scrolling\ScrollToByObjectPage.xaml">
142+
<Generator>MSBuild:Compile</Generator>
143+
</MauiXaml>
144+
<MauiXaml Update="Views\Scrolling\SnapPointsPage.xaml">
145+
<Generator>MSBuild:Compile</Generator>
146+
</MauiXaml>
147+
<MauiXaml Update="Views\Sizing\DynamicSizeItemsPage.xaml">
148+
<Generator>MSBuild:Compile</Generator>
149+
</MauiXaml>
150+
<MauiXaml Update="Views\Spacing\HorizontalSpacingPage.xaml">
151+
<Generator>MSBuild:Compile</Generator>
152+
</MauiXaml>
153+
<MauiXaml Update="Views\Spacing\VerticalSpacingPage.xaml">
154+
<Generator>MSBuild:Compile</Generator>
155+
</MauiXaml>
156+
<MauiXaml Update="Views\Swipe\HorizontalSwipeItemsPage.xaml">
157+
<Generator>MSBuild:Compile</Generator>
158+
</MauiXaml>
159+
</ItemGroup>
160+
161+
<ItemGroup>
162+
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
163+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="10.0.0-preview.3.25171.5" />
164+
</ItemGroup>
165+
166+
</Project>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System.Reflection;
2+
3+
namespace CarouselViewDemos.Controls
4+
{
5+
public class EnumPicker : Picker
6+
{
7+
public static readonly BindableProperty EnumTypeProperty = BindableProperty.Create(nameof(EnumType), typeof(Type), typeof(EnumPicker),
8+
propertyChanged: (bindable, oldValue, newValue) =>
9+
{
10+
EnumPicker picker = (EnumPicker)bindable;
11+
12+
if (oldValue != null)
13+
{
14+
picker.ItemsSource = null;
15+
}
16+
if (newValue != null)
17+
{
18+
if (!((Type)newValue).GetTypeInfo().IsEnum)
19+
throw new ArgumentException("EnumPicker: EnumType property must be enumeration type");
20+
21+
picker.ItemsSource = Enum.GetValues((Type)newValue);
22+
}
23+
});
24+
25+
public Type EnumType
26+
{
27+
set => SetValue(EnumTypeProperty, value);
28+
get => (Type)GetValue(EnumTypeProperty);
29+
}
30+
}
31+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace CarouselViewDemos.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 CarouselViewDemos.Models;
2+
3+
namespace CarouselViewDemos.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 CarouselViewDemos.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)