Пример #1
0
        private INotifyPropertyChanged ResolveNewBindingSource()
        {
            if (string.IsNullOrWhiteSpace(BindingPath))
            {
                return(null);
            }
            object source = DataContext;

            string[] path = BindingPath.Split('.');
            for (int i = 0; i < path.Length - 1; i++)
            {
                if (source == null)
                {
                    break;
                }
                PropertyInfo propinfo = source.GetType().GetProperty(path[i]);
                source = propinfo == null ? null : propinfo.GetValue(source, null);
            }
            return(source as INotifyPropertyChanged);
        }
Пример #2
0
 private PropertyInfo ResolveNewBindingProperty(INotifyPropertyChanged source)
 {
     return(source.GetType().GetProperty(BindingPath.Split('.').Last()));
 }