Skip to content

Commit f2706cd

Browse files
Merge pull request #3 from SriRadheshNagS/UpdateSample
950873-Updated .NET Version for Dataform sample
2 parents 43f99f1 + dd4bde5 commit f2706cd

File tree

6 files changed

+18
-32
lines changed

6 files changed

+18
-32
lines changed

ValidateOnLoad/ValidateOnLoad/App.xaml.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ public partial class App : Application
55
public App()
66
{
77
InitializeComponent();
8-
9-
MainPage = new AppShell();
108
}
9+
10+
protected override Window CreateWindow(IActivationState? activationState)
11+
{
12+
return new Window(new MainPage());
13+
}
1114
}

ValidateOnLoad/ValidateOnLoad/AppShell.xaml

-14
This file was deleted.

ValidateOnLoad/ValidateOnLoad/AppShell.xaml.cs

-9
This file was deleted.

ValidateOnLoad/ValidateOnLoad/MainPage.xaml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
33
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
44
xmlns:local="clr-namespace:ValidateOnLoad"
5+
x:DataType="local:DataFormViewModel"
56
xmlns:dataForm="clr-namespace:Syncfusion.Maui.DataForm;assembly=Syncfusion.Maui.DataForm"
67
x:Class="ValidateOnLoad.MainPage">
78

ValidateOnLoad/ValidateOnLoad/Sample/Behavior/DataFormBehavior.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace ValidateOnLoad
44
{
55
public class DataFormBehavior : Behavior<ContentPage>
66
{
7-
private SfDataForm dataForm;
7+
private SfDataForm? dataForm;
88
protected override void OnAttachedTo(ContentPage bindable)
99
{
1010
base.OnAttachedTo(bindable);
@@ -18,9 +18,9 @@ protected override void OnAttachedTo(ContentPage bindable)
1818
}
1919
}
2020

21-
private void OnLoaded(object sender, EventArgs e)
21+
private void OnLoaded(object? sender, EventArgs e)
2222
{
23-
this.dataForm.Validate();
23+
this.dataForm?.Validate();
2424
}
2525

2626
protected override void OnDetachingFrom(ContentPage bindable)

ValidateOnLoad/ValidateOnLoad/ValidateOnLoad.csproj

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<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>
4+
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
5+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
66
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
77
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
88
<OutputType>Exe</OutputType>
99
<RootNamespace>ValidateOnLoad</RootNamespace>
1010
<UseMaui>true</UseMaui>
1111
<SingleProject>true</SingleProject>
1212
<ImplicitUsings>enable</ImplicitUsings>
13+
<Nullable>enable</Nullable>
1314

1415
<!-- Display name -->
1516
<ApplicationTitle>ValidateOnLoad</ApplicationTitle>
@@ -49,8 +50,12 @@
4950
</ItemGroup>
5051

5152
<ItemGroup>
52-
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
53-
<PackageReference Include="Syncfusion.Maui.DataForm" Version="*" />
53+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="*" />
54+
</ItemGroup>
55+
56+
<ItemGroup>
57+
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
58+
<PackageReference Include="Syncfusion.Maui.DataForm" Version="*" />
5459
</ItemGroup>
5560

5661
</Project>

0 commit comments

Comments
 (0)