Пример #1
0
        private static BaseViewModel getProxy(BaseViewModel vm)
        {
            var constructorArgs = vm.GetType()
                                  .GetConstructors()
                                  .First()
                                  .GetParameters()
                                  .Select(p => Container.GetInstance(p.ParameterType))
                                  .ToArray();

            return((BaseViewModel)_dynamicProxy.CreateClassProxy(
                       classToProxy: vm.GetType(),
                       constructorArguments: constructorArgs,
                       interceptors: new IInterceptor[] { new NotifyPropertyInterceptor() }));
        }
Пример #2
0
        private static BaseViewModel getProxy(BaseViewModel vm)
        {
            var constructorArgs = vm.GetType()
                                    .GetConstructors()
                                    .First()
                                    .GetParameters()
                                    .Select(p => Container.GetInstance(p.ParameterType))
                                    .ToArray();

            return (BaseViewModel)_dynamicProxy.CreateClassProxy(
                                                    classToProxy: vm.GetType(),
                                                    constructorArguments: constructorArgs,
                                                    interceptors: new IInterceptor[] { new NotifyPropertyInterceptor() });
        }