private void OnStatePickerMessage(StatePickerMessage msg)
        {
            var stateView = msg.Sender as StatePickerViewModel;

            // Only handle state picker msg if we were expecting it
            if (stateView != null && ViewInstanceId.Equals(stateView.RequestedByViewInstanceId))
            {
                StateFilter = msg.State;
            }
        }
        private void OnPropertyPickeryMessage(PropertyPickerMessage msg)
        {
            var pickerView = msg.Sender as PropertyPickerViewModel;

            // Only handle city picker msg if we were expecting it.
            if (pickerView != null && ViewInstanceId.Equals(pickerView.RequestedByViewInstanceId))
            {
                Properties = msg.Properties;
            }
        }
        private void OnCityPickerMessage(CityPickerMessage msg)
        {
            var cityView = msg.Sender as CityPickerViewModel;

            // Only handle city picker msg if we were expecting it.
            if (cityView != null && ViewInstanceId.Equals(cityView.RequestedByViewInstanceId))
            {
                CityFilter = msg.City;
            }
        }
Example #4
0
        /*
         * public void Init(Guid requestedViewId)
         * {
         *      if (requestedViewId != null)
         *      {
         *              RequestedByViewInstanceId = requestedViewId;
         *      }
         * }
         */


        public bool ShowViewModel <TViewModel>() where TViewModel : IMvxViewModel
        {
            var requestedBy = new MvxRequestedBy();

            //
            // The Current (Parent) view model that is requesting to show a *NEW* view will have the Guid assigned into the
            // requestedBy additional info column.
            //
            // The Presenter will pass this new view to the parent that has matching Guid, so Parent can show this view.
            //
            requestedBy.AdditionalInfo = ViewInstanceId.ToString();
            return(ShowViewModel(
                       typeof(TViewModel),
                       //null,
                       //null,
                       requestedBy: requestedBy));
        }