|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Wide.Interfaces;
using Wide.Interfaces.Events;
using Microsoft.Practices.Prism.Events;
using Microsoft.Practices.Unity;
using Wide.Interfaces.Services;
namespace Wide.Tools.Logger
{
class LoggerViewModel : ToolViewModel
{
private LoggerModel _model;
private LoggerView _view;
private IWorkspace _workspace;
private IUnityContainer _container;
private IEventAggregator _aggregator;
public LoggerViewModel(IUnityContainer container, AbstractWorkspace workspace)
{
_workspace = workspace;
_container = container;
this.Name = "Logger";
this.Title = "Logger";
this.ContentId = "Logger";
_model = new LoggerModel();
this.Model = _model;
this.IsVisible = false;
_view = new LoggerView();
_view.DataContext = _model;
this.View = _view;
_aggregator = _container.Resolve<IEventAggregator>();
_aggregator.GetEvent<LogEvent>().Subscribe(AddLog);
}
private void AddLog(ILoggerService logger)
{
_model.AddLog(logger);
}
}
}
|
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.
Hello! I'm a 26 year old, WPF/C# self-learned software developer, musician from India with a Master's degree in Computer science. I believe that every piece of software and information/knowledge is available for free for those who seek it.
My projects are available in
my Webpage hosted on Github. I am eager to learn new things everyday, explore new technologies and solve problems.