Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Can you please help me?

$
0
0

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


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>