The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
Binding to properties in a UserControl RRS feed

  • Question

  • I have a UserControl that contains the following code:

    <ItemsControl Name="itmGifts">
      <ItemsControl.ItemTemplate>
        <DataTemplate>
          <Grid Background="{Binding Converter={StaticResource StoreGiftBackgroundBrush}}" Tag="{Binding Path=ID}" ManipulationCompleted="ViewGiftDetail">

    The thing that is missing is the ConverterParameter for the Grid's Background property. The value I want to use for this is a DependencyProperty I have added to the UserControl name Store. I don't care if the value is static or actually bound, since the value will be the same for all items in the ItemsControl, but the Converter needs this ConverterParameter in order to return the desired value. How can I either set the value for the ConverterParameter or bind the ConverterParameter to a property of the UserControl? Any help would be appreciated. Thanks.
    Saturday, December 31, 2011 3:27 AM