I'm adding toolbar item
to the Page.ToolbarItems
list, but I would like to add a line separator between certain toolbar item
. I could add a new toolbar item
with an image of a line, but I would need to prevent any Action
when the line is pressed and it won't allow me to use null
. It would also look less than ideal.
Note that that each ToolbarItem
is added through the C# code, not through Xaml.
Here is some pseudo code as an example of what I have now:
if(!ToolbarItems.Any())
{
ToolbarItems.Add(new ToolbarItem("Page 1", null, NavigateToPage1(), ToolbarItemOrder.Secondary, 0);
ToolbarItems.Add(new ToolbarItem("Page 2", null, NavigateToPage2(), ToolbarItemOrder.Secondary, 0);
// <Insert Separator Here>
if(boolVal) {
ToolbarItems.Add(new ToolbarItem("Page 3", null, NavigateToPage3(), ToolbarItemOrder.Secondary, 0);
}
ToolbarItems.Add(new ToolbarItem("Page 4", null, NavigateToPage4(), ToolbarItemOrder.Secondary, 0);
ToolbarItems.Add(new ToolbarItem("Page 5", null, NavigateToPage5(), ToolbarItemOrder.Secondary, 0);
// <Insert Separator Here>
ToolbarItems.Add(new ToolbarItem("Page 6", null, NavigateToPage6(), ToolbarItemOrder.Secondary, 0);
}