1

I have static property in a class that I need to set it as ItemSource for TreeView control.

some thing like that:

<TreeView x:Name="SegTreeView" Margin="199,55,240,0" VerticalAlignment="Top" Height="88"
    ItemsSource="{x:Static local:STestFrameControl._sObserverList}">

when I run my app I get this run time exception:

Cannot convert the value in attribute 'ItemsSource' to object of type 'System.Windows.Markup.StaticExtension'. Error at object 'SegmTreeView' in markup file 'DClient;component/stestframecontrol.xaml' Line 61 Position 99.

tries this solution: Binding to static property

with no help.

thanks in advance, Evyatar

Community
  • 1
  • 1
user826787
  • 29
  • 2
  • 1
    You need to provide the definition of the static property and the xaml that is being used to assign its usage. – Phil Wright Jul 03 '11 at 10:44
  • Your code seems to work fine for me. Are you sure you have the right `TreeView`? Your code and your error have different names. Also, what's the code of the property? – svick Jul 03 '11 at 20:52
  • @Phil, the XAML was in the question, it just wasn't visible. – svick Jul 03 '11 at 20:53

0 Answers0