Skip to main content

Microsoft Silverlight

Answered Question RESTful SilverlightRSS Feed

(0)

Druad828
Druad828

Member

Member

0 points

2 Posts

RESTful Silverlight

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

I have an ADO.NET Data Service which presents my data in a really nice RESTful manner.  I’d like my Silverlight UI to match.  In other words, when my service sees:

http://... /service.svc/Team(2L)/Players

it returns a list of the players for team #2…which is great!  I have a Silverlight Navigation app which has a Page called “Team” which contains a TabControl with a tab which contains a DataGrid of the players.  I’d like to navigate to this Page / Tab Item using a similar restful methodology, so that:

http://.../Default.aspx#/Team/Team(2L)/Players

presents the team navigation page with team #2 displayed in the data and the players tab selected presenting the list of players in the data grid.  I know the key to this is the UriMapper class, but I’d really appreciate some additional guidance on this.  Any thoughts?

 

Mog Liang - MSFT
Mog Lian...

All-Star

All-Star

15884 points

1,541 Posts

Answered Question

Re: RESTful Silverlight

Hi,

Yes, this could be done by UriMapper.

To parse http://.../Default.aspx#/Team/Team(2L)/Players , we could use mapping

<uriMapper:UriMapping Uri="/Team/{query}" MappedUri="/Views/Team.xaml?query={query}"/>

in this way, the uri would redriect to /views/team.xaml page, at the same time, you could fetch the tail string from

 

NavigationContext.QueryString["query"]

Please have a test.

Thanks,

 

Mog Liang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Druad828
Druad828

Member

Member

0 points

2 Posts

Re: RESTful Silverlight

Thanks Mog,

 Yes, that works perfectly...now all I need to do to reflect the URI changes back to the browser, so that when a user browses through the Teams or changes the tab selection, the URI reflects those actions.  That way, the browser histroy will reflect the user's actions and the forward/back buttons will work correctly.  Then it will be like a "real" web app. Smile

 -Nelson

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities