Skip to content

Commit 594a3d5

Browse files
Merge pull request #2 from SyncfusionExamples/ReadMeChanges
Made README.md file changes
2 parents 8bc5c26 + f9e1949 commit 594a3d5

Some content is hidden

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

59 files changed

+1459
-0
lines changed

ListViewMaui.sln

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.7.34031.279
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ListViewMaui", "ListViewMaui\ListViewMaui.csproj", "{14189095-2B49-49C3-A18D-D64AFD807E0B}"
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+
{14189095-2B49-49C3-A18D-D64AFD807E0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{14189095-2B49-49C3-A18D-D64AFD807E0B}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{14189095-2B49-49C3-A18D-D64AFD807E0B}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17+
{14189095-2B49-49C3-A18D-D64AFD807E0B}.Release|Any CPU.ActiveCfg = Release|Any CPU
18+
{14189095-2B49-49C3-A18D-D64AFD807E0B}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{14189095-2B49-49C3-A18D-D64AFD807E0B}.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 = {50412815-3CE1-4526-90AC-E5511EC98A31}
26+
EndGlobalSection
27+
EndGlobal

ListViewMaui/App.xaml

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+
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
xmlns:local="clr-namespace:ListViewMaui"
5+
x:Class="ListViewMaui.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+
</ResourceDictionary>
13+
</Application.Resources>
14+
</Application>

ListViewMaui/App.xaml.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace ListViewMaui
2+
{
3+
public partial class App : Application
4+
{
5+
public App()
6+
{
7+
InitializeComponent();
8+
9+
MainPage = new AppShell();
10+
}
11+
}
12+
}

ListViewMaui/AppShell.xaml

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="ListViewMaui.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:ListViewMaui"
7+
Shell.FlyoutBehavior="Disabled">
8+
9+
<ShellContent
10+
Title="Home"
11+
ContentTemplate="{DataTemplate local:MainPage}"
12+
Route="MainPage" />
13+
14+
</Shell>

ListViewMaui/AppShell.xaml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace ListViewMaui
2+
{
3+
public partial class AppShell : Shell
4+
{
5+
public AppShell()
6+
{
7+
InitializeComponent();
8+
}
9+
}
10+
}

ListViewMaui/Helper/Behavior.cs

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
using Syncfusion.Maui.ListView;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
8+
namespace ListViewMaui
9+
{
10+
#region Behavior
11+
internal class Behavior : Behavior<ContentPage>
12+
{
13+
#region Fields
14+
15+
SfListView ListView;
16+
Button UpdateButton;
17+
ListViewScrollView ScrollView;
18+
#endregion
19+
20+
#region Overrides
21+
22+
protected override void OnAttachedTo(ContentPage bindable)
23+
{
24+
ListView = bindable.FindByName<SfListView>("listView");
25+
UpdateButton = bindable.FindByName<Button>("updateButton");
26+
27+
UpdateButton.Clicked += UpdateButton_Clicked;
28+
29+
base.OnAttachedTo(bindable);
30+
}
31+
32+
protected override void OnDetachingFrom(ContentPage bindable)
33+
{
34+
UpdateButton.Clicked -= UpdateButton_Clicked;
35+
UpdateButton = null;
36+
ListView = null;
37+
base.OnDetachingFrom(bindable);
38+
}
39+
#endregion
40+
41+
#region Callback
42+
43+
private void UpdateButton_Clicked(object sender, EventArgs e)
44+
{
45+
var viewModel = ListView.BindingContext as ContactsViewModel;
46+
viewModel.GenerateInfo();
47+
ListView.ItemsSource = viewModel.ContactsInfo;
48+
}
49+
50+
#endregion
51+
}
52+
53+
#endregion
54+
}

ListViewMaui/ListViewMaui.csproj

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
5+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.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);net7.0-tizen</TargetFrameworks> -->
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>ListViewMaui</RootNamespace>
10+
<UseMaui>true</UseMaui>
11+
<SingleProject>true</SingleProject>
12+
<ImplicitUsings>enable</ImplicitUsings>
13+
14+
<!-- Display name -->
15+
<ApplicationTitle>ListViewMaui</ApplicationTitle>
16+
17+
<!-- App Identifier -->
18+
<ApplicationId>com.companyname.listviewmaui</ApplicationId>
19+
<ApplicationIdGuid>2b615375-79d4-408f-83e6-f37cc7e69b4a</ApplicationIdGuid>
20+
21+
<!-- Versions -->
22+
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
23+
<ApplicationVersion>1</ApplicationVersion>
24+
25+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
26+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
27+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
28+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
29+
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
30+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
31+
</PropertyGroup>
32+
33+
<ItemGroup>
34+
<!-- App Icon -->
35+
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
36+
37+
<!-- Splash Screen -->
38+
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
39+
40+
<!-- Images -->
41+
<MauiImage Include="Resources\Images\*" />
42+
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />
43+
44+
<!-- Custom Fonts -->
45+
<MauiFont Include="Resources\Fonts\*" />
46+
47+
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
48+
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
49+
</ItemGroup>
50+
51+
<ItemGroup>
52+
<None Remove="Resources\Images\people_circle0.png" />
53+
<None Remove="Resources\Images\people_circle1.png" />
54+
<None Remove="Resources\Images\people_circle10.png" />
55+
<None Remove="Resources\Images\people_circle11.png" />
56+
<None Remove="Resources\Images\people_circle12.png" />
57+
<None Remove="Resources\Images\people_circle13.png" />
58+
<None Remove="Resources\Images\people_circle14.png" />
59+
<None Remove="Resources\Images\people_circle15.png" />
60+
<None Remove="Resources\Images\people_circle16.png" />
61+
<None Remove="Resources\Images\people_circle17.png" />
62+
<None Remove="Resources\Images\people_circle18.png" />
63+
<None Remove="Resources\Images\people_circle19.png" />
64+
<None Remove="Resources\Images\people_circle2.png" />
65+
<None Remove="Resources\Images\people_circle3.png" />
66+
<None Remove="Resources\Images\people_circle4.png" />
67+
<None Remove="Resources\Images\people_circle5.png" />
68+
<None Remove="Resources\Images\people_circle6.png" />
69+
<None Remove="Resources\Images\people_circle7.png" />
70+
<None Remove="Resources\Images\people_circle8.png" />
71+
<None Remove="Resources\Images\people_circle9.png" />
72+
</ItemGroup>
73+
74+
<ItemGroup>
75+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
76+
<PackageReference Include="Syncfusion.Maui.ListView" Version="*" />
77+
</ItemGroup>
78+
79+
</Project>

ListViewMaui/MauiProgram.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using Microsoft.Extensions.Logging;
2+
using Syncfusion.Maui.Core.Hosting;
3+
4+
namespace ListViewMaui
5+
{
6+
public static class MauiProgram
7+
{
8+
public static MauiApp CreateMauiApp()
9+
{
10+
var builder = MauiApp.CreateBuilder();
11+
builder
12+
.UseMauiApp<App>()
13+
.ConfigureSyncfusionCore()
14+
.ConfigureFonts(fonts =>
15+
{
16+
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
17+
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
18+
});
19+
20+
#if DEBUG
21+
builder.Logging.AddDebug();
22+
#endif
23+
24+
return builder.Build();
25+
}
26+
}
27+
}

ListViewMaui/Model/Contacts.cs

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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 ListViewMaui
9+
{
10+
public class Contacts : INotifyPropertyChanged
11+
{
12+
#region Fields
13+
14+
private string contactName;
15+
private string contactNumber;
16+
private ImageSource image;
17+
18+
#endregion
19+
20+
#region Constructor
21+
public Contacts(string name, string number)
22+
{
23+
contactName = name;
24+
contactNumber = number;
25+
}
26+
#endregion
27+
28+
#region Properties
29+
public string ContactName
30+
{
31+
get { return contactName; }
32+
set
33+
{
34+
if (contactName != value)
35+
{
36+
contactName = value;
37+
this.RaisedOnPropertyChanged("ContactName");
38+
}
39+
}
40+
}
41+
42+
public string ContactNumber
43+
{
44+
get { return contactNumber; }
45+
set
46+
{
47+
if (contactNumber != value)
48+
{
49+
contactNumber = value;
50+
this.RaisedOnPropertyChanged("ContactNumber");
51+
}
52+
}
53+
}
54+
55+
public ImageSource ContactImage
56+
{
57+
get { return this.image; }
58+
set
59+
{
60+
this.image = value;
61+
this.RaisedOnPropertyChanged("ContactImage");
62+
}
63+
}
64+
65+
#endregion
66+
67+
#region INotifyPropertyChanged Members
68+
69+
public event PropertyChangedEventHandler PropertyChanged;
70+
71+
public void RaisedOnPropertyChanged(string _PropertyName)
72+
{
73+
if (PropertyChanged != null)
74+
{
75+
PropertyChanged(this, new PropertyChangedEventArgs(_PropertyName));
76+
}
77+
}
78+
#endregion
79+
}
80+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
4+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
5+
<uses-permission android:name="android.permission.INTERNET" />
6+
</manifest>

0 commit comments

Comments
 (0)