This project is read-only.

BackStage Items and Focus

Jun 23, 2010 at 9:42 PM

My Xaml

 

<fluent:Ribbon BackstageBrush="Orange" x:Name="_ribbon">
            <fluent:Ribbon.BackstageItems>
                <fluent:BackstageTabItem Header="New..." FocusManager.IsFocusScope="False">
                    <tc:CreateViewView />
                </fluent:BackstageTabItem>
                <fluent:Button Command="{x:Static local:MainWindowView.ShowOptionsCommand}" Text="Options" Icon="/Resources/Images/OptionsHS.png" />
                <fluent:Button Command="ApplicationCommands.Close" Text="Exit" Icon="/Resources/Images/Exit.png" />
            </fluent:Ribbon.BackstageItems>    
            <fluent:RibbonTabItem Header="Main" />
        </fluent:Ribbon>

 

If I am in the New section and focus goes there because I click an Item (such as a ListBox in the CreateViewView control), then clicking on Close (which should kill the application) simply closes the backstage, rather than executing the command.

Jun 24, 2010 at 12:07 AM

One way to resolve this would be to remove Command="ApplicationCommands.Close" from  <fluent:Button Command="ApplicationCommands.Close" Text="Exit" Icon="/Resources/Images/Exit.png" />.  Then implement a Click Event.  Similar to:  <fluent:Button Name="Exit" Text="Exit" Icon="/Resources/Images/Exit.png" Click="Exit_Click"/>

In the Exit_Click Event in Window.xaml.cs, add:  this.Close();

If you add KeyTip navigation to the button, or the user clicks the Exit button, the event will fire and close the application.  Hope this helps.

Jun 24, 2010 at 4:25 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.