示例#1
0
        public virtual StoreLocatorViewModel GetEmptyStoreLocatorViewModel(GetEmptyStoreLocatorViewModelParam viewModelParam)
        {
            if (string.IsNullOrWhiteSpace(viewModelParam.BaseUrl))
            {
                throw new ArgumentException(GetMessageOfNullWhiteSpace(nameof(viewModelParam.BaseUrl)), nameof(viewModelParam));
            }
            if (viewModelParam.CultureInfo == null)
            {
                throw new ArgumentException(GetMessageOfNull(nameof(viewModelParam.CultureInfo)), nameof(viewModelParam));
            }

            var model = new StoreLocatorViewModel
            {
                Stores             = new List <StoreViewModel>(),
                StoresDirectoryUrl = StoreUrlProvider.GetStoresDirectoryUrl(new GetStoresDirectoryUrlParam
                {
                    CultureInfo = viewModelParam.CultureInfo,
                    BaseUrl     = viewModelParam.BaseUrl,
                    Page        = 1
                })
            };

            return(model);
        }
        public StoreLocatorPage()
        {
            InitializeComponent();

            BindingContext = new StoreLocatorViewModel(Navigation);
        }