Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Open page from ContextAction.Clicked

$
0
0

How can I open new page from context action?

Some code:

public class DriveCell : ViewCell
{
    public DriveCell()
    {
        ...creating layout here...

        CreateActions();
    }

    private void CreateActions()
    {
        var editAction = new MenuItem { Text = "Edit" };
        editAction.SetBinding(MenuItem.CommandParameterProperty, new Binding("."));
        editAction.Clicked += async (sender, e) =>
        {
            await Task.Run(() =>
            {
                var mi = (MenuItem)sender;
                var someClass = (SomeClass)mi.CommandParameter;

        // TODO open edit page here
            });
        };

        ContextActions.Add(editAction);
    }
}

Viewing all articles
Browse latest Browse all 58056

Trending Articles



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