1
1
// ReSharper disable once CheckNamespace
2
+
2
3
namespace MahApps . Metro
3
4
{
4
5
using System ;
5
6
using System . Diagnostics ;
6
7
using System . Windows ;
8
+ using JetBrains . Annotations ;
7
9
8
10
internal class AppName
9
11
{
@@ -19,7 +21,7 @@ public class AppTheme
19
21
/// <summary>
20
22
/// The ResourceDictionary that represents this application theme.
21
23
/// </summary>
22
- public ResourceDictionary Resources { get ; }
24
+ public ResourceDictionary Resources { get ; }
23
25
24
26
/// <summary>
25
27
/// Gets the name of the application theme.
@@ -30,14 +32,28 @@ public class AppTheme
30
32
/// Initializes a new instance of the AppTheme class.
31
33
/// </summary>
32
34
/// <param name="name">The name of the new AppTheme.</param>
33
- /// <param name="resourceAddress">The URI of the accent ResourceDictionary.</param>
34
- public AppTheme ( string name , Uri resourceAddress )
35
+ /// <param name="resourceAddress">The URI of the AppTheme ResourceDictionary.</param>
36
+ public AppTheme ( [ NotNull ] string name , [ NotNull ] Uri resourceAddress )
35
37
{
36
38
if ( name == null ) throw new ArgumentNullException ( nameof ( name ) ) ;
37
39
if ( resourceAddress == null ) throw new ArgumentNullException ( nameof ( resourceAddress ) ) ;
38
40
39
41
this . Name = name ;
40
- this . Resources = new ResourceDictionary { Source = resourceAddress } ;
42
+ this . Resources = new ResourceDictionary { Source = resourceAddress } ;
43
+ }
44
+
45
+ /// <summary>
46
+ /// Initializes a new instance of the AppTheme class.
47
+ /// </summary>
48
+ /// <param name="name">The name of the new AppTheme.</param>
49
+ /// <param name="resourceDictionary">The ResourceDictionary of the accent.</param>
50
+ public AppTheme ( [ NotNull ] string name , [ NotNull ] ResourceDictionary resourceDictionary )
51
+ {
52
+ if ( name == null ) throw new ArgumentNullException ( nameof ( name ) ) ;
53
+ if ( resourceDictionary == null ) throw new ArgumentNullException ( nameof ( resourceDictionary ) ) ;
54
+
55
+ this . Name = name ;
56
+ this . Resources = resourceDictionary ;
41
57
}
42
58
}
43
59
}
0 commit comments