Click here to Skip to main content
15,889,096 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: How to make the arrows keys act as another keys? Pin
Abhinav S16-Apr-10 1:34
Abhinav S16-Apr-10 1:34 
QuestionTreeView Data binding Pin
Joe Rozario15-Apr-10 20:45
Joe Rozario15-Apr-10 20:45 
AnswerRe: TreeView Data binding Pin
Pete O'Hanlon15-Apr-10 22:01
mvePete O'Hanlon15-Apr-10 22:01 
GeneralRe: TreeView Data binding Pin
Joe Rozario15-Apr-10 22:26
Joe Rozario15-Apr-10 22:26 
GeneralRe: TreeView Data binding Pin
Pete O'Hanlon16-Apr-10 2:46
mvePete O'Hanlon16-Apr-10 2:46 
GeneralRe: TreeView Data binding Pin
silverlightnewbee4-Jan-11 18:34
silverlightnewbee4-Jan-11 18:34 
AnswerRe: TreeView Data binding Pin
Leung Yat Chun26-Apr-10 10:19
Leung Yat Chun26-Apr-10 10:19 
QuestionUriMapper (and stuff) [SOLVED (sorta)] Pin
#realJSOP15-Apr-10 6:23
mve#realJSOP15-Apr-10 6:23 
I have the following xaml (nonessential markup removed in the interest of brevity):

<navigation:Frame x:Name="ContentFrame" >
    <navigation:Frame.UriMapper>
        <uriMapper:UriMapper>
            <uriMapper:UriMapping Uri="/{pageName}" 
                                  MappedUri="/Views/{pageName}.xaml"/>
            <uriMapper:UriMapping Uri="/FMChart/{metricID}/{orgID}" 
                                  MappedUri="/Views/FMChart.xaml?metricID={metricID}&orgID={orgID}"/>
        </navigation:Frame.UriMapper>
    </navigation:Frame.UriMapper>
</navigation:Frame>


I'm creating the HyperLinkButton objects dynamically (in code), like so:

int metricID = 1;
int orgID = 1;

HyperlinkButton button = new HyperlinkButton();
button.Name        = Guid.NewGuid().ToString();
button.TargetName  = "ContentFrame";
<br />

<big>string url = string.Format("/FMChart/{0}/{1}", metricID, orgID);</big> // <<------

button.NavigateUri = new Uri(url, UriKind.Relative);



When I click the bbutton, the browser renders a blank page, and eventually presents me with a REALLY long stack trace (InvalidOperation exception). If I take the parameters out of th indicated line:

string url = "/FMChart";


...it works as expected (brings up the desired page).

What am I doing wrong?

SOLUTION ===========================================

It seems that the order of the UriMappers in the XAML matters. Originally the mapping I specified was the last one listed in the group. When I changed it to be the FIRST item in the group, it worked. The reason I say this is"sorta" solved is that I think this is a bug in Silverlight. It was a unique mapping (compared to all of the others) and should have been discovered by Silverlight in the original order.
.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001

modified on Friday, April 16, 2010 2:22 PM

AnswerRe: UriMapper (and stuff) Pin
Abhinav S16-Apr-10 1:50
Abhinav S16-Apr-10 1:50 
GeneralRe: UriMapper (and stuff) Pin
#realJSOP16-Apr-10 6:10
mve#realJSOP16-Apr-10 6:10 
GeneralRe: UriMapper (and stuff) [SOLVED (sorta)] Pin
Abhinav S16-Apr-10 20:19
Abhinav S16-Apr-10 20:19 
QuestionEncrypting app.config through code [modified] Pin
dashingsidds15-Apr-10 0:21
dashingsidds15-Apr-10 0:21 
AnswerRe: Encrypting app.config through code Pin
dashingsidds15-Apr-10 0:57
dashingsidds15-Apr-10 0:57 
AnswerRe: Encrypting app.config through code Pin
Not Active15-Apr-10 2:08
mentorNot Active15-Apr-10 2:08 
GeneralRe: Encrypting app.config through code Pin
dashingsidds15-Apr-10 2:59
dashingsidds15-Apr-10 2:59 
GeneralRe: Encrypting app.config through code Pin
Not Active15-Apr-10 3:31
mentorNot Active15-Apr-10 3:31 
GeneralRe: Encrypting app.config through code Pin
dashingsidds15-Apr-10 18:40
dashingsidds15-Apr-10 18:40 
QuestionWPF Toolkit Datagrid Performance issue in rendering Pin
Ankush12314-Apr-10 20:47
Ankush12314-Apr-10 20:47 
AnswerRe: WPF Toolkit Datagrid Performance issue in rendering Pin
Leung Yat Chun26-Apr-10 10:27
Leung Yat Chun26-Apr-10 10:27 
QuestionHow to create a random button appear in parent button Pin
yuripon14-Apr-10 18:52
yuripon14-Apr-10 18:52 
AnswerRe: How to create a random button appear in parent button Pin
Abhinav S14-Apr-10 19:02
Abhinav S14-Apr-10 19:02 
GeneralRe: How to create a random button appear in parent button Pin
yuripon14-Apr-10 19:12
yuripon14-Apr-10 19:12 
GeneralRe: How to create a random button appear in parent button Pin
Abhinav S14-Apr-10 19:22
Abhinav S14-Apr-10 19:22 
GeneralRe: How to create a random button appear in parent button Pin
yuripon15-Apr-10 17:23
yuripon15-Apr-10 17:23 
AnswerRe: How to create a random button appear in parent button Pin
Kunal Chowdhury «IN»27-Apr-10 8:58
professionalKunal Chowdhury «IN»27-Apr-10 8:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.