Skip to content

Commit 2671b88

Browse files
committed
GettingStarted UG committed
1 parent 6933e98 commit 2671b88

29 files changed

+736
-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.0.31611.283
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ListViewMaui", "ListViewMaui\ListViewMaui.csproj", "{D85E18DE-97BB-40E0-8D9B-520FC1C714EF}"
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+
{D85E18DE-97BB-40E0-8D9B-520FC1C714EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{D85E18DE-97BB-40E0-8D9B-520FC1C714EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{D85E18DE-97BB-40E0-8D9B-520FC1C714EF}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17+
{D85E18DE-97BB-40E0-8D9B-520FC1C714EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
18+
{D85E18DE-97BB-40E0-8D9B-520FC1C714EF}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{D85E18DE-97BB-40E0-8D9B-520FC1C714EF}.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/App.xaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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:ListViewMaui"
5+
x:Class="ListViewMaui.App"
6+
windows:Application.ImageDirectory="Assets">
7+
<Application.Resources>
8+
<ResourceDictionary>
9+
10+
<Color x:Key="PrimaryColor">#512bdf</Color>
11+
<Color x:Key="SecondaryColor">White</Color>
12+
13+
<Style TargetType="Label">
14+
<Setter Property="TextColor" Value="{DynamicResource PrimaryColor}" />
15+
<Setter Property="FontFamily" Value="OpenSansRegular" />
16+
</Style>
17+
18+
<Style TargetType="Button">
19+
<Setter Property="TextColor" Value="{DynamicResource SecondaryColor}" />
20+
<Setter Property="FontFamily" Value="OpenSansRegular" />
21+
<Setter Property="BackgroundColor" Value="{DynamicResource PrimaryColor}" />
22+
<Setter Property="Padding" Value="14,10" />
23+
</Style>
24+
25+
</ResourceDictionary>
26+
</Application.Resources>
27+
</Application>

ListViewMaui/App.xaml.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using Microsoft.Maui;
2+
using Microsoft.Maui.Controls;
3+
using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
4+
using Application = Microsoft.Maui.Controls.Application;
5+
6+
namespace ListViewMaui
7+
{
8+
public partial class App : Application
9+
{
10+
public App()
11+
{
12+
InitializeComponent();
13+
14+
MainPage = new MainPage();
15+
}
16+
}
17+
}

ListViewMaui/ListViewMaui.csproj

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
5+
<OutputType>Exe</OutputType>
6+
<RootNamespace>ListViewMaui</RootNamespace>
7+
<UseMaui>true</UseMaui>
8+
<SingleProject>true</SingleProject>
9+
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
10+
11+
<!-- Display name -->
12+
<ApplicationTitle>ListViewMaui</ApplicationTitle>
13+
14+
<!-- App Identifier -->
15+
<ApplicationId>com.companyname.ListViewMaui</ApplicationId>
16+
17+
<!-- Versions -->
18+
<ApplicationVersion>1</ApplicationVersion>
19+
20+
<!-- Required for C# Hot Reload -->
21+
<UseInterpreter Condition="'$(Configuration)' == 'Debug'">True</UseInterpreter>
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.17763.0</SupportedOSPlatformVersion>
27+
<TargetPlatformMinVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.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" />
36+
37+
<!-- Images -->
38+
<MauiImage Include="Resources\Images\*" />
39+
40+
<!-- Custom Fonts -->
41+
<MauiFont Include="Resources\Fonts\*" />
42+
</ItemGroup>
43+
44+
<ItemGroup Condition="$(TargetFramework.Contains('-windows'))">
45+
<!-- Required - WinUI does not yet have buildTransitive for everything -->
46+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.0-preview3" />
47+
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.0.0.29-preview3" />
48+
</ItemGroup>
49+
50+
<ItemGroup>
51+
<PackageReference Include="Syncfusion.Maui.Core" Version="19.3.1.97" />
52+
<PackageReference Include="Syncfusion.Maui.DataSource" Version="19.3.1.16" />
53+
<PackageReference Include="Syncfusion.Maui.GridCommon" Version="19.3.1.10" />
54+
<PackageReference Include="Syncfusion.Maui.ListView" Version="19.3.1.42" />
55+
</ItemGroup>
56+
57+
<PropertyGroup Condition="$(TargetFramework.Contains('-windows'))">
58+
<OutputType>WinExe</OutputType>
59+
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
60+
</PropertyGroup>
61+
62+
</Project>

ListViewMaui/MauiProgram.cs

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

ListViewMaui/Model/BookInfo.cs

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
using System.ComponentModel;
2+
3+
namespace ListViewMaui
4+
{
5+
public class BookInfo : INotifyPropertyChanged
6+
{
7+
#region Fields
8+
9+
private string bookName;
10+
private string bookDesc;
11+
12+
#endregion
13+
14+
#region Constructor
15+
16+
public BookInfo()
17+
{
18+
19+
}
20+
21+
#endregion
22+
23+
#region Properties
24+
25+
public string BookName
26+
{
27+
get { return bookName; }
28+
set
29+
{
30+
bookName = value;
31+
OnPropertyChanged("BookName");
32+
}
33+
}
34+
35+
public string BookDescription
36+
{
37+
get { return bookDesc; }
38+
set
39+
{
40+
bookDesc = value;
41+
OnPropertyChanged("BookDescription");
42+
}
43+
}
44+
45+
#endregion
46+
47+
#region Interface Member
48+
49+
public event PropertyChangedEventHandler PropertyChanged;
50+
51+
public void OnPropertyChanged(string name)
52+
{
53+
if (this.PropertyChanged != null)
54+
this.PropertyChanged(this, new PropertyChangedEventArgs(name));
55+
}
56+
57+
#endregion
58+
}
59+
}
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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using Android.App;
2+
using Android.Content.PM;
3+
using Microsoft.Maui;
4+
5+
namespace ListViewMaui
6+
{
7+
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize)]
8+
public class MainActivity : MauiAppCompatActivity
9+
{
10+
}
11+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System;
2+
using Android.App;
3+
using Android.Runtime;
4+
using Microsoft.Maui;
5+
using Microsoft.Maui.Hosting;
6+
7+
namespace ListViewMaui
8+
{
9+
[Application]
10+
public class MainApplication : MauiApplication
11+
{
12+
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
13+
: base(handle, ownership)
14+
{
15+
}
16+
17+
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
18+
}
19+
}
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+
<resources>
3+
<color name="colorPrimary">#512BD4</color>
4+
<color name="colorPrimaryDark">#2B0B98</color>
5+
<color name="colorAccent">#2B0B98</color>
6+
</resources>

0 commit comments

Comments
 (0)