|
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ModelNotRegisteredException.cs" company="Catel development team">
// Copyright (c) 2008 - 2011 Catel development team. All rights reserved.
// </copyright>
// <summary>
// Exception for when a model is not registered on a class, but a <see cref="ViewModelToModelAttribute" /> is used with the model.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
using System;
using Catel.Properties;
namespace Catel.MVVM
{
/// <summary>
/// Exception for when a model is not registered on a class, but a <see cref="ViewModelToModelAttribute"/> is used with the model.
/// </summary>
public class ModelNotRegisteredException : Exception
{
#region Constructor & destructor
/// <summary>
/// Initializes a new instance of the <see cref="ModelNotRegisteredException"/> class.
/// </summary>
/// <param name="modelName">Name of the model.</param>
/// <param name="propertyDeclaringViewModelToModelAttribute">The property declaring the view model to model attribute.</param>
public ModelNotRegisteredException(string modelName, string propertyDeclaringViewModelToModelAttribute)
: base(string.Format(Exceptions.ModelNotRegistered, modelName, propertyDeclaringViewModelToModelAttribute))
{
ModelName = modelName;
PropertyDeclaringViewModelToModelAttribute = propertyDeclaringViewModelToModelAttribute;
}
#endregion
#region Properties
/// <summary>
/// Gets the name of the model.
/// </summary>
/// <value>The name of the model.</value>
public string ModelName { get; private set; }
/// <summary>
/// Gets the property declaring the view model to model attribute.
/// </summary>
/// <value>The property declaring the view model to model attribute.</value>
public string PropertyDeclaringViewModelToModelAttribute { get; private set; }
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.