Example #1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            ViewModel?.ViewCreated();

            if (_reqData != string.Empty)
            {
                var viewModelLoader = Mvx.Resolve <IMvxWindowsViewModelLoader>();
                ViewModel = viewModelLoader.Load(e.Parameter.ToString(), LoadStateBundle(e));
            }
            _reqData = (string)e.Parameter;

            this.OnViewCreate(_reqData, () => LoadStateBundle(e));
        }
Example #2
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e == null)
            {
                throw new NullReferenceException(nameof(e));
            }

            base.OnNavigatedTo(e);
            ViewModel?.ViewCreated();

            if (!string.IsNullOrEmpty(_reqData))
            {
                var viewModelLoader = Mvx.IoCProvider.Resolve <IMvxWindowsViewModelLoader>();
                ViewModel = await viewModelLoader.Load(e.Parameter.ToString(), LoadStateBundle(e)).ConfigureAwait(false);

                ViewModel?.ViewCreated();
            }
            _reqData = (string)e.Parameter;

            await this.OnViewCreate(_reqData, () => LoadStateBundle(e)).ConfigureAwait(false);
        }