locked
Sketchflow button question - External URL RRS feed

  • Question

  • I am using Sketflow to create some screen mocks.

    I would like to set one of my buttons to navigate to an external url when clicked (http\\:www.bbc.co.uk).

    Any idea how I can acheive this?

    Any help appreciated.

    Regards,

    Paul.
    Sunday, February 21, 2010 10:54 PM

Answers

  • If you are using silverlight, what you probably want is a hyperlinkbutton.

    For example:
    <HyperlinkButton Content="Bing.com" NavigateUri="http://bing.com/" TargetName="_blank"/>
    What Brennon is describing is how you would go about this using WPF.  You call that method with the URL, and windows will load the default browser.

    You could also use the hyperlinkaction behavior, what is important to note, and possibly why it didn't work for GClaes is that a button captures the default trigger action of leftmousebuttondown, I used Click instead.
    <Button Content="Button" >
    			<i:Interaction.Triggers>
    				<i:EventTrigger EventName="Click">
    					<ic:HyperlinkAction NavigateUri="http://bing.com/" TargetWindow="_blank"/>
    				</i:EventTrigger>
    			</i:Interaction.Triggers>
    		</Button>


    • Proposed as answer by Chuck HaysModerator Monday, February 22, 2010 2:37 PM
    • Marked as answer by wadep Tuesday, February 23, 2010 9:12 AM
    Monday, February 22, 2010 2:37 PM
    Moderator

All replies

  • Howdy,

    You can do this with minimal code. The following has an example that will show exactly what you need.

    http://msdn.microsoft.com/en-us/library/53ezey2s.aspx


    HTH

    Cheers

    Expression MVP

    my blog : http://x-coders.com/blogs/sneaky/default.aspx

    Sunday, February 21, 2010 11:08 PM
    Moderator
  • Hi Brennon,

    I've had a look at your link (http://msdn.microsoft.com/en-us/library/53ezey2s.aspx
    ), but it seems to describe a Process.Start.Method.

    I'm don't understand how this answers my question.

    I've built a very simple screen using Sketchflow. This screen contains a button.

    I would like the button to navigate to an external URL (http://www.bbc.co.uk) when clicked.

    I can set the 'NavitageTo' on the button click to 'back', but I need it to go to an external URL.

    I can write C# code, but I'm not sure how to do this with Sketchflow.

    I'm very new to sketchflow, so any help would be appreciated.

    Regards,

    Paul.
    Monday, February 22, 2010 9:55 AM
  • I am actually after something similar, I tried the "HyperlinkAction" behavior but it doesn't seem to open the browser let alone point to the URL :)
    Monday, February 22, 2010 10:40 AM
  • If you are using silverlight, what you probably want is a hyperlinkbutton.

    For example:
    <HyperlinkButton Content="Bing.com" NavigateUri="http://bing.com/" TargetName="_blank"/>
    What Brennon is describing is how you would go about this using WPF.  You call that method with the URL, and windows will load the default browser.

    You could also use the hyperlinkaction behavior, what is important to note, and possibly why it didn't work for GClaes is that a button captures the default trigger action of leftmousebuttondown, I used Click instead.
    <Button Content="Button" >
    			<i:Interaction.Triggers>
    				<i:EventTrigger EventName="Click">
    					<ic:HyperlinkAction NavigateUri="http://bing.com/" TargetWindow="_blank"/>
    				</i:EventTrigger>
    			</i:Interaction.Triggers>
    		</Button>


    • Proposed as answer by Chuck HaysModerator Monday, February 22, 2010 2:37 PM
    • Marked as answer by wadep Tuesday, February 23, 2010 9:12 AM
    Monday, February 22, 2010 2:37 PM
    Moderator
  • Mmmm, I just tested it also on FF and IE .... it only seems to fail on my preferred browser Chrome!   For some reason the SketchFlow player and the Chrome popup blocker don't like each other - other sites allow me to tell Chrome to allow a popup but not the SketchFlow player.

    Edit: having said that the HyperlinkButton does work, so, that'll do for me now.
    Monday, February 22, 2010 2:54 PM
  • I've got the hyperlink working using <HyperlinkButton Content="Bing.com" NavigateUri="http://bing.com/" TargetName="_blank"/>, but.... my button still doesn't work. This is what my button looks like....

    <Button Content="Button" >
    			<i:Interaction.Triggers>
    				<i:EventTrigger EventName="Click">
    					<pb:NavigateToScreenAction TargetScreen="http://www.bbc.co.uk" />
    </i:EventTrigger> </i:Interaction.Triggers> </Button>
    I don't seem to be able to set it to <ic:HyperlinkAction NavigateUri="http://bing.com/" TargetWindow="_blank"/>

    Any ideas what I'm doing wrong?

    Regards,

    Paul.
    Monday, February 22, 2010 3:10 PM
  • Hi Paul, you need to use the "HyperLinkAction" from "Assets - Behavior" rather than the NavigateToScreen.
    Monday, February 22, 2010 3:12 PM
  • Just as an FYI, SL4 is adding official support for Chrome:

    http://www.silverlight.net/getstarted/silverlight-4-beta/#whatsnew
    Monday, February 22, 2010 3:15 PM
    Moderator
  • Hi,
    That worked great:)

    Thanks for the help.

    Regards,

    Paul.
    Monday, February 22, 2010 3:28 PM
  • Howdy,

    My bad on the WPF assumption... nice pick up Chuck.

    Paul can you mark Chucks reply as the answer please so as other may benifit.

    Cheers

    Expression MVP

    my blog : http://x-coders.com/blogs/sneaky/default.aspx

    Monday, February 22, 2010 8:42 PM
    Moderator