Skip to content

Commit 5aae176

Browse files
Review corrections updated.
1 parent 80cefd8 commit 5aae176

File tree

9 files changed

+22
-16
lines changed

9 files changed

+22
-16
lines changed

MinMaxDateEditor/App.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
</ResourceDictionary.MergedDictionaries>
1212
</ResourceDictionary>
1313
</Application.Resources>
14-
</Application>
14+
</Application>

MinMaxDateEditor/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ public App()
88

99
MainPage = new AppShell();
1010
}
11-
}
11+
}

MinMaxDateEditor/AppShell.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ public AppShell()
66
{
77
InitializeComponent();
88
}
9-
}
9+
}

MinMaxDateEditor/MainPage.xaml.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@ public MainPage()
66
{
77
InitializeComponent();
88
}
9-
10-
}
11-
9+
}

MinMaxDateEditor/MinMaxDate/Behavior/DataFormBehavior.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ protected override void OnAttachedTo(SfDataForm dataForm)
1111
dataForm.RegisterEditor("AppointmentTime", DataFormEditorType.Time);
1212
dataForm.GenerateDataFormItem += OnGenerateDataItem;
1313
}
14-
1514
private void OnGenerateDataItem(object sender, GenerateDataFormItemEventArgs e)
1615
{
1716
if (e.DataFormItem != null && e.DataFormItem is DataFormDateItem dateItem)
@@ -20,4 +19,14 @@ private void OnGenerateDataItem(object sender, GenerateDataFormItemEventArgs e)
2019
dateItem.MaximumDisplayDate = new DateTime(2022, 12, 25);
2120
}
2221
}
23-
}
22+
protected override void OnDetachingFrom(SfDataForm dataForm)
23+
{
24+
base.OnDetachingFrom(dataForm);
25+
if (dataForm != null)
26+
{
27+
dataForm.GenerateDataFormItem -= this.OnGenerateDataItem;
28+
}
29+
30+
dataForm = null;
31+
}
32+
}

MinMaxDateEditor/MinMaxDate/Model/DataFormModel.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ public class DataFormModel
66
public string LastName { get; set; }
77
public string AppointmentDate { get; set; }
88
public string AppointmentTime { get; set; }
9-
}
10-
9+
}

MinMaxDateEditor/MinMaxDate/ViewModel/DataFormViewModel.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
public class DataFormViewModel
44
{
55
public DataFormModel DataFormModel { get; set; }
6-
76
public DataFormViewModel()
87
{
98
this.DataFormModel = new DataFormModel();
109
}
11-
}
10+
}

MinMaxDateEditor/Platforms/Windows/App.xaml.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@ public App()
2020
}
2121

2222
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
23-
}
24-
23+
}

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
# set-the-minimum-and-maximum-date-for-the-date-editor-in-.NET-MAUI-DataForm
2-
This repository contains a sample of how to set the minimum and maximum date for the date editor in .NET MAUI DataForm (SfDataForm)?
1+
# How to set the minimum and maximum date for the date editor in .NET MAUI DataForm (SfDataForm)
2+
This repository contains a sample of how to set the minimum and maximum date for the date editor in [.NET MAUI DataForm (SfDataForm)](https://help.syncfusion.com/maui/dataform/getting-started) control.
3+
4+
# SyncfusionControls

0 commit comments

Comments
 (0)