I create a toolbaritem on my mainpage.xaml.cs:
ToolbarItem tbi = new ToolbarItem();
tbi.Text = "SAVE";
tbi.Clicked += clickSave;
tbi.Order = ToolbarItemOrder.Primary;
tbi.Priority = 1;
ToolbarItems.Add(tbi);
void clickSave(object sender, EventArgs e) { ToolbarItem item = (ToolbarItem)sender; //item.Text = "Save Doc"; DisplayAlert("Do", "Doc Saved", "OK");
and it works fine.
I want to put this piece of code on a class, in a different file, and "call" it in the mainpage.
I tried "everything"!!!
thanks in advance and sorry for my bad english