Skip to content

Creating a custom Attached Property and setting its value in XAML #6123

Answered by jp2masa
npolyak asked this question in Q&A
Discussion options

You must be logged in to vote

I think you have to define a getter and setter like this:

public static double GetTheWidth(AvaloniaObject obj) => obj.GetValue(TheWidthProperty);

public static void SetTheWidth(AvaloniaObject obj, double value) => obj.SetValue(TheWidthProperty, value);

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@maxkatz6
Comment options

@npolyak
Comment options

Comment options

You must be logged in to vote
1 reply
@npolyak
Comment options

Answer selected by maxkatz6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants