public override object GetValue(IDictionary<string, object> resources)
        {
            var binding = new Binding(target);
            binding.Path = Path;
            binding.Mode = Mode;
            binding.ElementName = ElementName;

            if (!string.IsNullOrEmpty(Converter) && resources.ContainsKey(Converter))
                binding.Converter = resources[Converter] as IValueConverter;

            binding.ConverterParameter = ConverterParameter;

            return binding;
        }
Beispiel #2
0
		public void SetBinding(DependencyProperty property, Binding binding)
		{
			if (property == null)
				throw new ArgumentNullException("You must supply a DependencyProperty object.");

			// We don't want to go through SetValue because we're not passing in a concrete object, we're passing in an object
			// that know's how to retrieve the item of that type.
			dependencyPropertyValues[property.Name] = binding;
		}