public object CreateViewModel(DependencyObject sender) { EditLogViewModel vm = new EditLogViewModel(); ILogDal logDal = new LogDal(ConfigurationManager.AppSettings["connection_string"]); vm.ServiceLocator.RegisterService <ILogService>(new LogService(logDal)); ITourDal tourDal = new TourDal(ConfigurationManager.AppSettings["connection_string"]); vm.ServiceLocator.RegisterService <ITourService>(new TourService(tourDal)); return(vm); }
public EditLogInfo(TailFile tail) { InitializeComponent(); DataContext = new EditLogViewModel(tail); }