locked
Sketchflow external link to internal page. RRS feed

  • Question

  • I want to have someone hit a link, that will load up the sketchflow project that is exported and go to a certain page within that project. And by sketchflow project, I mean that whole "package sketchflow project" option from blend. it creates the xap file and an html file that someone can hit
    so it would be hit by going to <path to project>/sketchflowProject.html
    and am hoping to do something like <path to project>/sketchflowProject.html#ContactPage to go to the contact page for the prototype. Is this possible?

    I want to be able to have someone review a specific page in a sketchflow project without having to find it in the player.
    Thursday, June 17, 2010 5:28 PM

Answers

  • There is no built in functionality, but you could probably do it in app.xaml.cs in a loaded event handler. At that point you could parse the request URI and load the proper page into the SketchFlow player.  I could post an example if you would like.
    • Marked as answer by Samekh Friday, June 18, 2010 3:01 PM
    Thursday, June 17, 2010 6:38 PM
    Moderator

All replies

  • There is no built in functionality, but you could probably do it in app.xaml.cs in a loaded event handler. At that point you could parse the request URI and load the proper page into the SketchFlow player.  I could post an example if you would like.
    • Marked as answer by Samekh Friday, June 18, 2010 3:01 PM
    Thursday, June 17, 2010 6:38 PM
    Moderator
  • If you wouldn't mind, that'd be great. I am evaluating it for usage as our primary prototyping tool for our asp.net mvc website, but am certainly not adept at silverlight.  If its a simple solution, to roll in, that'd definitely be something worth tackling.
    Thursday, June 17, 2010 7:00 PM
  • OK, here you go, sorry about the delay, the forums were not sending notification emails for the past week :(

     

    In your app.xaml.cs file, change the code to look like this, what it does it find the portion of the uri after the # and use that to load the proper screen.  Please note that this is entirely unsupported, and may change in future releases, it is just provided to you as an example.

     

    To use it, form your uri with #Namespace.Classname after the html file name, for example:

    http://localhost:26600/Default.html#SilverlightPrototype7Screens.Screen_Name_2

    The namespace/classname have to match the screen's information exactly, which you can find in the .cs code behind file for the screen.

    public App()
    		{
    			this.Startup += this.Application_Startup;
    			this.Exit += this.Application_Exit;
    			this.UnhandledException += this.Application_UnhandledException;
    			
    
    			InitializeComponent();
    		}
    
    		private void Application_Startup(object sender, StartupEventArgs e)
    		{
    			var rv = new Microsoft.Expression.Prototyping.Workspace.PlayerWindow();
    			this.RootVisual = rv;
    			rv.Loaded += new RoutedEventHandler(rv_Loaded);
    		}
    
    		void rv_Loaded(object sender, RoutedEventArgs e)
    		{
    			// Parse Uri
    			var page = Application.Current.Host.NavigationState;
    			if(!string.IsNullOrWhiteSpace(page))
    			{
    				Microsoft.Expression.Prototyping.Services.PlayerContext.Instance.ActiveNavigationViewModel.NavigateToScreen(page, false); 
    			}
    
    		}

    Thursday, June 24, 2010 12:35 PM
    Moderator
  • I don't know if this was followed up on since or better ways found that have been initiated in other posts.

    I know you have a disclaimer, but the problem with this is:

     

    It only loads once on startup.

    The uri within the browser does not change if I want to go to a different screen and have the browser reflect the new uri.  Is there a similar JS bridge for Silverlight similar to what Flex has to allow for easy communication with the browser and javascript?

     

    Also - is the 'Navigation Framework' still valid for Blend 4, and is it relevant to solving this problem?

     

    Thanks for your help, Chuck.

     

    BTW - I just found - http://msdn.microsoft.com/en-us/library/bb404716%28v=VS.95%29.aspx

    Is this still relevant for Silverlight 4?

     

    Wednesday, December 1, 2010 5:22 AM