Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8189795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:24:10+00:00 2026-06-07T03:24:10+00:00

Okay. So I want my application to display in its main menu the Save

  • 0

Okay. So I want my application to display in its main menu the “Save” and “Save As…” items just like Visual Studio does; i.e. “Save {current file}” and “Save {current file} As…”

I would also like to have the normal access keys (“S” and “A”, respectively).

I’ve come up with two solutions, but neither is very desirable.

  • Instead of creating the main menu exclusively in xaml, I could
    create it all in the MainWindowViewModel so I’d have full control over what goes into the generated MenuItems. However, I feel that this would be a violation of MVVM (which I’m attempting to abide by very strictly this time around) as I would have to include references to each MenuItem’s Icon in the ViewModel. Plus it seems a little messy.

  • I can stipulate the header of just these two specific MenuItems (and perhaps future ones) like so, but then I end up getting a MenuItem that not only has a underscore in the header, but also does not contain an access key.

<MenuItem Header="{Binding CurrentFileName}"
          HeaderStringFormat="Save {0} _As...">

What should I do?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T03:24:12+00:00Added an answer on June 7, 2026 at 3:24 am

    Whelp, figured it out. At least about how to get it done with the whole main menu described in XAML. Just made the header content an AccessText control instead of a string and it works like a charm.

    <MenuItem>
        <MenuItem.Style>
            <Style TargetType="{x:Type MenuItem}">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding HasSelection}" Value="false">
                        <Setter Property="IsEnabled" Value="false"/>
                        <Setter Property="Header">
                            <Setter.Value>
                                <AccessText Text="Save Selected File _As..."/>
                            </Setter.Value>
                        </Setter>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding HasSelection}" Value="true">
                        <Setter Property="IsEnabled" Value="true"/>
                        <Setter Property="Header">
                            <Setter.Value>
                                <AccessText Text="{Binding SelectedFile.Filename, StringFormat=Save {0} _As...}"/>
                            </Setter.Value>
                        </Setter>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </MenuItem.Style>
    </MenuItem>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay so I want to make an application that launches other applications. However, the
I just want to ask if is it okay that I use native PHP
okay, so i have an asp.net (C#) application and i want to add a
Okay -- we have an interesting problem. Some background: Our main application uses Indy
Okay, I am working on an application and I want to store a file
I'm looking to build a Silverlight application and want to display a Tag Cloud
I'm writing a Java application like AIM where I want a lookup server to
Okay so here is what I want to do. I want to add a
Okay, so I want to have a generic method that can read data from
Okay so I have an idea on how I want to serve and cache

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.