Can we say that, it is not a good idea using panel plugins that will be packaged and licenced. Because it seems that I couldn’t add MenuBar for some options. What do you think?
Just to give a little background to the reasoning why you cannot use a menu bar in a panel or other container is because macOS does not support it. However, here are some alternatives you can experiment with:
It is turn the clock back but I realized something then wanted to ask to you. I was trying to create 2 nested sub menu. I did not achieve add MenuSegmentedItem into another MenuSegmentedItem object. How can I achieve this?
@oguzhankoral simply add a new ButtonMenuItem to the parent ButtonMenuItem.Items collection…
e.g.
var fileSegmentedItem = new MenuSegmentedItem()
{
Text = "File",
Menu = new ContextMenu()
{
Items =
{
new ButtonMenuItem
{
Text = "Hello",
Items =
{
new ButtonMenuItem { Text = "A sub menu item" },
new ButtonMenuItem { Text = "A 2nd sub menu item" }
}
}
}
}
};
SegmentedButton main = new SegmentedButton()
{
Items =
{
new MenuSegmentedItem
{
Text = "Lala",
Menu = new ContextMenu()
{
Items =
{
new ButtonMenuItem
{
Text = "Lala New",
Command = this.ViewModel.NewCommand,
},
new ButtonMenuItem
{
Text = "Lala Delete",
Command = this.ViewModel.DeleteCommand,
}
}
}
}
}
};
I know the subject is closed, but is there by any chance a way of changing the style to the SegmentedButton. It does have a property BackgroundColor, but changing it to Color.Transparent doesn’t do anything. I also tried to make a custom style based on the platform, but no luck so far.
I would like to get rid of the border and set the backgroundcolor to transparent.
I didn’t get any colour so far. Do you have by any chance a code example which I could use? As I said - borderthickness=0 and the colour I woud set to the background of the parent control.
Eto does support ARGB background colours, however the SegmentedButton control hasn’t been set up to set the background colour of the buttons. I’ve logged that as RH-66952.
One thing that might work for you right now is Rhino has a special style for the SegmentedButton called “nofocusnoborder” which should get you close to what you want. To apply it use this:
var mySegmentedButton = new SegmentedButton();
mySegmentedButton.Style = "nofocusnoborder";
In v8 we may make this the default style, noted with RH-65559.
Note that this style only applies to windows, however it is more “normal” to have a NSSegmentedControl control on Mac so it fits in better.