tags:

views:

55

answers:

1

HI i'm developing a software(WPF) and i will insert a feature but i don't know how work out it. I have a Window Login (username,Password)to enter in the software after that the user insert the credentials appear a MainWindow and i have a textblock(txt_Username) to store the Username of the Window Login in this MainWindow.Now in the MainWindow i have a Frame that store the Page from the TreeView in this way:

  <Frame  HorizontalContentAlignment="Stretch" LoadCompleted="frSample_LoadCompleted" Navigating="frSample_Navigating" VerticalContentAlignment="Stretch" x:Name="frSample" Background="{x:Null}" Margin="0,0,0,0" Source="{Binding ElementName=TreeViewForm, Path=SelectedItem.XamlFilePath, IsAsync=True, FallbackValue=Benvenuto.xaml}"/>

..so i can navigate in my apps using the TreeView , In My apps i have a lot of Pages so my feature is create a textBlock in each page and store textBlock (txt_Username) from the MainWindow so in each page appear the Name of the User Login but i don't know how work out this feature ...Do you have any idea how i can do this feature?

Thanks so much

Cheers

A: 

You can use

User.Identity.Name

on anypage if you are using asp Membership (which I assume you are) to display to logged in name.

waqasahmed
Thanks for your response waqasahmed,i use Thread.CurrentPrinciple.Name ,for my poor knowledge i did not study yet Asp :(.Cheers
JayJay