Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Additional changes to define Value property of Setter as XAML content property #9093

Merged
merged 1 commit into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ CannotChangeAttribute : Attribute 'System.Windows.LocalizabilityAttribute' on 'S
CannotChangeAttribute : Attribute 'System.Windows.LocalizabilityAttribute' on 'System.Windows.ResourceDictionary' changed from '[LocalizabilityAttribute(16)]' in the contract to '[LocalizabilityAttribute(LocalizationCategory.Ignore)]' in the implementation.
CannotChangeAttribute : Attribute 'System.ComponentModel.DesignerSerializationVisibilityAttribute' on 'System.Windows.ResourceDictionary.DeferrableContent' changed from '[DesignerSerializationVisibilityAttribute(0)]' in the contract to '[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]' in the implementation.
CannotChangeAttribute : Attribute 'System.ComponentModel.DesignerSerializationVisibilityAttribute' on 'System.Windows.ResourceDictionary.Source' changed from '[DesignerSerializationVisibilityAttribute(0)]' in the contract to '[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]' in the implementation.
CannotRemoveAttribute : Attribute 'System.Windows.Markup.ContentPropertyAttribute' exists on 'System.Windows.Setter' in the contract but not the implementation.
CannotChangeAttribute : Attribute 'System.Windows.LocalizabilityAttribute' on 'System.Windows.Setter.Property' changed from '[LocalizabilityAttribute(0, Modifiability=0, Readability=0)]' in the contract to '[LocalizabilityAttribute(LocalizationCategory.None, Modifiability=Modifiability.Unmodifiable, Readability=Readability.Unreadable)]' in the implementation.
CannotRemoveAttribute : Attribute 'System.ComponentModel.DesignerSerializationVisibilityAttribute' exists on 'System.Windows.Setter.Value' in the contract but not the implementation.
CannotChangeAttribute : Attribute 'System.Windows.LocalizabilityAttribute' on 'System.Windows.Setter.Value' changed from '[LocalizabilityAttribute(0, Readability=0)]' in the contract to '[LocalizabilityAttribute(LocalizationCategory.None, Readability=Readability.Unreadable)]' in the implementation.
CannotChangeAttribute : Attribute 'System.Windows.LocalizabilityAttribute' on 'System.Windows.SetterBase' changed from '[LocalizabilityAttribute(16)]' in the contract to '[LocalizabilityAttribute(LocalizationCategory.Ignore)]' in the implementation.
CannotChangeAttribute : Attribute 'System.Windows.LocalizabilityAttribute' on 'System.Windows.StaticResourceExtension' changed from '[LocalizabilityAttribute(17)]' in the contract to '[LocalizabilityAttribute(LocalizationCategory.NeverLocalize)]' in the implementation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8844,7 +8844,6 @@ private WpfKnownType Create_BamlType_Setter(bool isBamlType, bool useV3Rules)
typeof(System.Windows.Setter),
isBamlType, useV3Rules);
bamlType.DefaultConstructor = delegate() { return new System.Windows.Setter(); };
bamlType.ContentPropertyName = "Value";
bamlType.Freeze();
return bamlType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1107,8 +1107,7 @@ internal enum KnownProperties : short
XmlDataProvider_XmlSerializer,
MaxProperty,
TextBox_IsReadOnly,
RichTextBox_IsReadOnly,
Setter_Value
RichTextBox_IsReadOnly
}

#if !BAMLDASM
Expand Down Expand Up @@ -2787,9 +2786,6 @@ internal static string GetContentPropertyName(KnownElements knownElement)
case KnownElements.ToolBarTray:
name = "ToolBars";
break;
case KnownElements.Setter:
name = "Value";
break;
case KnownElements.ControlTemplate:
case KnownElements.DataTemplate:
case KnownElements.FrameworkTemplate:
Expand Down Expand Up @@ -3680,10 +3676,6 @@ internal static short GetKnownPropertyAttributeId(KnownElements typeID, string f
if (string.Equals(fieldName, "XmlSerializer", StringComparison.Ordinal))
return (short)KnownProperties.XmlDataProvider_XmlSerializer;
break;
case KnownElements.Setter:
if (string.Equals(fieldName, "Value", StringComparison.Ordinal))
return (short)KnownProperties.Setter_Value;
break;
}
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,14 @@ public override void WriteElementStart(XamlElementStartNode xamlElementStartNode
_inEventSetter = true;
#endif
}
else if ((depth == 2 && _setterElementEncountered) ||
(depth == 3 && _setterPropertyEncountered))
{
ThrowException(nameof(SR.ParserNoSetterChild),
xamlElementStartNode.TypeFullName,
xamlElementStartNode.LineNumber,
xamlElementStartNode.LinePosition);
}
}

// Handle custom serializers within the style section by creating an instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ public DependencyProperty Property
/// </summary>
[System.Windows.Markup.DependsOn("Property")]
[System.Windows.Markup.DependsOn("TargetName")]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[Localizability(LocalizationCategory.None, Readability = Readability.Unreadable)] // Not localizable by-default
[TypeConverter(typeof(System.Windows.Markup.SetterTriggerConditionValueConverter))]
public object Value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,6 @@ internal SessionEndingCancelEventArgs() { }
public delegate void SessionEndingCancelEventHandler(object sender, System.Windows.SessionEndingCancelEventArgs e);
[System.Windows.Markup.XamlSetMarkupExtensionAttribute("ReceiveMarkupExtension")]
[System.Windows.Markup.XamlSetTypeConverterAttribute("ReceiveTypeConverter")]
[System.Windows.Markup.ContentPropertyAttribute("Value")]
public partial class Setter : System.Windows.SetterBase, System.ComponentModel.ISupportInitialize
{
public Setter() { }
Expand Down
Loading