views:

476

answers:

1

Hi all,

I'm trying to bind a text box to the count of a filtered, collection view in XAML. It doesn't generate any errors but it also doesn't produce any output. Does anyone know how to do this?

Here's are some snippets of my XAML:

<Window.Resources>
  <CollectionViewSource x:Key="MyView" Source="{Binding MyBinding}" Filter="MyFilter" />
</Window.Resources>

...

<TextBlock>
  <TextBlock.Text>
    <Binding Source="{StaticResource MyView}" Path="View.Count"  
      StringFormat="{}Count: {0:D}" />
  </TextBlock.Text>
</TextBlock>

Basically, I'm trying to display the count of filtered items in the List.

+5  A: 

You don't need the "View." in the path. it should just be:

Path="Count"
Simon P Stevens
Correct. This link will help you debug bindings: http://www.beacosta.com/blog/?p=52
Anderson Imes