According to
MSDN[
^], you'll need to use an
ObjectDataProvider[
^] as your binding source.
This blog post[
^] has a nice example:
<Window ... xmlns:local="clr-namespace:SimpleObjectDataProvider">
<Window.Resources>
<ObjectDataProvider
x:Key="colors"
ObjectType="{x:Type local:ColorHelper}"
MethodName="GetColorNames"
/>
</Window.Resources>
<StackPanel>
<ComboBox
ItemsSource="{Binding Source={StaticResource colors}}"
/>
</StackPanel>
</Window>
You might need to make your class
public
rather than
internal
; WPF doesn't seem to like working with
internal
classes from XAML.
EDIT: Sorry, just noticed you're using WinRT. It looks like the
ObjectDataProvider
isn't available on that platform.