示例#1
0
            public MyCell(NewPage1 myPage)
            {
                var label = new Label
                {
                    VerticalOptions = LayoutOptions.CenterAndExpand,
                };
                //label.SetBinding(Label.TextProperty, new Binding("."));

                var actionDelete = new MenuItem
                {
                    Text          = "Delete",
                    Command       = new Command(p => myPage.DisplayAlert("Delete", p.ToString(), "OK")),
                    IsDestructive = true,
                };

                actionDelete.SetBinding(MenuItem.CommandParameterProperty, new Binding("."));
                actionDelete.Clicked += (s, a) => myPage.Action((MenuItem)s);
                ContextActions.Add(actionDelete);

                View = new StackLayout
                {
                    Padding  = 10,
                    Children = { label }
                };
            }
示例#2
0
        public App(string dbPath)
        {
            //AppのdbPathに引数のパスを設定
            App.dbPath = dbPath;

            InitializeComponent();

            MainPage = new NewPage1();
        }