-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathLookupPageAndroid.xaml.cs
60 lines (52 loc) · 1.9 KB
/
LookupPageAndroid.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using PCCE.Model;
using PCCE.ViewModel;
namespace PCCE;
public partial class LookupPageAndroid : ContentPage
{
readonly LookupViewModel viewModel;
//int incomingIndex = 0;
public LookupPageAndroid(LookupViewModel vm)
{
InitializeComponent();
BindingContext = vm;
viewModel = vm;
}
private void SearchEntry_TextChanged(object sender, TextChangedEventArgs e)
{
if (string.IsNullOrEmpty(e.NewTextValue))
{
LookupCollectionView.ItemsSource = viewModel.ListedItems;
}
else
{
LookupCollectionView.ItemsSource = viewModel.ListedItems.Where(i => i.ItemID.ToString().Contains(e.NewTextValue, StringComparison.CurrentCultureIgnoreCase) ||
i.ItemIName.Contains(e.NewTextValue, StringComparison.CurrentCultureIgnoreCase) ||
i.ItemDisplayName.Contains(e.NewTextValue, StringComparison.CurrentCultureIgnoreCase));
}
}
private void LookupCollectionView_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
}
private void Incoming_TextChanged(object sender, TextChangedEventArgs e)
{
/*
if (!string.IsNullOrEmpty(e.NewTextValue))
{
for (int i = 0; i < viewModel.ListedItems.Count; i++)
{
if (e.NewTextValue == viewModel.ListedItems[i].ItemID.ToString())
{
incomingIndex = i;
break;
}
}
}
*/
}
private void ContentPage_Loaded(object sender, EventArgs e)
{
LookupCollectionView.ScrollTo(viewModel.ItemSelected, null, ScrollToPosition.Center, false);
//LookupCollectionView.SelectedItem = 0;
//viewModel.ItemSelected = null;
}
}