Start New Discussion within our Software Development Community

My application is in VS2010,Silverlight and coded in C#.Net.
My requirement is i want to upload Image in my Imagebox control.As there is no PictureBox control in Silverlight im using ImageBox.
I have a Imagebox,below that a Browse button.
When the User clicks on Browse button,Dialogbox should open and when the USer selects a Image it should be loaded to Image box..
Example for Picturebox is available on the forum but i want it for Imagebox.
Below is my code.

OpenFileDialog imageDialog = new OpenFileDialog();

            //Filter default filetype to be allowed for selection 
            imageDialog.Filter = "Pictures (*.jpg)|*.jpg";
            imageDialog.FilterIndex = 1;

            //Allows multiple files to be selected 
            imageDialog.Multiselect = true;

            //Call the ShowDialog method to show the dialog box 
            bool? userClickedOK = imageDialog.ShowDialog();

            //Process input if the user clicked OK 

            if (userClickedOK == true)
              image1.Source = 

image1 is my image control
Please correct me in image1.Source=.....

I don't know of any ImageBox in C#.
Only a PictureBox control with an Image property.
To load an image in a picturebox use something like:
pictureBox1.Image = MyJPEGimage;

im Using Silverlight.I have tried Picturebox in normal windows application.
But there is no Picturebox in silverlight application on Imagebox is there.

imageDialog is the object of OpenFileDialog and i was assigning this object to Image Source.

We will have to bind image to Image.Source. Below is the code snippet I tried and able to bind image.

OpenFileDialog objFileDialog = new OpenFileDialog();
            bool? IsSelected = objFileDialog.ShowDialog();
            if (IsSelected == true)
                BitmapImage bitImage = new BitmapImage();
                //Image1 is object of Image
                Image1.Source = bitImage;
This question has already been answered. Start a new discussion instead.