How I can set value of string[] property in xaml?
I hava control with next property: string[] PropName
I want to set value of this property in next way:
<ns:SomeControl PropName="Val1,Val2" />
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the
<x:Array>markup extension, but its syntax is quite verbose.Another option is to create your own
TypeConverterthat can convert from the comma-separated list to an array:If the type you were converting to was your type, you could then apply the
[TypeConverter]attribute to that type. But since you want to convert tostring[], you can’t do that. So you have to apply that attribute to all properties where you want to use this converter: