Not directly.
There are some interesting solutions to these issues:
- Create dictionary in xaml?
- Adding a SortedList or <int, string> dictionary to a ResourceDictionary
Typically, you will need to create your own type, which is not universal, and use it instead.
Example
For:
Tuple<string, int, double>
You can create a class:
namespace Models { class MyData { public MyString { get; set; } public MyInt { get; set; } public MyDouble { get; set; } } }
Then add the namespace in XAML:
xmlns:models="clr-namespace:Models"
Then create your instance as needed:
<models:MyData MyString="someString" MyInt="123" MyDouble="0.1" />
Malgaur
source share