question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting MenuItem Header to - makes it separator and does not display text

See original GitHub issue

Setting MenuItem Header to - makes it separator and does not display text.

repro:

<MenuItem Header="-"/>

1

2

style used:

<Style Selector="MenuItem">
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="FontSize" Value="12"/>
</Style>

version: 0.6.2-build6248-beta

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
maxkatz6commented, Apr 17, 2022

@robloo we have a Separator. It basically works exactly like MenuSeparator in UWP. There are styles for “MenuItem > Separator” selector to make it look right.

“-” support was specifically added before to simplify some use cases https://github.com/AvaloniaUI/Avalonia/pull/1891. But broke another rare scenario.

1reaction
grokyscommented, Sep 16, 2018

I should have known that someone would be using a menu item with just a “-”. Sigh. I wonder how you do this in winforms?

Read more comments on GitHub >

github_iconTop Results From Across the Web

A style intended for type 'MenuItem' cannot be applied to ...
When I try to add Separator to the ContextMenu I receive error: System.InvalidOperationException was unhandled Message="A style intended for ...
Read more >
YooTheme Pro Menu Heading and/or Text Separator ...
Hi,. I believe there's a bug with the subtitles option for menu items that are set to Text-Separator and/or Menu Headings.
Read more >
MenuItem Class (System.Windows.Controls)
Gets or sets a composite string that specifies how to format the Header property if it is displayed as a string. (Inherited from...
Read more >
How to: Use a Custom Context Menu with a TextBox - WPF ...
Each MenuItem element defines a command in the context menu; the Header attribute defines the display text for the menu command, and the...
Read more >
WPF Menu Controls - MenuItem (Page 3 of 4)
This holds a simple string that you can set to show the input gesture. Once set, the text appears to the right of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found