Search code examples
wpfmodern-ui

add a button as a Left/Right window command


i'm working in WPF project i'm using ModernUI modernui

in there sample they made the HELP and Settings i need to know how. i want to set the logout button


Solution

  • The design of Modern UI Navigation App is in a way that making your logout link work like a button is not simply possible.

    What you can do is to look for tag below in MainWindow.xaml :

    <mui:ModernWindow.TitleLinks>
    

    then add this tag as its last child:

        <mui:Link DisplayName="logout" Source="/Pages/LogoutPage.xaml"></mui:Link>
    

    With this you need to create a new page in Pages folder called LogoutPage and put the code required to execute for Logout in it's Constructor method and if you want navigate back.