Skip to content

Commit 5e47cd5

Browse files
committed
More samples
1 parent 28d023b commit 5e47cd5

File tree

217 files changed

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

217 files changed

+14993
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.12.35527.113 d17.12
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CardViewDemo", "CardViewDemo\CardViewDemo.csproj", "{1CC7B627-6833-4695-8231-A5A547421A10}"
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+
{1CC7B627-6833-4695-8231-A5A547421A10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{1CC7B627-6833-4695-8231-A5A547421A10}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{1CC7B627-6833-4695-8231-A5A547421A10}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{1CC7B627-6833-4695-8231-A5A547421A10}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
3+
xmlns:windows="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;assembly=Microsoft.Maui.Controls"
4+
xmlns:local="clr-namespace:CardViewDemo"
5+
x:Class="CardViewDemo.App"
6+
windows:Application.ImageDirectory="Assets">
7+
<Application.Resources>
8+
9+
</Application.Resources>
10+
</Application>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
namespace CardViewDemo;
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="CardViewDemo.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:CardViewDemo"
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 CardViewDemo;
2+
3+
public partial class AppShell : Shell
4+
{
5+
public AppShell()
6+
{
7+
InitializeComponent();
8+
}
9+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
using CardViewDemo.Controls;
2+
3+
namespace CardViewDemo
4+
{
5+
public class CardViewCodePage : ContentPage
6+
{
7+
public CardViewCodePage()
8+
{
9+
Title = "CardView Code Demo";
10+
Padding = 10;
11+
12+
StackLayout layout = new StackLayout
13+
{
14+
Spacing = 6,
15+
HorizontalOptions = LayoutOptions.Fill,
16+
VerticalOptions = LayoutOptions.Fill,
17+
Children =
18+
{
19+
new CardView
20+
{
21+
BorderColor = Colors.DarkGray,
22+
CardTitle = "Slavko Vlasic",
23+
CardDescription = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla elit dolor, convallis non interdum.",
24+
IconBackgroundColor = Colors.SlateGray,
25+
IconImageSource = ImageSource.FromFile("user.png")
26+
},
27+
new CardView
28+
{
29+
BorderColor = Colors.DarkGray,
30+
CardTitle = "Carolina Pena",
31+
CardDescription = "Phasellus eu convallis mi. In tempus augue eu dignissim fermentum. Morbi ut lacus vitae eros lacinia.",
32+
IconBackgroundColor = Colors.SlateGray,
33+
IconImageSource = ImageSource.FromFile("user.png")
34+
},
35+
new CardView
36+
{
37+
BorderColor = Colors.DarkGray,
38+
CardTitle = "Wade Blanks",
39+
CardDescription = "Aliquam sagittis, odio lacinia fermentum dictum, mi erat scelerisque erat, quis aliquet arcu.",
40+
IconBackgroundColor = Colors.SlateGray,
41+
IconImageSource = ImageSource.FromFile("user.png")
42+
},
43+
new CardView
44+
{
45+
BorderColor = Colors.DarkGray,
46+
CardTitle = "Colette Quint",
47+
CardDescription = "In pellentesque odio eget augue elementum lobortis. Sed augue massa, rhoncus eu nisi vitae, egestas.",
48+
IconBackgroundColor = Colors.SlateGray,
49+
IconImageSource = ImageSource.FromFile("user.png")
50+
},
51+
}
52+
};
53+
54+
ScrollView scroll = new ScrollView
55+
{
56+
HorizontalOptions = LayoutOptions.Fill,
57+
VerticalOptions = LayoutOptions.Fill,
58+
Content = layout
59+
};
60+
61+
Content = scroll;
62+
}
63+
}
64+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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>CardViewDemo</RootNamespace>
18+
<UseMaui>true</UseMaui>
19+
<SingleProject>true</SingleProject>
20+
<ImplicitUsings>enable</ImplicitUsings>
21+
22+
<!-- Display name -->
23+
<ApplicationTitle>CardViewDemo</ApplicationTitle>
24+
25+
<!-- App Identifier -->
26+
<ApplicationId>com.companyname.cardviewdemo</ApplicationId>
27+
28+
<!-- Versions -->
29+
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
30+
<ApplicationVersion>1</ApplicationVersion>
31+
32+
<!-- To develop, package, and publish an app to the Microsoft Store, see: https://aka.ms/MauiTemplateUnpackaged -->
33+
<WindowsPackageType>None</WindowsPackageType>
34+
35+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
36+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
37+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
38+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
39+
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
40+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
41+
</PropertyGroup>
42+
43+
<ItemGroup>
44+
<!-- App Icon -->
45+
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
46+
47+
<!-- Splash Screen -->
48+
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
49+
50+
<!-- Images -->
51+
<MauiImage Include="Resources\Images\*" />
52+
<MauiImage Update="Resources\Images\dotnet_bot.png" Resize="True" BaseSize="300,185" />
53+
54+
<!-- Custom Fonts -->
55+
<MauiFont Include="Resources\Fonts\*" />
56+
57+
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
58+
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
59+
</ItemGroup>
60+
61+
<ItemGroup>
62+
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
63+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="10.0.0-preview.3.25171.5" />
64+
</ItemGroup>
65+
66+
</Project>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
xmlns:controls="clr-namespace:CardViewDemo.Controls"
5+
x:Class="CardViewDemo.CardViewXamlPage"
6+
Title="CardView XAML Demo"
7+
Padding="10">
8+
<ScrollView>
9+
<StackLayout Spacing="6">
10+
<controls:CardView BorderColor="DarkGray"
11+
CardTitle="Slavko Vlasic"
12+
CardDescription="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla elit dolor, convallis non interdum."
13+
IconBackgroundColor="SlateGray"
14+
IconImageSource="user.png" />
15+
<controls:CardView BorderColor="DarkGray"
16+
CardTitle="Carolina Pena"
17+
CardDescription="Phasellus eu convallis mi. In tempus augue eu dignissim fermentum. Morbi ut lacus vitae eros lacinia."
18+
IconBackgroundColor="SlateGray"
19+
IconImageSource="user.png" />
20+
<controls:CardView BorderColor="DarkGray"
21+
CardTitle="Wade Blanks"
22+
CardDescription="Aliquam sagittis, odio lacinia fermentum dictum, mi erat scelerisque erat, quis aliquet arcu."
23+
IconBackgroundColor="SlateGray"
24+
IconImageSource="user.png" />
25+
<controls:CardView BorderColor="DarkGray"
26+
CardTitle="Colette Quint"
27+
CardDescription="In pellentesque odio eget augue elementum lobortis. Sed augue massa, rhoncus eu nisi vitae, egestas."
28+
IconBackgroundColor="SlateGray"
29+
IconImageSource="user.png" />
30+
</StackLayout>
31+
</ScrollView>
32+
</ContentPage>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace CardViewDemo
2+
{
3+
public partial class CardViewXamlPage : ContentPage
4+
{
5+
public CardViewXamlPage()
6+
{
7+
InitializeComponent();
8+
}
9+
}
10+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
xmlns:controls="clr-namespace:CardViewDemo.Controls"
5+
x:Class="CardViewDemo.ControlTemplatePage"
6+
Title="ControlTemplate XAML Demo"
7+
Padding="10"
8+
x:DataType="controls:CardView">
9+
<ContentPage.Resources>
10+
<ResourceDictionary>
11+
<ControlTemplate x:Key="CardViewCompressed">
12+
<Grid ColumnSpacing="6"
13+
RowSpacing="6">
14+
<Grid.RowDefinitions>
15+
<RowDefinition Height="100" />
16+
</Grid.RowDefinitions>
17+
<Grid.ColumnDefinitions>
18+
<ColumnDefinition Width="100" />
19+
<ColumnDefinition Width="*" />
20+
</Grid.ColumnDefinitions>
21+
<Image Source="{TemplateBinding IconImageSource}"
22+
BackgroundColor="{TemplateBinding IconBackgroundColor}"
23+
WidthRequest="100"
24+
HeightRequest="100"
25+
Aspect="AspectFill"
26+
HorizontalOptions="Center"
27+
VerticalOptions="Center" />
28+
<StackLayout Grid.Column="1"
29+
Spacing="6">
30+
<Label Text="{TemplateBinding CardTitle}"
31+
FontAttributes="Bold" />
32+
<Label Text="{TemplateBinding CardDescription}" />
33+
</StackLayout>
34+
</Grid>
35+
</ControlTemplate>
36+
</ResourceDictionary>
37+
</ContentPage.Resources>
38+
39+
<StackLayout Spacing="6">
40+
<Label Text="A standard CardView control is suitable for grid layouts:"
41+
FontAttributes="Italic"
42+
TextColor="Red"
43+
Margin="0,0,0,10" />
44+
<controls:CardView BorderColor="DarkGray"
45+
CardTitle="Slavko Vlasic"
46+
CardDescription="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla elit dolor, convallis non interdum."
47+
IconBackgroundColor="SlateGray"
48+
IconImageSource="user.png" />
49+
<Label Text="A ControlTemplate overrides the standard view, creating a more compact view suitable for lists:"
50+
FontAttributes="Italic"
51+
TextColor="Red"
52+
Margin="0,0,0,10" />
53+
<controls:CardView BorderColor="DarkGray"
54+
CardTitle="Carolina Pena"
55+
CardDescription="Phasellus eu convallis mi. In tempus augue eu dignissim fermentum. Morbi ut lacus vitae eros lacinia."
56+
IconBackgroundColor="SlateGray"
57+
IconImageSource="user.png"
58+
ControlTemplate="{StaticResource CardViewCompressed}" />
59+
<controls:CardView BorderColor="DarkGray"
60+
CardTitle="Wade Blanks"
61+
CardDescription="Aliquam sagittis, odio lacinia fermentum dictum, mi erat scelerisque erat, quis aliquet arcu."
62+
IconBackgroundColor="SlateGray"
63+
IconImageSource="user.png"
64+
ControlTemplate="{StaticResource CardViewCompressed}" />
65+
<controls:CardView BorderColor="DarkGray"
66+
CardTitle="Colette Quint"
67+
CardDescription="In pellentesque odio eget augue elementum lobortis. Sed augue massa, rhoncus eu nisi vitae, egestas."
68+
IconBackgroundColor="SlateGray"
69+
IconImageSource="user.png"
70+
ControlTemplate="{StaticResource CardViewCompressed}" />
71+
</StackLayout>
72+
</ContentPage>

0 commit comments

Comments
 (0)