internal static object ResolveBinding(XamlBinding binding, XamlControl source, int position) { #if AVALONIA var instancedBinding = binding.Initiate(source, _properties[position]); BindingOperations.Apply(source, _properties[position], instancedBinding, null); #else if (!System.Windows.Data.BindingOperations.IsDataBound(source, _properties[position])) { System.Windows.Data.BindingOperations.SetBinding(source, _properties[position], binding); } #endif return(source.GetValue(_properties[position])); }