Ejemplo n.º 1
0
        protected T Get <T>(Func <T> getMethod, [CallerMemberName] string propertyName = "")
        {
            ForView.Initialize();
            ComputedPropertyBase property;

            if (!_computedPropertyByName.TryGetValue(propertyName, out property))
            {
                property = new ComputedAtom <T>(() => FirePropertyChanged(propertyName), getMethod);
                _computedPropertyByName.Add(propertyName, property);
            }
            return((T)property.Value);
        }
Ejemplo n.º 2
0
        protected IEnumerable <T> GetCollection <T>(Func <IEnumerable <T> > getMethod, [CallerMemberName] string propertyName = "")
        {
            ForView.Initialize();
            ComputedPropertyBase property;

            if (!_computedPropertyByName.TryGetValue(propertyName, out property))
            {
                property = new ComputedCollection <T>(getMethod);
                _computedPropertyByName.Add(propertyName, property);
            }
            return((IEnumerable <T>)property.Value);
        }
Ejemplo n.º 3
0
        public object ViewModel(Func <object> constructor, [CallerMemberName] string propertyName = "")
        {
            if (DesignMode)
            {
                return(constructor());
            }

            ForView.Initialize();
            ViewModelContainer container;

            if (!_containerByName.TryGetValue(propertyName, out container))
            {
                container = new ViewModelContainer(() => FirePropertyChanged(propertyName), constructor);
                _containerByName.Add(propertyName, container);
            }
            return(container.ViewModel);
        }
Ejemplo n.º 4
0
 protected IEnumerable <T> GetCollection <T>(Func <IEnumerable <T> > getMethod, [CallerMemberName] string propertyName = "")
 {
     ForView.Initialize();
     return(_propertyTracker.GetCollection(getMethod, propertyName));
 }
Ejemplo n.º 5
0
 protected T Get <T>(Func <T> getMethod, [CallerMemberName] string propertyName = "")
 {
     ForView.Initialize();
     return(_propertyTracker.Get(getMethod, propertyName));
 }