示例#1
0
        private static void FillAllItemsList()
        {
            ClearItemsList();

            foreach (var s in CounList)
            {
                var item = new ListItem {
                    AdditionalProperties = { [NAME] = s }
                };
                item.SetLabel("Name", "[Country." + s + "]");
                if (SelectedCountrys.Contains(s))
                {
                    item.Selected = true;
                }
                Countrys.Add(item);
            }
            Refresh(Countrys);

            foreach (var s in CityList)
            {
                var item = new ListItem {
                    AdditionalProperties = { [NAME] = s }
                };
                item.SetLabel("Name", s);
                if (SelectedCitys.Contains(s))
                {
                    item.Selected = true;
                }
                Citys.Add(item);
            }
            Refresh(Citys);

            foreach (var s in BitrList)
            {
                var item = new ListItem {
                    AdditionalProperties = { [NAME] = Convert.ToInt32(s) + " kbps" }
                };
                item.SetLabel("Name", Convert.ToInt32(s) + " kbps");
                if (SelectedBitrate.Contains(Convert.ToInt32(s) + " kbps"))
                {
                    item.Selected = true;
                }
                Bitrate.Add(item);
            }
            Refresh(Bitrate);

            foreach (var s in GenrList)
            {
                var item = new ListItem {
                    AdditionalProperties = { [NAME] = s }
                };
                item.SetLabel("Name", s);
                if (SelectedGenres.Contains(s))
                {
                    item.Selected = true;
                }
                Genres.Add(item);
            }
            Refresh(Genres);
        }
示例#2
0
        public ListViewSampleViewModel(INavigationService navigationService) : base(navigationService)
        {
            _countrys = new Model();

            _countrys.Add("satoru");
            _countrys.Add("naruko");

            var prop = _countrys.ObserveProperty(m => m.IsNoCountry).ToReactiveProperty();

            Console.WriteLine("1 value is {0}", prop.Value);

            _countrys.Del("satoru");
            _countrys.Del("naruko");

            Console.WriteLine("2 value is {0}", prop.Value);

            _countrys.Add("satoru");
            _countrys.Add("naruko");

            AddCommand = new ReactiveCommand <string>();
            AddCommand.Subscribe(x => Countrys.Add(x));
        }