Skip to content

Commit c0c3141

Browse files
authored
Add files via upload
1 parent b434b8e commit c0c3141

Some content is hidden

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

53 files changed

+1072
-0
lines changed

Diff for: ListViewGrouping.sln

+27
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}") = "ListViewGrouping", "ListViewGrouping\ListViewGrouping.csproj", "{B8F64A57-61FF-4FD1-8807-EF3D56470A45}"
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+
{B8F64A57-61FF-4FD1-8807-EF3D56470A45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{B8F64A57-61FF-4FD1-8807-EF3D56470A45}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{B8F64A57-61FF-4FD1-8807-EF3D56470A45}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17+
{B8F64A57-61FF-4FD1-8807-EF3D56470A45}.Release|Any CPU.ActiveCfg = Release|Any CPU
18+
{B8F64A57-61FF-4FD1-8807-EF3D56470A45}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{B8F64A57-61FF-4FD1-8807-EF3D56470A45}.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

Diff for: ListViewGrouping/App.xaml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
3+
xmlns:local="clr-namespace:ListViewGrouping"
4+
x:Class="ListViewGrouping.App">
5+
<Application.Resources>
6+
<ResourceDictionary>
7+
8+
<Color x:Key="PrimaryColor">#512bdf</Color>
9+
<Color x:Key="SecondaryColor">White</Color>
10+
11+
<Style TargetType="Label">
12+
<Setter Property="TextColor" Value="{DynamicResource PrimaryColor}" />
13+
<Setter Property="FontFamily" Value="OpenSansRegular" />
14+
</Style>
15+
16+
<Style TargetType="Button">
17+
<Setter Property="TextColor" Value="{DynamicResource SecondaryColor}" />
18+
<Setter Property="FontFamily" Value="OpenSansRegular" />
19+
<Setter Property="BackgroundColor" Value="{DynamicResource PrimaryColor}" />
20+
<Setter Property="Padding" Value="14,10" />
21+
</Style>
22+
23+
</ResourceDictionary>
24+
</Application.Resources>
25+
</Application>

Diff for: ListViewGrouping/App.xaml.cs

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace ListViewGrouping;
2+
3+
public partial class App : Application
4+
{
5+
public App()
6+
{
7+
InitializeComponent();
8+
9+
MainPage = new ListViewSample();
10+
}
11+
}

Diff for: ListViewGrouping/Helper/Behavior.cs

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using Syncfusion.Maui.ListView;
2+
using Syncfusion.Maui.DataSource;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using System.Text;
7+
using System.Threading.Tasks;
8+
9+
namespace ListViewGrouping
10+
{
11+
public class Behavior : Behavior<Syncfusion.Maui.ListView.SfListView>
12+
{
13+
#region Fields
14+
15+
private Syncfusion.Maui.ListView.SfListView ListView;
16+
17+
#endregion
18+
19+
#region Overrides
20+
protected override void OnAttachedTo(Syncfusion.Maui.ListView.SfListView bindable)
21+
{
22+
ListView = bindable;
23+
ListView.DataSource.GroupDescriptors.Add(new GroupDescriptor()
24+
{
25+
PropertyName = "ContactName",
26+
KeySelector = (object obj1) =>
27+
{
28+
var item = (obj1 as ListViewContactInfo);
29+
return item.ContactName[0].ToString();
30+
},
31+
});
32+
base.OnAttachedTo(bindable);
33+
}
34+
35+
protected override void OnDetachingFrom(Syncfusion.Maui.ListView.SfListView bindable)
36+
{
37+
ListView = null;
38+
base.OnDetachingFrom(bindable);
39+
}
40+
#endregion
41+
}
42+
}
43+
44+

Diff for: ListViewGrouping/ListViewGrouping.csproj

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
5+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows')) and '$(MSBuildRuntimeType)' == 'Full'">$(TargetFrameworks);net6.0-windows10.0.19041</TargetFrameworks>
6+
<OutputType>Exe</OutputType>
7+
<RootNamespace>ListViewGrouping</RootNamespace>
8+
<UseMaui>true</UseMaui>
9+
<SingleProject>true</SingleProject>
10+
<ImplicitUsings>enable</ImplicitUsings>
11+
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
12+
13+
<!-- Display name -->
14+
<ApplicationTitle>ListViewGrouping</ApplicationTitle>
15+
16+
<!-- App Identifier -->
17+
<ApplicationId>com.companyname.listviewgrouping</ApplicationId>
18+
19+
<!-- Versions -->
20+
<ApplicationVersion>1</ApplicationVersion>
21+
22+
<!-- Required for C# Hot Reload -->
23+
<UseInterpreter Condition="'$(Configuration)' == 'Debug'">True</UseInterpreter>
24+
25+
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-ios'">14.2</SupportedOSPlatformVersion>
26+
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-maccatalyst'">14.0</SupportedOSPlatformVersion>
27+
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-android'">21.0</SupportedOSPlatformVersion>
28+
<SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</SupportedOSPlatformVersion>
29+
<TargetPlatformMinVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</TargetPlatformMinVersion>
30+
</PropertyGroup>
31+
32+
<ItemGroup>
33+
<!-- App Icon -->
34+
<MauiIcon Include="Resources\appicon.svg" ForegroundFile="Resources\appiconfg.svg" Color="#512BD4" />
35+
36+
<!-- Splash Screen -->
37+
<MauiSplashScreen Include="Resources\appiconfg.svg" Color="#512BD4" />
38+
39+
<!-- Images -->
40+
<MauiImage Include="Resources\Images\*" />
41+
42+
<!-- Custom Fonts -->
43+
<MauiFont Include="Resources\Fonts\*" />
44+
45+
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
46+
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
47+
</ItemGroup>
48+
49+
<ItemGroup Condition="$(TargetFramework.Contains('-windows'))">
50+
<!-- Required - WinUI does not yet have buildTransitive for everything -->
51+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.0" />
52+
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.0.0.30" />
53+
</ItemGroup>
54+
55+
<ItemGroup>
56+
<None Remove="Resources\Fonts\Roboto-Medium.ttf" />
57+
<None Remove="Resources\Fonts\Roboto-Regular.ttf" />
58+
<None Remove="Resources\Images\people_circle0.png" />
59+
<None Remove="Resources\Images\people_circle1.png" />
60+
<None Remove="Resources\Images\people_circle10.png" />
61+
<None Remove="Resources\Images\people_circle11.png" />
62+
<None Remove="Resources\Images\people_circle12.png" />
63+
<None Remove="Resources\Images\people_circle13.png" />
64+
<None Remove="Resources\Images\people_circle14.png" />
65+
<None Remove="Resources\Images\people_circle15.png" />
66+
<None Remove="Resources\Images\people_circle16.png" />
67+
<None Remove="Resources\Images\people_circle17.png" />
68+
<None Remove="Resources\Images\people_circle18.png" />
69+
<None Remove="Resources\Images\people_circle19.png" />
70+
<None Remove="Resources\Images\people_circle2.png" />
71+
<None Remove="Resources\Images\people_circle3.png" />
72+
<None Remove="Resources\Images\people_circle4.png" />
73+
<None Remove="Resources\Images\people_circle5.png" />
74+
<None Remove="Resources\Images\people_circle6.png" />
75+
<None Remove="Resources\Images\people_circle7.png" />
76+
<None Remove="Resources\Images\people_circle8.png" />
77+
<None Remove="Resources\Images\people_circle9.png" />
78+
</ItemGroup>
79+
80+
<ItemGroup>
81+
<PackageReference Include="Syncfusion.Maui.ListView" Version="19.4.56-preview" />
82+
</ItemGroup>
83+
84+
<ItemGroup>
85+
<MauiXaml Update="Views\ListViewSample.xaml">
86+
<Generator>MSBuild:Compile</Generator>
87+
</MauiXaml>
88+
</ItemGroup>
89+
90+
<PropertyGroup Condition="$(TargetFramework.Contains('-windows'))">
91+
<OutputType>WinExe</OutputType>
92+
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
93+
</PropertyGroup>
94+
95+
</Project>

Diff for: ListViewGrouping/MauiProgram.cs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
namespace ListViewGrouping;
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("Roboto-Regular.ttf", "Roboto");
14+
});
15+
16+
return builder.Build();
17+
}
18+
}

Diff for: ListViewGrouping/Model/ListViewContactInfo.cs

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.ComponentModel;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
8+
namespace ListViewGrouping
9+
{
10+
public class ListViewContactInfo : INotifyPropertyChanged
11+
{
12+
#region Fields
13+
14+
private string? contactName;
15+
private string? contactNo;
16+
private ImageSource? image;
17+
private string? contactType;
18+
19+
#endregion
20+
21+
#region Constructor
22+
23+
public ListViewContactInfo()
24+
{
25+
26+
}
27+
28+
#endregion
29+
30+
#region Public Properties
31+
32+
public string? ContactName
33+
{
34+
get { return this.contactName; }
35+
set
36+
{
37+
this.contactName = value;
38+
RaisePropertyChanged("ContactName");
39+
}
40+
}
41+
42+
public string? ContactNumber
43+
{
44+
get { return contactNo; }
45+
set
46+
{
47+
this.contactNo = value;
48+
RaisePropertyChanged("ContactNumber");
49+
}
50+
}
51+
52+
public string? ContactType
53+
{
54+
get { return contactType; }
55+
set
56+
{
57+
this.contactType = value;
58+
RaisePropertyChanged("ContactType");
59+
}
60+
}
61+
62+
public ImageSource? ContactImage
63+
{
64+
get { return this.image; }
65+
set
66+
{
67+
if (value != null)
68+
{
69+
this.image = value;
70+
this.RaisePropertyChanged("ContactImage");
71+
}
72+
}
73+
}
74+
75+
#endregion
76+
77+
#region INotifyPropertyChanged implementation
78+
79+
public event PropertyChangedEventHandler? PropertyChanged;
80+
81+
private void RaisePropertyChanged(String name)
82+
{
83+
if (PropertyChanged != null)
84+
this.PropertyChanged(this, new PropertyChangedEventArgs(name));
85+
}
86+
87+
#endregion
88+
}
89+
}

0 commit comments

Comments
 (0)