<Window.Resources>
<x:ArrayExtension x:Key="array" Type="{x:Type sys:Int32}"> <sys:Int32>20</sys:Int32> <sys:Int32>21</sys:Int32> <sys:Int32>22</sys:Int32> </x:ArrayExtension> </Window.Resources> <Grid> <ListBox ItemsSource="{StaticResource array}"></ListBox> </Grid>
Tips
xmlns:sys=
"clr-namespace:System;assembly=mscorlib"
示例代码
https://github.com/zLulus/NotePractice/tree/dev3/WPF/WpfDemo/ArrayExtension
转载于:https://www.cnblogs.com/Lulus/p/8150887.html