//******************************************************************************************************
// IViewModel.cs - Gbtc
//
// Copyright © 2012, Grid Protection Alliance. All Rights Reserved.
//
// Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See
// the NOTICE file distributed with this work for additional information regarding copyright ownership.
// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may
// not use this file except in compliance with the License. You may obtain a copy of the License at:
//
// http://www.opensource.org/licenses/MIT
//
// Unless agreed to in writing, the subject software distributed under the License is distributed on an
// "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the
// License for the specific language governing permissions and limitations.
//
// Code Modification History:
// ----------------------------------------------------------------------------------------------------
// 03/31/2011 - Mehulbhai P Thakkar
// Generated original version of source code.
// 05/25/2011 - J. Ritchie Carroll
// Added load/save/delete event operations to allow for user control interception.
// 12/20/2012 - Starlynn Danyelle Gilliam
// Modified Header.
//
//******************************************************************************************************
using System;
using System.ComponentModel;
using System.Windows.Input;
namespace GSF.TimeSeries.UI
{
///
/// Represents an interface and common methods and properties each data model definition should use.
///
public interface IViewModel : INotifyPropertyChanged
{
///
/// Raised before record load is executed.
///
event CancelEventHandler BeforeLoad;
///
/// Raised when record has been loaded.
///
event EventHandler Loaded;
///
/// Raised before record save is executed.
///
event CancelEventHandler BeforeSave;
///
/// Raised when record has been saved.
///
event EventHandler Saved;
///
/// Raised before record delete is executed.
///
event CancelEventHandler BeforeDelete;
///
/// Raised when record has been deleted.
///
event EventHandler Deleted;
///
/// Gets object to perform Save operation.
///
ICommand SaveCommand
{
get;
}
///
/// Gets object to perform Delete operation.
///
ICommand DeleteCommand
{
get;
}
///
/// Gets object to perform Clear operation.
///
ICommand ClearCommand
{
get;
}
///
/// Gets boolean value to indicate if Save operation can be executed.
///
///
bool CanSave
{
get;
}
///
/// Gets boolean value to indicate if Delete operation can be executed.
///
///
bool CanDelete
{
get;
}
///
/// Gets boolean value to indicate if Clear operation can be executed.
///
///
bool CanClear
{
get;
}
/////
///// Gets or sets error messages related to validation of property values.
/////
////string Error { get; set; }
///
/// Method to save data into backend data store.
///
void Save();
///
/// Method to delete data from the backend data store.
///
void Delete();
///
/// Method to restore default values for data model object.
///
void Clear();
///
/// Method to retrieve collection of related objects.
///
void Load();
}
}