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

  • SEARCH
  • Home
  • 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 8972287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:10:56+00:00 2026-06-15T18:10:56+00:00

I made this windows phone user control: XAML: <Grid x:Name=LayoutRoot Height=75 Width=353> <Image Height=50

  • 0

I made this windows phone user control:

enter image description here

XAML:

<Grid x:Name="LayoutRoot" Height="75" Width="353">
        <Image Height="50" HorizontalAlignment="Left" Margin="12,12,0,0" Name="img" Stretch="Fill" VerticalAlignment="Top" Width="50" />
        <TextBlock Height="50" HorizontalAlignment="Left" Margin="77,12,0,0" Name="txt" Text="TextBlock" VerticalAlignment="Top" Width="215" FontSize="32" />
        <CheckBox Content="CheckBox" Height="68" HorizontalAlignment="Right" Margin="0,3,10,0" Name="cb" VerticalAlignment="Top" Width="50" />
</Grid>

And I call it like that in one of my pages

XAML.CS:

myListBox mls = new myListBox();
String[,] ls = { { "Text1", "/image/image1.png" }, { "Tex2", "/image/image2.png" } };
for (int i = 0; i < 2; i++)
{
        mls.txt.Text = ls[i, 0];
        mls.img.Source = url(ls[i, 1]);
}

public ImageSource url (string path)
{
        Uri uri = new Uri(path, UriKind.Absolute);
        ImageSource imgSource = new BitmapImage(uri);
        return imgSource;
}

My problems are:

1) If I run this like that it take to the code below but if i change for loop to i<1 it working fine (but not exactly what i expect look problem 2)

// Code to execute on Unhandled Exceptions
    private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
    {
        if (System.Diagnostics.Debugger.IsAttached)
        {
            // An unhandled exception has occurred; break into the debugger
            System.Diagnostics.Debugger.Break();
        }
    }

2) With this code I set text and image but it not placing the image, only the text.

  • 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-06-15T18:10:57+00:00Added an answer on June 15, 2026 at 6:10 pm

    I have a similar working code and I have used UriKind as ‘Relative‘ and not ‘Absolute’.

    And one more thing. Make sure the ‘Build Action’ under the properties of the image which you’re using is set to ‘Content’ and NOT ‘Resource’ or anything else.

    Hopefully it’ll work.

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

Sidebar

Related Questions

I have made a custom control for windows phone 7. If I use this
I want add to my Windows phone app masked textbox, are there ready-made control
In my Windows Phone 7.1 application, I have some pages made in this way:
i made a windows service & add project installer.in which only contain this code.
I made this function to verify a user's twitter credentials. Its running on two
What Windows Phone 7 demo/reference applications have you seen which really made you interested
Im new to data binding in Windows Phone 7 and cannot get this code
I made application in windows phone (Using Windows Phone SDK 7.1 /C#). But am
I have a basic SMS interception application on a windows mobile phone, currently this
It's a follow-up from this . Windows Phone 8 C# project (MyApp), migrated from

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.