Beispiel #1
0
        public async Task LoadDataAsync(MasterDetailsViewState viewState)
        {
            DialogueList.Clear();

            if (viewState == MasterDetailsViewState.Both)
            {
            }
        }
        private void RoomsMasterDetail_OnViewStateChanged(object sender, MasterDetailsViewState e)
        {
            var grid = RoomsMasterDetail.FindDescendantByName("MasterPanel") as Grid;

            if (grid != null)
            {
                grid.Visibility = e == MasterDetailsViewState.Details ? Visibility.Collapsed : Visibility.Visible;
            }
        }
Beispiel #3
0
 /// <summary>
 /// Sets whether the selected item should change when focused with the keyboard based on the view state
 /// </summary>
 /// <param name="viewState">the view state</param>
 private void SetListSelectionWithKeyboardFocusOnVisualStateChanged(MasterDetailsViewState viewState)
 {
     if (viewState == MasterDetailsViewState.Both)
     {
         SetListSelectionWithKeyboardFocus(true);
     }
     else
     {
         SetListSelectionWithKeyboardFocus(false);
     }
 }
Beispiel #4
0
 /// <summary>
 /// Sets focus to the relevant control based on the viewState.
 /// </summary>
 /// <param name="viewState">the view state</param>
 private void SetFocus(MasterDetailsViewState viewState)
 {
     if (viewState != MasterDetailsViewState.Details)
     {
         FocusItemList();
     }
     else
     {
         FocusFirstFocusableElementInDetails();
     }
 }
        public async Task LoadDataAsync(MasterDetailsViewState viewState)
        {
            Source.Clear();

            var items = await eventService.GetEventsOfOwner();

            items.ForEach(item => { Source.Add(item); });

            if (viewState == MasterDetailsViewState.Both)
            {
                Selected = Source.FirstOrDefault();
            }
        }
        /// <summary>
        /// Loads the family members of the selected employee Async.
        /// </summary>
        public async Task LoadDataAsync(MasterDetailsViewState viewState)
        {
            Family.Clear();
            var data = await App.Repository.Family.GetEmployeeFamilyAsync(App.SelectedEmployee.IdEmpleado);

            foreach (var item in data)
            {
                Family.Add(new FamiliarViewModel(item));
            }
            if (viewState == MasterDetailsViewState.Both)
            {
                Selected = Family.FirstOrDefault();
            }
        }
        public async Task LoadDataAsync(MasterDetailsViewState viewState)
        {
            Source.Clear();

            var items = await promotionService.GetPromosOfOwner();

            System.Diagnostics.Debug.WriteLine(items.Count());
            items.ForEach(item => { Source.Add(item); });

            if (viewState == MasterDetailsViewState.Both)
            {
                Selected = Source.FirstOrDefault();
            }
        }
        /// <summary>
        /// Loads async all houses from the API and updates the stored houses
        /// </summary>
        public async Task LoadDataAsync(MasterDetailsViewState viewState)
        {
            SampleItems.Clear();
            var houses = await GameOfThronesDataService.GetAllHousesAsync();

            SubstitueEmptyAttributes(houses);

            if (viewState == MasterDetailsViewState.Both)
            {
                if (SampleItems != null)
                {
                    Selected = SampleItems.First();
                }
            }
        }
Beispiel #9
0
        private void showBackgroundForViewState(MasterDetailsViewState state)
        {
            switch (state)
            {
            case MasterDetailsViewState.Both:
                backgroundImage_img.Visibility = Visibility.Collapsed;
                main_grid.Background           = new SolidColorBrush(Colors.Transparent);
                break;

            default:
                backgroundImage_img.Visibility = Visibility.Visible;
                main_grid.Background           = (SolidColorBrush)Application.Current.Resources["ApplicationPageBackgroundThemeBrush"];
                break;
            }
        }
        /// <summary>
        /// Asynchroniczne zadanie wczytujące wszystkich odbiorców do kolekcji
        /// </summary>
        /// <param name="viewState"></param>
        /// <returns></returns>
        public async Task LoadDataAsync(MasterDetailsViewState viewState)
        {
            Recipients.Clear();
            var data = await DataService.GetAllFromDatabaseAsync().ConfigureAwait(false);

            foreach (var item in data)
            {
                Recipients.Add((Recipient)item);
            }

            if (viewState == MasterDetailsViewState.Both)
            {
                Selected = Recipients.First();
            }
        }
        public async Task LoadDataAsync(MasterDetailsViewState viewState)
        {
            EmployeesSample.Clear();


            foreach (var emp in Instance.GetEmployeeList())
            {
                EmployeesSample.Add(emp);
            }

            if (viewState == MasterDetailsViewState.Both)
            {
                Selected = EmployeesSample.First();
            }
        }
        public async Task LoadDataAsync(MasterDetailsViewState viewState)
        {
            //TagTypes.Clear();

            //var data = await SampleDataService.GetSampleModelDataAsync();

            //foreach (var item in data)
            //{
            //    TagTypes.Add(item);
            //}

            //if (viewState == MasterDetailsViewState.Both)
            //{
            //    Selected = TagTypes.First();
            //}
        }
Beispiel #13
0
        public async Task LoadDataAsync(MasterDetailsViewState viewState)
        {
            SampleItems.Clear();

            var data = await SampleDataService.GetAllOrdersAsync();

            foreach (var item in data)
            {
                SampleItems.Add(new SampleOrderWithSymbol(item));
            }

            if (viewState == MasterDetailsViewState.Both)
            {
                Selected = SampleItems.First();
            }
        }
Beispiel #14
0
        public async Task LoadDataAsync(MasterDetailsViewState viewState)
        {
            CarsInGarage.Clear();

            var data = await CarsInGarageDataService.GetCarsInGarageAsync();

            foreach (var car in data)
            {
                CarsInGarage.Add(car);
            }

            if (viewState == MasterDetailsViewState.Both && Selected != null)
            {
                Selected = CarsInGarage.First();
            }
        }
        public async Task LoadDataAsync(MasterDetailsViewState viewState)
        {
            VideoGames.Clear();

            var data = await videoGameDataAccess.GetVideoGamesAsync();

            foreach (var item in data)
            {
                VideoGames.Add(item);
            }

            if (viewState == MasterDetailsViewState.Both)
            {
                Selected = VideoGames.First();
            }
        }
Beispiel #16
0
        public async Task LoadDataAsync(MasterDetailsViewState viewState)
        {
            RaceTypeItems.Clear();

            var data = await SelectRaceTypeService.GetRaceTypesDataAsync();

            foreach (var item in data)
            {
                this.RaceTypeItems.Add(item);
            }

            if (viewState == MasterDetailsViewState.Both)
            {
                Selected = RaceTypeItems.First();
            }
        }
Beispiel #17
0
        public async Task LoadDataAsync(MasterDetailsViewState viewState)
        {
            SampleItems.Clear();

            var data = await SampleDataService.GetSampleModelDataAsync();

            foreach (var item in data)
            {
                SampleItems.Add(item);
            }

            if (viewState == MasterDetailsViewState.Both)
            {
                Selected = SampleItems.First();
            }
        }
        public async Task LoadDataAsync(MasterDetailsViewState viewState)
        {
            SampleItems.Clear();
            //This is where the subset of data is loaded
            SceneList data = await api.SceneListGetAsync();


            foreach (var item in data)
            {
                SampleItems.Add(item);
            }

            if (viewState == MasterDetailsViewState.Both)
            {
                Selected = SampleItems.First();
            }
        }
Beispiel #19
0
        public async Task LoadDataAsync(MasterDetailsViewState viewState)
        {
            LevelItems.Clear();

            // var data = await SampleDataService.GetMasterDetailDataAsync(); TODO: Replace with real data.

            for (int i = 1; i < 61; i += 10)
            {
                LevelItems.Add($"Level {i} - {i + 9}");
            }

            SelectedItem = LevelItems.First();

            if (viewState == MasterDetailsViewState.Both)
            {
                selectedIndex = 0;
            }
        }
        private async Task <IEnumerable <SampleOrder> > GetDataAsync(MasterDetailsViewState viewState)
        {
            var accessToken = await IdentityService.GetAccessTokenForWebApiAsync();

            var data = await _httpDataService.GetAsync <IEnumerable <SampleOrder> >("orders", accessToken);

            foreach (var item in data)
            {
                SampleItems.Add(item);
            }

            if (viewState == MasterDetailsViewState.Both)
            {
                Selected = SampleItems.First();
            }

            return(data);
        }
Beispiel #21
0
        public async Task LoadDataAsync(MasterDetailsViewState viewState)
        {
            Residences.Clear();

            var helper = await DataService.GetResidencesAsync();

            var data = helper.OrderBy(x => x.Name).ToList();

            foreach (var item in data)
            {
                Residences.Add(item);
            }

            if (viewState == MasterDetailsViewState.Both)
            {
                Selected = Residences.First();
            }
        }
        /// <summary>
        /// Loads async the books given the list from the API with limit
        /// and updates the stored books
        /// </summary>
        /// <param name="urls">list of URL of books</param>
        public async Task LoadDataAsyncWithURLs(MasterDetailsViewState viewState, string[] urls = null)
        {
            if (urls != null)
            {
                var books = await GameOfThronesDataService.GetBookByUrlAsync(urls, limit);

                SampleItems.Clear();
                SubstitueEmptyAttributes(books);
            }

            if (viewState == MasterDetailsViewState.Both)
            {
                if (SampleItems != null)
                {
                    Selected = SampleItems.First();
                }
            }
        }
Beispiel #23
0
        private void UpdateViewState()
        {
            MasterDetailsViewState previousState = ViewState;

            if (ActualWidth < CompactModeThresholdWidth)
            {
                ViewState = SelectedItem == null ? MasterDetailsViewState.Master : MasterDetailsViewState.Details;
            }
            else
            {
                ViewState = MasterDetailsViewState.Both;
            }

            if (previousState != ViewState)
            {
                ViewStateChanged?.Invoke(this, ViewState);
                SetBackButtonVisibility(previousState);
            }
        }
        public async Task LoadDataAsync(MasterDetailsViewState viewState)
        {
            if (this.session != null)
            {
                this.Results.Clear();

                var data = this.session.DriverResults.Values.ToList().OrderBy(d => d.Position);

                foreach (var item in data)
                {
                    this.Results.Add(item);
                }

                if (viewState == MasterDetailsViewState.Both)
                {
                    Selected = Results.First();
                }
            }
        }
Beispiel #25
0
        public async Task LoadDataAsync(MasterDetailsViewState viewState)
        {
            //SampleItems.Clear();
            CoinItems.Clear();

            //var data = await SampleDataService.GetSampleModelDataAsync();
            var data = await CoinMarketCapService.GetTicker();

            foreach (var item in data)
            {
                //SampleItems.Add(item);
                CoinItems.Add(item);
            }

            if (viewState == MasterDetailsViewState.Both)
            {
                //Selected = SampleItems.First();
                Selected = CoinItems.First();
            }
        }
Beispiel #26
0
        /// <summary>
        /// Sets the back button visibility based on the current visual state and selected item
        /// </summary>
        private void SetBackButtonVisibility(MasterDetailsViewState previousState)
        {
            if (DesignMode.DesignModeEnabled)
            {
                return;
            }

            if (ViewState == MasterDetailsViewState.Details)
            {
                var navigationManager = SystemNavigationManager.GetForCurrentView();
                _previousBackButtonVisibility = navigationManager.AppViewBackButtonVisibility;

                navigationManager.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
            }
            else if (previousState == MasterDetailsViewState.Details)
            {
                // Make sure we show the back button if the stack can navigate back
                SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = _previousBackButtonVisibility;
            }
        }
        public async Task LoadDataAsync(MasterDetailsViewState viewState)
        {
            Status.ShowPanel       = true;
            Status.ShowProgressBar = true;

            SampleItems.Clear();

            try
            {
                Status.Message = "Loading orders";
                var data = await GetDataAsync(viewState);

                Status.ShowPanel = false;
            }
            catch (Exception ex)
            {
                Status.Message = $"Error when loading orders: {ex.Message}";
            }

            Status.ShowProgressBar = false;
        }
        private void UpdateViewState()
        {
            MasterDetailsViewState previousState = ViewState;

            // Single pane:
            if (twoPaneView?.Mode == Microsoft.UI.Xaml.Controls.TwoPaneViewMode.SinglePane)
            {
                ViewState = SelectedItem is null ? MasterDetailsViewState.Master : MasterDetailsViewState.Details;
                twoPaneView.PanePriority = SelectedItem is null ? Microsoft.UI.Xaml.Controls.TwoPaneViewPriority.Pane1 : Microsoft.UI.Xaml.Controls.TwoPaneViewPriority.Pane2;
            }
            // Dual pane:
            else
            {
                ViewState = MasterDetailsViewState.Both;
            }

            if (previousState != ViewState)
            {
                ViewStateChanged?.Invoke(this, ViewState);
                SetBackButtonVisibility(previousState);
            }
        }
Beispiel #29
0
        public async Task LoadDataAsync(MasterDetailsViewState viewState)
        {
            try
            {
                Source.Clear();

                _entlist = await entService.GetEnterprisesByOwner();

                _entlist.ForEach(ent => { Source.Add(ent); });


                if (viewState == MasterDetailsViewState.Both)
                {
                    if (Source.Count > 0)
                    {
                        Selected = Source.First();
                    }
                }
            } catch (Exception)
            {
                toastService.ShowToast("Er ging iets mis", "probeer later opnieuw");
            }
        }
Beispiel #30
0
        public async Task LoadDataAsync(MasterDetailsViewState viewState)
        {
            Runners.Clear();

            var data = await DataService.GetRunnersAsync();

            foreach (var item in data)
            {
                Runners.Add(item);
                AllRunners.Add(item);
            }

            if (NewRunnerSelectedService.NewRunner)
            {
                SetNewRunner(NewRunnerSelectedService.runner);
                NewRunnerSelectedService.NewRunner = false;
            }

            else if (viewState == MasterDetailsViewState.Both)
            {
                Selected = Runners.First();
            }
        }