Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions src/MahApps.Metro/MahApps.Metro.Shared/ThemeManager/Accent.cs
Original file line number Diff line number Diff line change
@@ -1,42 +1,44 @@
using System;
using System.Diagnostics;
using System.Windows;

// ReSharper disable once CheckNamespace
namespace MahApps.Metro
{
using System;
using System.Diagnostics;
using System.Windows;

/// <summary>
/// An object that represents the foreground color for a Metro <see cref="AppTheme"/>.
/// An object that represents the foreground color for a <see cref="AppTheme"/>.
/// </summary>
[DebuggerDisplay("accent={Name}, res={Resources.Source}")]
public class Accent
{
/// <summary>
/// The ResourceDictionary that represents this Accent.
/// </summary>
public ResourceDictionary Resources;
public ResourceDictionary Resources { get; set; }

/// <summary>
/// Gets/sets the name of the Accent.
/// </summary>
public string Name { get; set; }

/// <summary>
/// Initializes a new instance of the MahApps.Metro.Accent class.
/// Initializes a new instance of the Accent class.
/// </summary>
public Accent()
{ }

/// <summary>
/// Initializes a new instance of the MahApps.Metro.Accent class.
/// Initializes a new instance of the Accent class.
/// </summary>
/// <param name="name">The name of the new Accent.</param>
/// <param name="resourceAddress">The URI of the accent ResourceDictionary.</param>
public Accent(string name, Uri resourceAddress)
{
if (name == null) throw new ArgumentException("name");
if (resourceAddress == null) throw new ArgumentNullException("resourceAddress");
if (name == null) throw new ArgumentNullException(nameof(name));
if (resourceAddress == null) throw new ArgumentNullException(nameof(resourceAddress));

Name = name;
Resources = new ResourceDictionary {Source = resourceAddress};
this.Name = name;
this.Resources = new ResourceDictionary {Source = resourceAddress};
}
}
}
22 changes: 14 additions & 8 deletions src/MahApps.Metro/MahApps.Metro.Shared/ThemeManager/AppTheme.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System;
using System.Diagnostics;
using System.Windows;

// ReSharper disable once CheckNamespace
namespace MahApps.Metro
{
using System;
using System.Diagnostics;
using System.Windows;

internal class AppName
{
public const string MahApps = "MahApps.Metro";
Expand All @@ -18,17 +19,22 @@ public class AppTheme
/// <summary>
/// The ResourceDictionary that represents this application theme.
/// </summary>
public ResourceDictionary Resources {get; private set;}
public ResourceDictionary Resources {get; }

/// <summary>
/// Gets the name of the application theme.
/// </summary>
public string Name { get; private set; }
public string Name { get; }

/// <summary>
/// Initializes a new instance of the AppTheme class.
/// </summary>
/// <param name="name">The name of the new AppTheme.</param>
/// <param name="resourceAddress">The URI of the accent ResourceDictionary.</param>
public AppTheme(string name, Uri resourceAddress)
{
if (name == null) throw new ArgumentException("name");
if (resourceAddress == null) throw new ArgumentNullException("resourceAddress");
if (name == null) throw new ArgumentNullException(nameof(name));
if (resourceAddress == null) throw new ArgumentNullException(nameof(resourceAddress));

this.Name = name;
this.Resources = new ResourceDictionary {Source = resourceAddress};
Expand Down
Loading