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 182275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:54:39+00:00 2026-05-11T14:54:39+00:00

I have xaml that lookes like this <ListBox> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock Text={Binding Name}

  • 0

I have xaml that lookes like this

<ListBox> <ListBox.ItemTemplate>     <DataTemplate>         <StackPanel>             <TextBlock Text='{Binding Name}' />             <StackPanel Orientation='Vertical' x:Name='contentPanel' >             Content goes here...             </StackPanel>         </StackPanel>     </DataTemplate> </ListBox.ItemTemplate> 

The listbox binds to an object with a bool property called ShowContent. How do I get silverlight to hide the contentPanel if the object with ShowContent is false?

  • 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. 2026-05-11T14:54:40+00:00Added an answer on May 11, 2026 at 2:54 pm

    Write a BoolToVisibility IValueConveter and use it to bind to the Visibility property of your contentPanel

    <StackPanel Visibility='{Binding YourBoolProperty, Converter={StaticResource boolToVisibilityResourceRef ..../> 

    You can find a BoolToVisibility pretty easy anywhere.

    Check IValueConveter if you are new to that. http://msdn.microsoft.com/en-us/library/system.windows.data.ivalueconverter.aspx

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

Sidebar

Related Questions

I have a ListBox containing CheckBoxes. Xaml looks like this: <ListBox x:Name=lbContactTypes> <ListBox.ItemTemplate> <HierarchicalDataTemplate>
Suppose I have some XAML like this: <Window.Resources> <v:MyClass x:Key=whatever Text=foo\nbar /> </Window.Resources> Obviously
I have the following XAML: <TextBlock Text={Binding ElementName=EditListBox, Path=SelectedItems.Count} Margin=0,0,5,0/> <TextBlock Text=items selected> <TextBlock.Style>
I have a ListView bound to XML. The XAML looks like this: <ListView Name=patientsListView
I have a simple WPF (XAML) file that has some animated shapes and text.
I have a string representation of a XAML Grid like this: <Grid xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation> <Canvas
I have a simple class that provides state codes like this: public class StateProvider
I have a custom UserControl that consists of a ListBox with a DataTemplate .
In a Windows Phone 7 project I'm using XAML that looks like this; <phone:PhoneApplicationPage.Resources>
I have a XAML form that I would like two independent features threaded out

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.