예제 #1
0
        private void Button_Clicked(object sender, EventArgs e)
        {
            var viewmodel = new ContactsViewModel();

            ListView.ItemsSource = viewmodel.EmployeeInfo;
            ListView.ScrollTo(scrollview.ScrollY);
        }
예제 #2
0
        protected override void OnAttachedTo(ContentPage bindable)
        {
            ListView  = bindable.FindByName <Syncfusion.ListView.XForms.SfListView>("listView");
            viewModel = new ContactsViewModel();
            ListView.BindingContext = viewModel;
            ListView.ItemsSource    = viewModel.contactsinfo;
            ListView.DataSource.LiveDataUpdateMode = LiveDataUpdateMode.AllowDataShaping;


            ListView.DataSource.GroupDescriptors.Add(new GroupDescriptor()
            {
                PropertyName = "DateTime",

                KeySelector = (object obj1) =>
                {
                    var item = (obj1 as Contacts);
                    var date = string.Format("{0:MM/dd/yyyy}", item.DateTime);
                    return(date);
                },
                Comparer = new CustomGroupComparer()
            });

            ListView.DataSource.SortDescriptors.Add(new SortDescriptor()
            {
                PropertyName = "Time",
                Direction    = ListSortDirection.Descending
            });

            base.OnAttachedTo(bindable);
        }
예제 #3
0
        protected override void OnAttachedTo(ContentPage bindable)
        {
            ListView = bindable.FindByName <Syncfusion.ListView.XForms.SfListView>("listView");
            Button rightSwipeButton = bindable.FindByName <Button>("RightSwipe");
            Button leftSwipeButton  = bindable.FindByName <Button>("LeftSwipe");

            rightSwipeButton.Clicked += RightSwipeButton_Clicked;;
            leftSwipeButton.Clicked  += LeftSwipeButton_Clicked;;

            viewModel = new ContactsViewModel();
            ListView.BindingContext = viewModel;
            ListView.ItemsSource    = viewModel.contactsinfo;

            base.OnAttachedTo(bindable);
        }