Пример #1
0
        //private string GetXmlnsPrefix(IXamlSchemaContextProvider schemaProvider, Type type)
        //{
        //    string ourName = type.Name;
        //    XamlSchemaContext context = schemaProvider.SchemaContext;

        //    IEnumerable<string> namespaces = context.GetAllXamlNamespaces();

        //    foreach(string ns in namespaces)
        //    {
        //        ICollection<XamlType> xamlTypes = context.GetAllXamlTypes(ns);

        //        foreach(XamlType xt in xamlTypes)
        //        {
        //            if(xt.IsMarkupExtension)
        //            {
        //                if(xt.Name == ourName)
        //                {
        //                    return ns;
        //                }
        //            }
        //        }
        //    }

        //    return null;
        //}

        #endregion

        public Binding GetBinding(BindingTarget bindingTarget)
        {
            MyBindingInfo bindingInfo = GatherBindingInfo(Path, Mode);

            MyBindingEngine mb = new MyBindingEngine(bindingInfo, SourceType, _bindingTarget, UseMultiBinding);

            return(mb.ProvideTheBindingDirectly());
        }