-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1706 from riganti/fix/nullable-command-change
Repro for a bug with null assignment
- Loading branch information
Showing
10 changed files
with
179 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...mon/ViewModels/FeatureSamples/ViewModelDeserialization/PropertyNullAssignmentViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using DotVVM.Framework.ViewModel; | ||
using DotVVM.Framework.Hosting; | ||
|
||
namespace DotVVM.Samples.Common.ViewModels.FeatureSamples.ViewModelDeserialization | ||
{ | ||
public class PropertyNullAssignmentViewModel : DotvvmViewModelBase | ||
{ | ||
|
||
public DateTime? NullableDateTime { get; set; } | ||
|
||
public DateTime Value { get; set; } = new DateTime(2023, 1, 2, 3, 4, 5, 678); | ||
|
||
public void SetNullableDateTimeToNull() | ||
{ | ||
NullableDateTime = null; | ||
} | ||
} | ||
} | ||
|
21 changes: 21 additions & 0 deletions
21
...mples/Common/Views/FeatureSamples/ViewModelDeserialization/PropertyNullAssignment.dothtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@viewModel DotVVM.Samples.Common.ViewModels.FeatureSamples.ViewModelDeserialization.PropertyNullAssignmentViewModel, DotVVM.Samples.Common | ||
|
||
<!DOCTYPE html> | ||
|
||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title></title> | ||
</head> | ||
<body> | ||
|
||
<p class="result">{{value: NullableDateTime}}</p> | ||
|
||
<dot:Button Text="Set value" Click="{command: NullableDateTime = Value}" /> | ||
<dot:Button Text="Set null" Click="{command: NullableDateTime = null}" /> | ||
<dot:Button Text="Set null with command" Click="{command: SetNullableDateTimeToNull()}" /> | ||
|
||
</body> | ||
</html> | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters