Пример #1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.Inflate(Resource.Layout.fragment_list_view_data_operations, container, false);

            this.listView = (RadListView)rootView.FindViewById(Resource.Id.listView).JavaCast <RadListView>();
            this.btnSort  = (ToggleButton)rootView.FindViewById(Resource.Id.btnSort);
            this.btnSort.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => {
                ListViewDataSourceAdapter dsa = (ListViewDataSourceAdapter)listView.GetAdapter();

                if (e.IsChecked)
                {
                    // Sort by price
                    dsa.AddSortDescriptor(new MySortDescriptor());
                }
                else
                {
                    dsa.ClearSortDescriptors();
                }
            };

            this.btnFilter = (ToggleButton)rootView.FindViewById(Resource.Id.btnFilter);
            this.btnFilter.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => {
                ListViewDataSourceAdapter dsa = (ListViewDataSourceAdapter)listView.GetAdapter();

                if (e.IsChecked)
                {
                    dsa.AddFilterDescriptor(new MyFilterDescriptor());
                }
                else
                {
                    dsa.ClearFilterDescriptors();
                }
            };

            this.btnGroup = (ToggleButton)rootView.FindViewById(Resource.Id.btnGroup);
            this.btnGroup.CheckedChange += (object sender, CompoundButton.CheckedChangeEventArgs e) => {
                ListViewDataSourceAdapter dsa = (ListViewDataSourceAdapter)listView.GetAdapter();
                if (e.IsChecked)
                {
                    dsa.AddGroupDescriptor(new MyGroupDescriptor());
                }
                else
                {
                    dsa.ClearGroupDescriptors();
                }
            };

            this.listView.SetAdapter(new MyDataListViewAdapter(this.getData()));

            return(rootView);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View rootView = inflater.Inflate(Resource.Layout.fragment_list_view_collapsible, container, false);
            this.listView = (RadListView)rootView.FindViewById(Resource.Id.listView).JavaCast<RadListView>();

            CollapsibleGroupsBehavior collapsibleGroupsBehavior = new CollapsibleGroupsBehavior ();
            this.listView.AddBehavior (collapsibleGroupsBehavior);

            ListViewDataSourceAdapter dataListViewAdapter = new ListViewDataSourceAdapter (GetData ());
            dataListViewAdapter.AddGroupDescriptor (new MyGroupDescriptor ());
            this.listView.SetAdapter (dataListViewAdapter);

            return rootView;
        }
Пример #3
0
		public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			View rootView = inflater.Inflate(Resource.Layout.fragment_list_view_collapsible, container, false);
			this.listView = (RadListView)rootView.FindViewById(Resource.Id.listView).JavaCast<RadListView>();

			CollapsibleGroupsBehavior collapsibleGroupsBehavior = new CollapsibleGroupsBehavior ();
			this.listView.AddBehavior (collapsibleGroupsBehavior);

			ListViewDataSourceAdapter dataListViewAdapter = new ListViewDataSourceAdapter (GetData ());
			dataListViewAdapter.AddGroupDescriptor (new MyGroupDescriptor ());
			this.listView.SetAdapter (dataListViewAdapter);

			return rootView;
		}