WP7/Silverlight Hyperlink Image

后端 未结 3 1192
别那么骄傲
别那么骄傲 2021-01-14 01:59

I am new to both Silverlight and WP7. I have been attempting to hotlink an image by using a HyperlinkButton and setting its content to an Image. However, this just makes my

3条回答
  •  生来不讨喜
    2021-01-14 02:39

    It looks like you're trying to make an image launch a webpage when tapped.

    THe only way to launch a web page is to use the WebBrowserTask. If I were you I'd wrap an Image in a GestureListener (from the toolkit) and launch the task on a tap event.

    Like this:

    xaml:

        
            
                
            
        
    

    cs:

        private void GestureListener_Tap(object sender, GestureEventArgs e)
        {
            var wbt = new WebBrowserTask();
            wbt.URL = "http://www.stackoverflow.com/";
            wbt.Show();
        }
    

提交回复
热议问题