Skip to content

Commit

Permalink
Optimize registration for default values
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio0694 committed Dec 12, 2024
1 parent 7f57e6c commit 866492b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ static string GetExpressionWithTrailingSpace(Accessibility accessibility)
string typeMetadata = propertyInfo switch
{
// Shared codegen
{ DefaultValue: DependencyPropertyDefaultValue.Null, IsPropertyChangedCallbackImplemented: false, IsSharedPropertyChangedCallbackImplemented: false }
{ DefaultValue: DependencyPropertyDefaultValue.Null or DependencyPropertyDefaultValue.Default, IsPropertyChangedCallbackImplemented: false, IsSharedPropertyChangedCallbackImplemented: false }
=> "null",
{ DefaultValue: DependencyPropertyDefaultValue.Callback(string methodName), IsPropertyChangedCallbackImplemented: false, IsSharedPropertyChangedCallbackImplemented: false }
=> $"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ partial class MyControl
name: "Number",
propertyType: typeof(int),
ownerType: typeof(MyControl),
typeMetadata: new global::Windows.UI.Xaml.PropertyMetadata(default(int)));
typeMetadata: null);
/// <inheritdoc/>
[global::System.CodeDom.Compiler.GeneratedCode("CommunityToolkit.WinUI.DependencyPropertyGenerator", <ASSEMBLY_VERSION>)]
Expand Down Expand Up @@ -464,7 +464,7 @@ partial class MyControl
name: "Number",
propertyType: typeof(int),
ownerType: typeof(MyControl),
typeMetadata: new global::Windows.UI.Xaml.PropertyMetadata(default(int)));
typeMetadata: null);
/// <inheritdoc/>
[global::System.CodeDom.Compiler.GeneratedCode("CommunityToolkit.WinUI.DependencyPropertyGenerator", <ASSEMBLY_VERSION>)]
Expand Down

0 comments on commit 866492b

Please sign in to comment.