Skip to content

Commit dd4bde5

Browse files
Updatred
1 parent cca663f commit dd4bde5

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@
5151

5252
<ItemGroup>
5353
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="*" />
54-
<PackageReference Include="Syncfusion.Maui.DataForm" Version="*" />
5554
</ItemGroup>
5655

5756
<ItemGroup>
5857
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
58+
<PackageReference Include="Syncfusion.Maui.DataForm" Version="*" />
5959
</ItemGroup>
6060

6161
</Project>

0 commit comments

Comments
 (0)