Skip to content

Commit 786e749

Browse files
Merge pull request #16 from AndreasReitberger/15-switch-to-partial-properties
Switched to `partial` properties
2 parents 9127386 + de776c1 commit 786e749

22 files changed

Lines changed: 123 additions & 97 deletions

common.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<Authors>Andreas Reitberger</Authors>
1414
<Copyright>Andreas Reitberger</Copyright>
1515
<Company>Andreas Reitberger</Company>
16-
<LangVersion>12</LangVersion>
16+
<LangVersion>preview</LangVersion>
1717
<PublishReadyToRun>false</PublishReadyToRun>
1818
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
1919

src/SharedXFormCoreLibrary/Interfaces/ILocalizationManager.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
using AndreasReitberger.Shared.XForm.Core.Localization;
2-
using System.Globalization;
32

43
namespace AndreasReitberger.Shared.XForm.Core.Interfaces
54
{
65
public interface ILocalizationManager
76
{
87
#region Properties
98
public List<LocalizationInfo> Languages { get; set; }
10-
public LocalizationInfo CurrentLanguage { get; set; }
11-
public CultureInfo CurrentCulture { get; set; }
9+
public LocalizationInfo? CurrentLanguage { get; set; }
10+
public CultureInfo? CurrentCulture { get; set; }
1211
#endregion
1312

1413
#region Methods
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
namespace AndreasReitberger.Shared.XForm.Core.Models
1+
using CommunityToolkit.Mvvm.ComponentModel;
2+
3+
namespace AndreasReitberger.Shared.XForm.Core.Models
24
{
3-
public class ColorPickerElement
5+
public partial class ColorPickerElement : ObservableObject
46
{
57
#region Properties
6-
public string Name { get; set; } = string.Empty;
7-
public Color ChipColor { get; set; }
8+
[ObservableProperty]
9+
public partial string Name { get; set; } = string.Empty;
10+
11+
[ObservableProperty]
12+
public partial Color? ChipColor { get; set; }
813
#endregion
914
}
1015
}

src/SharedXFormCoreLibrary/Models/Documentation/ChangeInfo.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
using AndreasReitberger.Shared.XForm.Core.Enums;
2+
using CommunityToolkit.Mvvm.ComponentModel;
23

34
namespace AndreasReitberger.Shared.XForm.Core.Documentation
45
{
5-
public class ChangeInfo
6+
public partial class ChangeInfo : ObservableObject
67
{
78
#region Properties
8-
public ChangelogType Type { get; set; }
9-
public string Changelog { get; set; } = string.Empty;
10-
public string GlyphIcon { get; set; } = string.Empty;
9+
[ObservableProperty]
10+
public partial ChangelogType Type { get; set; }
11+
12+
[ObservableProperty]
13+
public partial string Changelog { get; set; } = string.Empty;
14+
15+
[ObservableProperty]
16+
public partial string GlyphIcon { get; set; } = string.Empty;
1117
#endregion
1218

1319
#region Constructor

src/SharedXFormCoreLibrary/Models/Documentation/ChangelogInfo.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
using AndreasReitberger.Shared.XForm.Core.Enums;
2+
using CommunityToolkit.Mvvm.ComponentModel;
23

34
namespace AndreasReitberger.Shared.XForm.Core.Documentation
45
{
5-
public class ChangelogInfo
6+
public partial class ChangelogInfo : ObservableObject
67
{
78
#region Properties
8-
public ChangelogType Type { get; set; }
9-
public string Changelog { get; set; } = string.Empty;
10-
public string Version { get; set; } = string.Empty;
11-
public string GlyphIcon { get; set; } = string.Empty;
9+
[ObservableProperty]
10+
public partial ChangelogType Type { get; set; }
11+
12+
[ObservableProperty]
13+
public partial string Changelog { get; set; } = string.Empty;
14+
15+
[ObservableProperty]
16+
public partial string Version { get; set; } = string.Empty;
17+
18+
[ObservableProperty]
19+
public partial string GlyphIcon { get; set; } = string.Empty;
1220
#endregion
1321

1422
#region Constructor

src/SharedXFormCoreLibrary/Models/Documentation/LibraryInfo.cs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1-
namespace AndreasReitberger.Shared.XForm.Core.Documentation
1+
using CommunityToolkit.Mvvm.ComponentModel;
2+
3+
namespace AndreasReitberger.Shared.XForm.Core.Documentation
24
{
3-
public class LibraryInfo
5+
public partial class LibraryInfo : ObservableObject
46
{
57
#region Properties
6-
public string Library { get; set; }
7-
public string LibraryUrl { get; set; }
8-
public string Description { get; set; }
9-
public bool StateChanged { get; set; }
10-
public string License { get; set; }
11-
public string LicenseUrl { get; set; }
8+
[ObservableProperty]
9+
public partial string Library { get; set; } = string.Empty;
10+
[ObservableProperty]
11+
public partial string LibraryUrl { get; set; } = string.Empty;
12+
[ObservableProperty]
13+
public partial string Description { get; set; } = string.Empty;
14+
[ObservableProperty]
15+
public partial bool StateChanged { get; set; }
16+
[ObservableProperty]
17+
public partial string License { get; set; } = string.Empty;
18+
[ObservableProperty]
19+
public partial string LicenseUrl { get; set; } = string.Empty;
1220
#endregion
1321

1422
#region Constructor

src/SharedXFormCoreLibrary/Models/Documentation/ProVersionFeature.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public partial class ProVersionFeature : ObservableObject
66
{
77
#region Propertiers
88
[ObservableProperty]
9-
string feature = string.Empty;
9+
public partial string Feature { get; set; } = string.Empty;
1010
#endregion
1111
}
1212
}

src/SharedXFormCoreLibrary/Models/Documentation/ResourceInfo.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
namespace AndreasReitberger.Shared.XForm.Core.Documentation
1+
using CommunityToolkit.Mvvm.ComponentModel;
2+
3+
namespace AndreasReitberger.Shared.XForm.Core.Documentation
24
{
3-
public class ResourceInfo
5+
public partial class ResourceInfo : ObservableObject
46
{
57
#region Properties
6-
public string Resource { get; set; }
7-
public string ResourceUrl { get; set; }
8-
public string Description { get; set; }
8+
[ObservableProperty]
9+
public partial string Resource { get; set; } = string.Empty;
10+
11+
[ObservableProperty]
12+
public partial string ResourceUrl { get; set; } = string.Empty;
13+
14+
[ObservableProperty]
15+
public partial string Description { get; set; } = string.Empty;
916
#endregion
1017

1118
#region Constructor

src/SharedXFormCoreLibrary/Models/Documentation/TutorialStep.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
using CommunityToolkit.Mvvm.ComponentModel;
2-
using System;
32

43
namespace AndreasReitberger.Shared.XForm.Core.Documentation
54
{
65
public partial class TutorialStep : ObservableObject
76
{
87
#region Properties
98
[ObservableProperty]
10-
Uri? image;
9+
public partial Uri? Image { get; set; }
1110

1211
[ObservableProperty]
13-
string heading = string.Empty;
12+
public partial string Heading { get; set; } = string.Empty;
1413

1514
[ObservableProperty]
16-
string content = string.Empty;
15+
public partial string Content { get; set; } = string.Empty;
1716

1817
[ObservableProperty]
19-
int order = 0;
18+
public partial int Order { get; set; } = 0;
2019

2120
[ObservableProperty]
22-
bool viewed = false;
21+
public partial bool Viewed { get; set; } = false;
2322

2423
#endregion
2524

src/SharedXFormCoreLibrary/Models/Documentation/VersionInfo.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
using System.Collections.ObjectModel;
1+
using CommunityToolkit.Mvvm.ComponentModel;
2+
using System.Collections.ObjectModel;
23

34
namespace AndreasReitberger.Shared.XForm.Core.Documentation
45
{
5-
public class VersionInfo
6+
public partial class VersionInfo : ObservableObject
67
{
78
#region Properties
8-
public string Version { get; set; } = string.Empty;
9-
public ObservableCollection<ChangeInfo> Changes { get; set; } = new();
9+
[ObservableProperty]
10+
public partial string Version { get; set; } = string.Empty;
11+
12+
[ObservableProperty]
13+
public partial ObservableCollection<ChangeInfo> Changes { get; set; } = [];
1014
#endregion
1115

1216
#region Constructor

0 commit comments

Comments
 (0)