コード例 #1
0
        public override void FetchTableDataFromDatabase()
        {
            base.FetchTableDataFromDatabase();

            TableSource.SetItems(TableView, RealmServices.GetMyOutlets());
            IfEmpty(true);
        }
コード例 #2
0
        public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState)
        {
            var view = base.OnCreateView(inflater, container, savedInstanceState);

            RecyclerViewAdapter.SetListItems(RealmServices.GetMyOutlets().ToList());

            Activity.Title = SettingsShared.navigation_item_my_outlets;


            RegisterForContextMenu(RecyclerView);

            return(view);
        }
コード例 #3
0
        public override void ViewDidLoad()
        {
            PullToRefresh = false;

            base.ViewDidLoad();

            TableSource = new MyOutletsTableViewSource();
            TableSource.ItemSelected += (NSIndexPath arg1, Outlet arg2) =>
            {
                OutletSelected?.Invoke(arg2);
            };
            TableSource.RowDeleted += (NSIndexPath arg1, Outlet arg2) =>
            {
                RealmServices.DeleteOutlet(arg2);
                TableSource.TableItems = RealmServices.GetMyOutlets();
            };
            TableView.Source = TableSource;


            var label = LabelWithActivityIndicatorView.Create();

            label.BindDataToView("No Outlets", true);
            TableViewEmptyBackground = label;


            AddRowViewController FooterView = new AddRowViewController();

            FooterView.LabelAddText = Strings.TableViewFooters.table_view_footer_create_new_outlet;
            FooterView.Clicked     += (editing) =>
            {
                CATransition transition = CATransition.CreateAnimation();
                transition.Duration = 0.3;
                transition.Type     = CATransition.TransitionFade;
                NavigationController.View.Layer.AddAnimation(transition, null);
                NavigationController.PushViewController(new NewOutletViewController(), false);
            };
            FooterView.View.Frame     = new CGRect(0, 0, TableView.Frame.Width, FooterView.GetHeight());
            TableView.TableFooterView = FooterView.View;
            AddChildViewController(FooterView);
        }
コード例 #4
0
        public override bool OnContextItemSelected(IMenuItem item)
        {
            var position = item.Order;

            var model = RecyclerViewAdapter.GetItemInList(position);

            if (model == null)
            {
                return(base.OnContextItemSelected(item));
            }

            switch (item.TitleFormatted.ToString().ToLower())
            {
            case "delete":
                RealmServices.DeleteOutlet(model);
                RecyclerViewAdapter.SetListItems(RealmServices.GetMyOutlets().ToList());
                break;

            default: break;
            }

            return(base.OnContextItemSelected(item));
        }