using System.Collections.ObjectModel;
using System.ComponentModel;
namespace Tango.Integration.Observables
{
public partial class @(Model.Name)
{
@foreach (var prop in Model.Properties)
{
private @(prop.Type) _@(prop.Name.ToLower());
///
/// Gets or sets the @(prop.Name).
///
public @(prop.Type) @(prop.Name)
{
get { return _@(prop.Name.ToLower()); }
set { _@(prop.Name.ToLower()) = value; RaisePropertyChanged(nameof(@(prop.Name))); }
}
private ICollectionView _@(prop.Name.ToLower())ViewSource;
///
/// Gets or sets the @(prop.Name) View Source.
///
public ICollectionView @(prop.Name)ViewSource
{
get { return _@(prop.Name.ToLower())ViewSource; }
set { _@(prop.Name.ToLower())ViewSource = value; RaisePropertyChanged(nameof(@(prop.Name)ViewSource)); }
}
}
///
/// Initialize collection sources.
///
private void InitCollectionSources()
{
@foreach (var prop in Model.Properties)
{
@(prop.Name)ViewSource = CreateCollectionView(@(prop.Name));
}
}
}
}