Exemplo n.º 1
0
        private bool SetPropertyImpl(VMTypeMetadata.PropertyInfo info, object value, bool editing)
        {
            if (editing)
            {
                if (!changes.TryGetValue(info.Name, out var oldValue))
                {
                    oldValue = info.Getter(Model);
                }
                if (object.Equals(oldValue, value))
                {
                    return(false);
                }

                changes[info.Name] = value;
            }
            else
            {
                var oldValue = info.Getter(Model);
                if (object.Equals(oldValue, value))
                {
                    return(false);
                }

                info.Setter(Model, value);
            }

            OnPropertyChanged(info.Name);
            return(true);
        }
Exemplo n.º 2
0
        private object GetPropertyImpl(VMTypeMetadata.PropertyInfo info, bool editing)
        {
            if (editing && changes.TryGetValue(info.Name, out var value))
            {
                return(value);
            }

            return(info.Getter(Model));
        }