コード例 #1
0
        public async Task <Forecast.Domain.Entity.Forecast> Load()
        {
            try
            {
                ForecastModel forecastModel = await _repository.FetchCurrentForecast();

                ITarget target = new ForecastAdapter(forecastModel);
                return(target.GetForecast());
            }
            catch (Exception e)
            {
                throw new ServiceUnavailable(String.Format("Não foi possível capturar resultado forecast: [{0}]", e.Message));
            }
        }
コード例 #2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        { 
            // Use this to return your custom view for this Fragment
            var rootView = inflater.Inflate(Resource.Layout.MainFragment, container, false);

            _listItems = new List<ForecastInfo>();

            //SetForecastInfo();
            // init the array adapter for the list items
            _forecastAdapter = new ForecastAdapter(Activity, _listItems);
            // find the list view and set it to the forecastAdapter items
            var forecastList = (ListView) rootView.FindViewById(Resource.Id.listViewForecast);
            forecastList.Adapter = _forecastAdapter;

            forecastList.ItemClick += ListItemOnClick;
            
            return rootView;
        }