Skip to content

Commit 22b0da6

Browse files
Sample added
1 parent e237d59 commit 22b0da6

32 files changed

+1107
-0
lines changed

ListViewMaui/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.0.31611.283
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ListViewMaui", "ListViewMaui\ListViewMaui.csproj", "{BB80D341-A1CA-467C-B555-AEFCDCD4F28C}"
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+
{BB80D341-A1CA-467C-B555-AEFCDCD4F28C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{BB80D341-A1CA-467C-B555-AEFCDCD4F28C}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{BB80D341-A1CA-467C-B555-AEFCDCD4F28C}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17+
{BB80D341-A1CA-467C-B555-AEFCDCD4F28C}.Release|Any CPU.ActiveCfg = Release|Any CPU
18+
{BB80D341-A1CA-467C-B555-AEFCDCD4F28C}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{BB80D341-A1CA-467C-B555-AEFCDCD4F28C}.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

ListViewMaui/ListViewMaui/App.xaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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 Source="Resources/Styles.xaml" />
8+
</Application.Resources>
9+
</Application>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace ListViewMaui;
2+
3+
public partial class App : Application
4+
{
5+
public App()
6+
{
7+
InitializeComponent();
8+
9+
MainPage = new MainPage();
10+
}
11+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using Syncfusion.Maui.ListView;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Globalization;
5+
using System.Linq;
6+
using System.Text;
7+
using System.Threading.Tasks;
8+
9+
namespace ListViewMaui
10+
{
11+
#region SeparatorVisibilityConverter
12+
public class SeparatorVisibilityConverter : IValueConverter
13+
{
14+
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
15+
{
16+
var listView = parameter as SfListView;
17+
18+
if (value == null)
19+
return false;
20+
21+
return listView.DataSource.DisplayItems[listView.DataSource.DisplayItems.Count - 1] != value;
22+
}
23+
24+
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
25+
{
26+
throw new NotImplementedException();
27+
}
28+
}
29+
#endregion
30+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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>ListViewMaui</RootNamespace>
8+
<UseMaui>true</UseMaui>
9+
<SingleProject>true</SingleProject>
10+
<ImplicitUsings>enable</ImplicitUsings>
11+
12+
<!-- Display name -->
13+
<ApplicationTitle>ListViewMaui</ApplicationTitle>
14+
15+
<!-- App Identifier -->
16+
<ApplicationId>com.companyname.listviewmaui</ApplicationId>
17+
<ApplicationId Condition="$(TargetFramework.Contains('-windows'))">5884ABA5-1FD3-4BF1-B232-4CF1C2A53C2C</ApplicationId>
18+
19+
<!-- Versions -->
20+
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
21+
<ApplicationVersion>1</ApplicationVersion>
22+
23+
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-ios'">14.2</SupportedOSPlatformVersion>
24+
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-maccatalyst'">14.0</SupportedOSPlatformVersion>
25+
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-android'">21.0</SupportedOSPlatformVersion>
26+
<SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.18362.0</SupportedOSPlatformVersion>
27+
<TargetPlatformMinVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.18362.0</TargetPlatformMinVersion>
28+
</PropertyGroup>
29+
30+
<ItemGroup>
31+
<!-- App Icon -->
32+
<MauiIcon Include="Resources\appicon.svg" ForegroundFile="Resources\appiconfg.svg" Color="#512BD4" />
33+
34+
<!-- Splash Screen -->
35+
<MauiSplashScreen Include="Resources\appiconfg.svg" Color="#512BD4" BaseSize="128,128" />
36+
37+
<!-- Images -->
38+
<MauiImage Include="Resources\Images\*" />
39+
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />
40+
41+
<!-- Custom Fonts -->
42+
<MauiFont Include="Resources\Fonts\*" />
43+
44+
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
45+
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
46+
</ItemGroup>
47+
48+
<ItemGroup>
49+
<PackageReference Include="Syncfusion.Maui.ListView" Version="20.1.51-preview" />
50+
</ItemGroup>
51+
52+
</Project>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Syncfusion.Maui.ListView.Hosting;
2+
3+
namespace ListViewMaui;
4+
5+
public static class MauiProgram
6+
{
7+
public static MauiApp CreateMauiApp()
8+
{
9+
var builder = MauiApp.CreateBuilder();
10+
builder
11+
.UseMauiApp<App>()
12+
.ConfigureFonts(fonts =>
13+
{
14+
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
15+
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
16+
});
17+
18+
builder.ConfigureSyncfusionListView();
19+
return builder.Build();
20+
}
21+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using Microsoft.Maui.Controls;
2+
using System.ComponentModel;
3+
4+
5+
namespace ListViewMaui
6+
{
7+
#region BookInfo
8+
public class BookInfo : INotifyPropertyChanged
9+
{
10+
#region Fields
11+
private string bookName;
12+
private string bookDesc;
13+
#endregion
14+
15+
#region Properties
16+
public string BookName
17+
{
18+
get { return bookName; }
19+
set
20+
{
21+
bookName = value;
22+
OnPropertyChanged("BookName");
23+
}
24+
}
25+
26+
public string BookDescription
27+
{
28+
get { return bookDesc; }
29+
set
30+
{
31+
bookDesc = value;
32+
OnPropertyChanged("BookDescription");
33+
}
34+
}
35+
#endregion
36+
37+
#region INotifyPropertyChanged members
38+
public event PropertyChangedEventHandler PropertyChanged;
39+
40+
public void OnPropertyChanged(string name)
41+
{
42+
if (this.PropertyChanged != null)
43+
this.PropertyChanged(this, new PropertyChangedEventArgs(name));
44+
}
45+
#endregion
46+
}
47+
#endregion
48+
}
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+
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31" />
4+
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
5+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
6+
</manifest>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using Android.App;
2+
using Android.Content.PM;
3+
using Android.OS;
4+
5+
namespace ListViewMaui;
6+
7+
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
8+
public class MainActivity : MauiAppCompatActivity
9+
{
10+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using Android.App;
2+
using Android.Runtime;
3+
4+
namespace ListViewMaui;
5+
6+
[Application]
7+
public class MainApplication : MauiApplication
8+
{
9+
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
10+
: base(handle, ownership)
11+
{
12+
}
13+
14+
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
15+
}

0 commit comments

Comments
 (0)