Example #1
0
        protected CachedRelayProperty <T> CreateCachedRelayProperty <T>(Func <T> getFunc, Action <T> setAction, string propertyName,
                                                                        INotifyPropertyChanged notifyObj = null, params string[] dependecies)
        {
            var result = CachedRelayProperty.Create(getFunc, setAction, notifyObj, dependecies);

            SubscribeTo(result, propertyName);
            return(result);
        }
Example #2
0
        protected void SubscribeTo <PropType>(CachedRelayProperty <PropType> relayProperty, string propertyName)
        {
            void relayProperty_PropertyChanged(object sender, PropertyChangedEventArgs e)
            {
                OnPropertyChanged(propertyName);
            }

            void relayProperty_PropertyChanging(object sender, PropertyChangingEventArgs e)
            {
                OnPropertyChanging(propertyName);
            }

            //TODO: Fix Potential Memory Leaks
            relayProperty.PropertyChanging += relayProperty_PropertyChanging;
            relayProperty.PropertyChanged  += relayProperty_PropertyChanged;
        }