how use List within xaml?

后端 未结 1 1398
南笙
南笙 2021-01-20 00:12

So I am pretty sure that up in the definition part I need to include something along the lines of:

xmlns:s=\"clr-namespace:System.Collections.Generic;assemb         


        
相关标签:
1条回答
  • 2021-01-20 00:46

    The assembly part of the XML namespace declaration would be mscorlib.

    But anyway, XAML doesn't support generics (*), so you can't do it. Instead, you could create a class that inherits List<T> and use it in XAML:

    class ListOfFoo : List<Foo>
    {
    }
    

    (1) Actually generics are supported in XAML 2009, but most of XAML 2009 is not supported in compiled XAML. See this question for more information.

    0 讨论(0)
提交回复
热议问题