Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm using WPF ribbon in an Application.I'm searching space to add a label to it which automatically updates according to the logged in user of database.so,I found it in quick access toolbar. but i want it to extreme rightmost cornet of application .I tried the HorizontalAlignment property of text but i won't work.In General I want label appear on Top right corner .Here's xaml:

HTML
<Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Ribbon x:Name="RibbonWin"  SelectedIndex="0">
                <Ribbon.HelpPaneContent>
                    <RibbonButton />
                </Ribbon.HelpPaneContent>
                <Ribbon.QuickAccessToolBar>
                    <RibbonQuickAccessToolBar>
                        <RibbonButton x:Name ="Save" />
                        <RibbonSplitButton x:Name ="Undo" >
                            <RibbonSplitMenuItem Header="Undo 1" />
                            <RibbonSplitMenuItem Header="Undo 2" />
                            <RibbonSplitMenuItem Header="Undo 3" />
                        </RibbonSplitButton>
                    <RibbonSplitButton x:Name="Redo" >
                        <RibbonSplitMenuItem Header="Redo 1" />
                        <RibbonSplitMenuItem Header="Redo 2" />
                    </RibbonSplitButton>
                    <Label Background="White"  Content="Welcome ,USER"/>
                </RibbonQuickAccessToolBar>
                </Ribbon.QuickAccessToolBar>
                ...<a href=""></a><a href=""></a><a href=""></a>
            </Ribbon>
        </Grid>


Here's how it looks:
http://imagizer.imageshack.us/a/img673/2820/oexwmX.png[^]
Posted

1 solution

Why do you insist the logged on username is inside the ribbon when you want it to be placed outside the design parameter of the control.

Put is in a readonly textbox or a textblock in the same grid as the ribbon and align it right.

HTML
               </Ribbon>
        <textbolck text="{Binding UserName" horizontalalignment="Right" />
</Grid>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900