views:

12

answers:

0

I'm trying to understand binding to local items using XAML. I'll make this a two part question, but both deal with the same basic situation:

Say I have a custom user control called MySelector

  • MySelector includes a ListBox called listBox1
  • MySelector includes a List<string> property called TextList
    • TextList is a read-only property to allow adding to or removing from the list
  • MySelector includes a List<string> property called DisabledList
    • DisabledList is also exposed as read-only to allow control of the list's content
    • The idea is that items in TextList that are also in DisabledList should appear grayed out in listBox1

Question1: in the XAML for MySelector, how do you simply bind the items in listBox1 to the local TextList property?

Question2: is it possible to use XAML and binding to make items in listBox1 appear with a gray font if they appear in the DisabledList?

Thanks a lot!!!