Example #1
0
        private void ConnectionIcon_Click(object sender, EventArgs e)
        {
            var t = SupportFragmentManager.BeginTransaction();
            PrinterConnectionFragment connection = new PrinterConnectionFragment()
            {
                ViewModel = Mvx.IoCConstruct <PrinterConnectionViewModel>()
            };

            t.Replace(Resource.Id.fragment_view, connection);
            t.Commit();
        }
Example #2
0
        public bool OnNavigationItemSelected(IMenuItem item)
        {
            var t = SupportFragmentManager.BeginTransaction();

            switch (item.ItemId)
            {
            case Resource.Id.navigation_print:
                PrintFragment connection = new PrintFragment()
                {
                    ViewModel = Mvx.IoCConstruct <PrintViewModel>()
                };
                t.Replace(Resource.Id.fragment_view, connection);
                t.Commit();
                return(true);

            case Resource.Id.navigation_control:
                PrinterConnectionFragment navigation = new PrinterConnectionFragment()
                {
                    ViewModel = Mvx.IoCConstruct <PrinterConnectionViewModel>()
                };
                t.Replace(Resource.Id.fragment_view, navigation);
                t.Commit();
                return(true);

            case Resource.Id.navigation_temperature:
                PrinterConnectionFragment temperature = new PrinterConnectionFragment()
                {
                    ViewModel = Mvx.IoCConstruct <PrinterConnectionViewModel>()
                };
                t.Replace(Resource.Id.fragment_view, temperature);
                t.Commit();
                return(true);

            case Resource.Id.navigation_terminal:
                PrinterConnectionFragment terminal = new PrinterConnectionFragment()
                {
                    ViewModel = Mvx.IoCConstruct <PrinterConnectionViewModel>()
                };
                t.Replace(Resource.Id.fragment_view, terminal);
                t.Commit();
                return(true);

            case Resource.Id.navigation_gcode:
                AccountFragment gcode = new AccountFragment()
                {
                    ViewModel = Mvx.IoCConstruct <AccountViewModel>()
                };
                t.Replace(Resource.Id.fragment_view, gcode);
                t.Commit();
                return(true);
            }
            return(false);
        }
Example #3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.activity_tab);

            // Make tab menu
            BottomNavigationView navigation = FindViewById <BottomNavigationView>(Resource.Id.navigation);

            navigation.SetOnNavigationItemSelectedListener(this);

            // Put connection fragment
            PrinterConnectionFragment connection = new PrinterConnectionFragment()
            {
                ViewModel = Mvx.IoCConstruct <PrinterConnectionViewModel>()
            };
            var t = SupportFragmentManager.BeginTransaction();

            t.Add(Resource.Id.fragment_view, connection);
            t.Commit();

            ImageButton connectionIcon = FindViewById <ImageButton>(Resource.Id.connection_icon);

            connectionIcon.Click += ConnectionIcon_Click;
        }