We are developing an application that supports WP, Android & iOS operating systems using Xamarin framework.
Need to create two tabs Filter & Search, using filter tab will select some values from drop down, date picker and load the listing grid of search tab. But I couldn't able to find a sample application for creating tab control in MVVM CROSS (Portable Library Class).
ViewModel Class:
public class SearchWOViewModel : MvxViewModel
{
public readonly ISearchWOService _serachwo;
public SearchWOViewModel()
{
Filter = new FilterViewModel(_serachwo);
Search = new SearchViewModel(_serachwo);
}
private FilterViewModel _Filter;
public FilterViewModel Filter { get { return _Filter; } set { _Filter = value; RaisePropertyChanged(() => Filter); } }
private SearchViewModel _Search;
public SearchViewModel Search { get { return _Search; } set { _Search = value; RaisePropertyChanged(() => Search); } }
}
public class FilterViewModel : MvxViewModel
{
public FilterViewModel(ISearchWOService search)
{
_filterwo = search;
SiteDropDown();
}
private string _SiteResult;
public List<DropDownEquipment> SiteResult
{ get { return _SiteResult; } set { _SiteResult = value; } }
public void SiteDropDown()
{
String query = "UserSite";
_filterwo.FillUserSite(query, result => SiteResult = result, error => { });
}
}
public class SearchViewModel : MvxViewModel
{
//How to call the service and load the listing grid while loading the page
private readonly ISearchWOService _serachwo;
public SearchViewModel(ISearchWOService search)
{
_serachwo = search;
SearchListingWO();
}
private List<ListingWo> _results;
public List<ListingWo> Results { get { return _results; } set { _results = value; RaisePropertyChanged(() => Results); } }
public void SearchListingWO() // Want to reload this function once site dropdown changes
{
String query = "x/x/INDIA/SA/WORKORDER";
_serachwo.Listingwo(query, result => Results = result,error => { });
}
}