Skip to content

Commit 013daab

Browse files
Merge pull request #1 from SyncfusionExamples/MAUI-5037-CustomizeTimeFormat
MAUI-5037-Change the time format of the time editor
2 parents f3756b3 + ba2cc61 commit 013daab

40 files changed

+1200
-2
lines changed

README.md

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,54 @@
1-
# change-the-time-format-of-the-time-editor-in-.NET-MAUI-DataForm-SfDataForm-
2-
This repository contains a sample of how to change the time format of the time editor in .NET MAUI DataForm (SfDataForm)?
1+
# How to change the time format of the time editor in .NET MAUI DataForm (SfDataForm)
2+
This repository contains a sample of how to change the time format of the time editor in [.NET MAUI DataForm (SfDataForm)](https://help.syncfusion.com/maui/dataform/getting-started) control.
3+
4+
Please refer the KB through this link.
5+
6+
## SyncfusionControls
7+
8+
This project used the following Syncfusion control(s):
9+
* [SfDataForm](https://www.syncfusion.com/maui-controls/maui-dataform)
10+
11+
## Supported platforms
12+
13+
.NET Multi-platform App UI (.NET MAUI) apps can be written for the following platforms:
14+
15+
* Android 5.0 (API 21) or higher.
16+
* iOS 11 or higher, using the latest release of Xcode.
17+
* macOS 10.15 or higher, using Mac Catalyst.
18+
* Windows 11 and Windows 10 version 1809 or higher, using [Windows UI Library (WinUI) 3](https://learn.microsoft.com/en-us/windows/apps/winui/winui3/).
19+
20+
## Requirements to run the sample
21+
22+
* [Visual Studio 2022 Preview](https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-notes-preview) version 17.3.4 or higher (.NET MAUI version 6.0.547) with .NET 6.0 and .NET 7.0
23+
* [Microsoft Visual Studio 2022](https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-notes) version 17.4.1 with (.NET MAUI version 6.0.547) with .NET 6.0 and .NET 7.0
24+
* [Visual Studio 2022 for Mac Preview](https://visualstudio.microsoft.com/vs/mac/preview/) version 17.4 (.NET MAUI version 6.0.547) with .NET 6.0 and .NET 7.0
25+
26+
Refer to the following link for more details: [System Requirements](https://help.syncfusion.com/maui/system-requirements)
27+
28+
## How to run the sample
29+
30+
1. Clone the sample and open it in Visual Studio 2022 preview.
31+
32+
*Note: If you download the sample using the "Download ZIP" option, right-click it, select Properties, and then select Unblock.*
33+
34+
2. Register your license key in the App.cs file as demonstrated in the following code.
35+
36+
public App()
37+
{
38+
//Register Syncfusion license
39+
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("YOUR LICENSE KEY");
40+
41+
InitializeComponent();
42+
43+
MainPage = new MainPage();
44+
}
45+
46+
Refer to this [link](https://help.syncfusion.com/maui/licensing/overview) for more details.
47+
48+
3. Clean and build the application.
49+
50+
4. Run the application.
51+
52+
## License
53+
54+
Syncfusion has no liability for any damage or consequence that may arise from using or viewing the samples. The samples are for demonstrative purposes. If you choose to use or access the samples, you agree to not hold Syncfusion liable, in any form, for any damage related to use, for accessing, or viewing the samples. By accessing, viewing, or seeing the samples, you acknowledge and agree Syncfusion’s samples will not allow you seek injunctive relief in any form for any claim related to the sample. If you do not agree to this, do not view, access, utilize, or otherwise do anything with Syncfusion’s samples.

TimeFormat/TimeFormat.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}") = "TimeFormat", "TimeFormat\TimeFormat.csproj", "{717DACA8-D236-41C3-A393-67E2893862D1}"
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+
{717DACA8-D236-41C3-A393-67E2893862D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{717DACA8-D236-41C3-A393-67E2893862D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{717DACA8-D236-41C3-A393-67E2893862D1}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17+
{717DACA8-D236-41C3-A393-67E2893862D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
18+
{717DACA8-D236-41C3-A393-67E2893862D1}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{717DACA8-D236-41C3-A393-67E2893862D1}.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

TimeFormat/TimeFormat/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:TimeFormat"
5+
x:Class="TimeFormat.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>

TimeFormat/TimeFormat/App.xaml.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace TimeFormat;
2+
3+
public partial class App : Application
4+
{
5+
public App()
6+
{
7+
InitializeComponent();
8+
9+
MainPage = new AppShell();
10+
}
11+
}
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="TimeFormat.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:TimeFormat"
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 TimeFormat;
2+
3+
public partial class AppShell : Shell
4+
{
5+
public AppShell()
6+
{
7+
InitializeComponent();
8+
}
9+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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:local="clr-namespace:TimeFormat"
5+
xmlns:dataForm="clr-namespace:Syncfusion.Maui.DataForm;assembly=Syncfusion.Maui.DataForm"
6+
x:Class="TimeFormat.MainPage">
7+
8+
<dataForm:SfDataForm x:Name="dataForm"
9+
DataObject="{Binding DataFormModel}">
10+
<dataForm:SfDataForm.BindingContext>
11+
<local:DataFormViewModel/>
12+
</dataForm:SfDataForm.BindingContext>
13+
<dataForm:SfDataForm.Behaviors>
14+
<local:DataFormBehavior/>
15+
</dataForm:SfDataForm.Behaviors>
16+
</dataForm:SfDataForm>
17+
</ContentPage>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace TimeFormat;
2+
3+
public partial class MainPage : ContentPage
4+
{
5+
public MainPage()
6+
{
7+
InitializeComponent();
8+
}
9+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using Microsoft.Extensions.Logging;
2+
using Syncfusion.Maui.Core.Hosting;
3+
4+
namespace TimeFormat;
5+
6+
public static class MauiProgram
7+
{
8+
public static MauiApp CreateMauiApp()
9+
{
10+
var builder = MauiApp.CreateBuilder();
11+
builder
12+
.ConfigureSyncfusionCore()
13+
.UseMauiApp<App>()
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+
}
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)