示例#1
0
        public SessionViewModel(HomeViewModel viewModel)
        {
            HomeViewModel = viewModel;

            ListSessionIsVisible          = true;
            TimeParamSessionSwitchState   = false;
            LocParamSessionSwitchState    = false;
            LocTrackingSessionSwitchState = true;
            CurrentSession = new Session();

            SaveSessionCommand    = new SaveSessionCommand(this);
            RefreshSessionCommand = new RefreshSessionCommand(this);
            DeleteSessionCommand  = new DeleteSessionCommand(this);

            List <String> lst = new List <String>()
            {
                "sessions",
                "stat",
            };

            this.RibbonOptions = lst;

            List <StackLayout> SessionOpt = new List <StackLayout>
            {
                new ListSessionBodyView(this),
                new StatSessionBodyView(this)
            };

            this.SessionViewOptions = SessionOpt;

            this.OptionSelectionChangedCommand = new Command((obj) => {
                var selectedItemRibbonIndex = obj.ToString();


                HomeViewModel.IsToolbarMenuOpened = false;

                ListSessionIsVisible = false;
                AddSessionIsVisible  = false;
                StatSessionIsVisible = false;

                if (selectedItemRibbonIndex == "0")
                {
                    ListSessionIsVisible = true;
                }

                else if (selectedItemRibbonIndex == "1")
                {
                    StatSessionIsVisible = true;
                }
                else
                {
                    AddSessionIsVisible = true;
                }
            });
        }
 public async Task <ActionResult <AuthenticationResponse> > RefreshSession([FromBody] RefreshSessionCommand request)
 {
     return(await Mediator.Send(request));
 }