예제 #1
0
        void OnWriteStartMemberAttribute(XamlType xt, XamlMember xm)
        {
            CurrentMemberState.OccuredAs = AllowedMemberLocations.Attribute;
            string name = xm.GetInternalXmlName();

            if (xt.PreferredXamlNamespace == xm.PreferredXamlNamespace &&
                !(xm is XamlDirective))             // e.g. x:Key inside x:Int should not be written as Key.
            {
                w.WriteStartAttribute(name);
            }
            else
            {
                string prefix = GetPrefix(xm.PreferredXamlNamespace);
                w.WriteStartAttribute(prefix, name, xm.PreferredXamlNamespace);
            }
        }
예제 #2
0
        void OnWriteStartMemberAttribute(XamlType xt, XamlMember xm)
        {
            CurrentMemberState.OccuredAs = AllowedMemberLocations.Attribute;
            var    ns   = xm.IsAttachable || xm.IsDirective ? xm.PreferredXamlNamespace : xt.PreferredXamlNamespace;
            string name = xm.GetInternalXmlName();

            if (xt.PreferredXamlNamespace == ns &&
                !xm.IsDirective)             // e.g. x:Key inside x:Int should not be written as Key.
            {
                w.WriteStartAttribute(name);
            }
            else
            {
                string prefix = GetPrefix(ns);
                w.WriteStartAttribute(prefix, name, ns);
            }
        }