Hi,
In my WPF, I could not use constructor injected because of my ViewModel already derrived from other class.
Then I modified the helper code to following by using FullName ServiceLocator.
public class AutoNotificationObject : NotificationObject { protected T Using() where T : class { var handler = ServiceLocator.Current.GetInstance<T>(); if (handler == null) { throw new BusinessServicesException("Unable to resolve type with service locator: Type" + typeof(T).Name); } return handler; } }
var
handler = ServiceLocator.Current.GetInstance<T>()public AuthorizedController
(IServiceLocator serviceLocator)
{
this.serviceLocator = serviceLocator;
}
What differnt between the two