protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            _apiHandler = e.Parameter as ApiHandler;
            var returnedValue = await _apiHandler.GetSensorList();

            _sensorList = returnedValue;
            FillObserevableCollection(_sensorList);
            _listbox.DataContext = _observableCollection;
        }
Ejemplo n.º 2
0
        private async void FrameworkElement_OnLoaded(object sender, RoutedEventArgs e)
        {
            int countOfChangeAble    = 0;
            int countOfNONChangeAble = 0;

            _sensorList = await _apiHandler.GetSensorList();

            foreach (var sensor in _sensorList)
            {
                if (sensor.Changeable == Changable.True)
                {
                    Thickness margin = changeAbleChart.Margin;
                    margin.Top             -= 50;
                    changeAbleChart.Margin  = margin;
                    changeAbleChart.Height += 50;

                    Thickness tbMargin = TB_Changeable.Margin;
                    tbMargin.Top        -= 50;
                    TB_Changeable.Margin = tbMargin;

                    countOfChangeAble++;
                }
                else
                {
                    Thickness margin = NotChangableChart.Margin;

                    margin.Top -= 50;
                    NotChangableChart.Margin  = margin;
                    NotChangableChart.Height += 50;

                    Thickness tbMargin = TB_NOTChangeable.Margin;
                    tbMargin.Top           -= 50;
                    TB_NOTChangeable.Margin = tbMargin;
                    countOfNONChangeAble++;
                }
            }

            TB_Changeable.Text    = countOfChangeAble.ToString();
            TB_NOTChangeable.Text = countOfNONChangeAble.ToString();
        }