Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 658529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:56:37+00:00 2026-05-13T22:56:37+00:00

I have a ListBox in Silverlight that has a list of items inside. Each

  • 0

I have a ListBox in Silverlight that has a list of items inside. Each item has a certain number of additional options, the availability of which depends on the each item.

   <ListBox.ItemTemplate>
      <DataTemplate>
         <StackPanel Orientation="Horizontal">                                    
            <TextBlock Text="{Binding Name}" />
            <Button HorizontalAlignment="Right" x:Name="editDiarySecurityButton">
               <Image Source="/xxx.yyy.Silverlight.Common;Component/Resources/Images/Icons/Ribbon/Small/editSecurity.png" Width="16" Height="16" />
            </Button>
         </StackPanel>
      </DataTemplate>                                                           
   </ListBox.ItemTemplate>  
</ListBox>

The Button editDiarySecurityButton should be handled according to whether that item (representing a Diary) has Security applied to it, or not. I would probably just modify the opacity of the image to reflect this.

My question is how can I achieve this? In ASP.NET, I’d have attached to the ItemDataItemBound event, but I don’t think this is available in WPF/Silverlight.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T22:56:37+00:00Added an answer on May 13, 2026 at 10:56 pm

    Since you asked specifically about the Opacity property, bind the Button’s Opacity property to a property on your DataContext that returns a double. Add whatever logic you need to the property to return the Opacity you desire for that item. Something like this:

    <Button HorizontalAlignment="Right" x:Name="editDiarySecurityButton"
     Opacity="{Binding Path=ButtonOpacity, Mode=OneWay}"> 
        <Image Source="/xxx.yyy.Silverlight.Common;Component/Resources/Images/Icons/Ribbon/Small/editSecurity.png" Width="16" Height="16" /> 
    </Button> 
    

    Then on your DataContext:

    public double ButtonOpacity
    {
        get {return _buttonOpacity; }
    }
    

    Use the same idea with any other property of the Button you want to control.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Silverlight, I have a Vertical ListBox that has a Horizontal ListBox for each
I have a Listbox, that has a Checkbox as part of the item template.
I have a silverlight ListBox that has it's ItemsSource set. From the C# code
I have a page that has a listbox with the following item template as
I have a Silverlight application that has a ListBox of a specific width. I
I have a ListBox bound to a list of Items (for arguement, lets say
I am developing a Silverlight application which has a list <ListBox x:Name=_list_collection SelectionChanged=SelectionChanged ScrollViewer.VerticalScrollBarVisibility=Auto
I have a ListBox that gets populated with items read from a JSON response.
i am using a Panorama control. inside each PanoramaItem, i have a ListBox. the
I have a Silverlight control which has a ListBox showing a series of email

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.