yan cus

yan cus

  • NA
  • 124
  • 2.5k

Fetch items and use filters in listview Xamarin.Forms

Jan 28 2021 12:27 PM
https://docs.microsoft.com/en-us/samples/xamarin/xamarin-forms-samples/getstarted-notes-database/
I have 2 questions, assuming Notes is already filled with data:
  1. <ContentPage ..    
  2. <StackLayout>    
  3. <Button Text="DateFirstFromListViewItem" Clicked="OnClickFilterListViewBetwenBtn1TextAndBtn2" x:Name="Button1"/>    
  4. <Button Text="DateLaststFromListViewItem" Clicked="OnClickFilterListViewBetwenBtn2TextAndBtn1" x:Name="Button2"/>    
  5. <ListView x:Name="listView"    
  6. ItemSelected="OnListViewItemSelected">    
  7. <ListView.ItemTemplate>    
  8. <DataTemplate>    
  9. <TextCell Text="{Binding Text}"    
  10. TextColor="Black"    
  11. Detail="{Binding Date}" /> <!-- THIS DATE -->    
  12. </DataTemplate>    
  13. ...    
  14. </StackLayout>    
  15. </ContentPage>
1. How do we send Date from the first ListView item to Button1 and the last Date to Button2.
 
2. When button1 or button2 is clicked, listView will automatically adjust between button1 and button2 date.
 
Hopefully this can be resolved. Thank you.
Then on NotesPage.Xaml, I added 2 buttons above the

Answers (2)