Ejemplo n.º 1
0
        public ViewModelWiring(ViewModel viewModel, PropertyResolverRepository propertyResolverRepository)
        {
            this.viewModel = viewModel;
            this.propertyResolverRepository = propertyResolverRepository;

            fields = this.viewModel.GetType()
                     .GetFields()
                     .ToDictionary(field => field.Name);
        }
Ejemplo n.º 2
0
        public void Setup()
        {
            propertyResolverRepository = Substitute.For <PropertyResolverRepository>();
            viewModel            = SomeViewModel(propertyResolverRepository);
            somePropertyResolver = Substitute.For <PropertyResolver>();
            viewModelWiring      = new ViewModelWiring(viewModel, propertyResolverRepository);

            somePropertyResolver.SubscribeProperty(Arg.Any <FieldInfo>(), Arg.Any <object>(),
                                                   Arg.Any <Action <string, object> >()).Returns(Disposable.Empty);
        }
Ejemplo n.º 3
0
        public ViewModel(PropertyResolverRepository propertyResolverRepository)
        {
            onPropertyChanged = new Subject <PropertyChanged>();

            viewModelWiring = new ViewModelWiring(this, propertyResolverRepository);

            viewModelWiring
            .Wire(NotifyPropertyChange)
            .ForEach(wireField => disposables.Add(wireField.Subscription));
        }
Ejemplo n.º 4
0
 public static ViewModel SomeViewModel(PropertyResolverRepository propertyResolverRepository)
 {
     return(new SomeViewModel(propertyResolverRepository));
 }
Ejemplo n.º 5
0
 public SomeViewModel(PropertyResolverRepository propertyResolverRepository) : base(propertyResolverRepository)
 {
 }