Esempio n. 1
0
        public HttpResponseMessage GetNavBarData()
        {
            if (loggedUserId == null)
            {
                return(Request.CreateResponse(HttpStatusCode.Unauthorized, "err niezalogoany"));
            }


            var loggedUser = _applicationUserRepository.GetLoggedUser(loggedUserId);
            var charts     = _chartRepository.GetUserCharts(loggedUserId);
            var result     = new NavBarVm(loggedUser, charts);

            return(Request.CreateResponse(HttpStatusCode.OK, result));
        }
Esempio n. 2
0
        // For design time data
        public NavBarTrayVmDt()
        {
            var timer = new DispatcherTimer(DispatcherPriority.Normal, Dispatcher.CurrentDispatcher)
            {
                Interval  = TimeSpan.FromSeconds(5),
                IsEnabled = true
            };
            var oldTimer = new DispatcherTimer(DispatcherPriority.Normal, Dispatcher.CurrentDispatcher)
            {
                Interval  = TimeSpan.FromSeconds(3),
                IsEnabled = true
            };

            timer.Tick    += TimerOnTick;
            oldTimer.Tick += OldTimerOnTick;

            _commandsCollection = new List <CommandButtonVm>
            {
                new CommandButtonVm("Root.Home",
                                    CommandsEnum.Home.ToString(), "Home Command", @"pack://application:,,,/Resources/Icons/Home_5699.png", HomeCommandMethod,
                                    HomeCommandCanExecuteMethod),
                new CommandButtonVm("Root.Folder",
                                    CommandsEnum.Folder.ToString(), "Folder Command", "pack://application:,,,/Resources/Icons/Folder_6221.png", FolderCommandMethod,
                                    FolderCommandCanExecuteMethod)
            };

            var navBar1 = new NavBarVm(_commandsCollection);

            Add(navBar1);

            var navBar2 = new NavBarVm(
                new List <IButtonVm>
            {
                new CommandButtonVm("Database.Store",
                                    "Store to DB", "Store results to DB", "pack://application:,,,/Resources/Icons/database_edit_32.png",
                                    () => { MessageBox.Show("Store Command - executed"); }, () => true),
                new ToogleButtonVm("Database.StoreActive",
                                   "Store On/Off", "Store to database during test-run is activated/deactivated", "pack://application:,,,/Resources/Icons/database_run_32.png")
            });

            Add(navBar2);

            timer.Start();
        }