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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:48:41+00:00 2026-05-27T16:48:41+00:00

Please help me, i am new to WP7 development.I have a class like this

  • 0

Please help me, i am new to WP7 development.I have a class like this in code behind page(.xaml.cs):

public class NullVisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return value == null ? Visibility.Collapsed : Visibility.Visible;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            Visibility? v = value as Visibility?;
            return ((v.HasValue) || (v.Value == Visibility.Collapsed)) ? null : "";
        }
    }

I have a .xaml file is like this:

<ListBox ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled" x:Name="lstImages" HorizontalAlignment="Center" ItemsSource="ImageList" Padding="0" Margin="0" BorderThickness="0"  >
                                        <ListBox.ItemTemplate>
                                            <DataTemplate>
<Image x:Name="imgSe" Visibility="{Binding Default, Converter={StaticResource NullVisibilityConverter}}" Height="50" Source="../Assets/g1.png"></Image>
 </DataTemplate>
                                        </ListBox.ItemTemplate>
                                    </ListBox>

So Default is a class in ImageList(IList), So if Default is Null then i have to hide the Image and if Default is not null then i have to show that image. I have tried the above code but my app is crashing. I am getting warning as “the resource NullVisibilityConverter could not be resolved” in .xaml page.

Thanks in advance.

  • 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-27T16:48:41+00:00Added an answer on May 27, 2026 at 4:48 pm

    You need to create an instance of your value converter within your page resources as follows. Note, the use of xmlns which maps your C# namespace to an XML namespace:

    <phone:PhoneApplicationPage 
       xmlns:conv="clr-namespace:ConverterNamespace"
       ...
       >
    
        <phone:PhoneApplicationPage.Resources>
            <conv:NullVisibilityConverter x:Key="VisibilityConverter"/>
        </phone:PhoneApplicationPage.Resources>
      ...
    </phone:PhoneApplicationPage>
    

    Now reference it as follows, note the conv prefix defined above:

    <Image x:Name="imgSe" Visibility="{Binding Default, Converter={StaticResource VisibilityConverter}}" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

please help me with the following problem. i have a class, like public class
Can someone explain to me this code new Object[]{PLease,Help}; Ive never seen code like
Please help me understand this code. I am new to java. // C.java class
I have written this code in C# for WP7 : public void btn_handler(object sender,
Please help! I am new to the .NET web application development. I have used
I am very new to iPhone/iPad development. can you please help me create this
I've view like this. It worked. I'm new to django. Can you please help
I am new in CSS so please help me in this problem. I hope
I am quite new to programming, i have a question please help me. (
I am new to this website and new to Jquery. So seniors please help

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.