Quantcast
Channel: patterns & practices: Prism
Viewing all articles
Browse latest Browse all 1878

New Post: Notification not triggered when navigating to view ...

$
0
0
Dear Federico,

Appreciate your reply, I got this resolved thanks, I belive I have aproblem with the navigation right now.

I am loading a view using RequestNavigation as follows:
RegionManager.RequestNavigate(RegionNames.TDetailsRegion, new Uri(builder.ToString(), UriKind.Relative));
and I am removing the views from it's viewmodel as follows when back button is pressed as follows:
private void GoBack()
        {
            if (CanClose)
            {
                foreach (var region in RegionManager.Regions)
                {
                    foreach (var view in region.Views)
                    {
                        if (view is TDetailsView)
                        {
                            if (((TDetailsView)view).DataContext == this)
                            {
                                region.Deactivate(view);
                                region.Context = null;
                                // region.Remove(view);
                                // ((TaxpayerDetailsView) view).DataContext = null;
                            }
                        }
                    }
                }
            }
        }
the problem is when I try to navigate again to that view using the code above, I got the view loaded but not it's viewmodel.
What could be the problem.

I try to use implement the in the viewmodel and use the deactivate instead, and I got an error says "Deactivated is not allowed in this type of view"

If you could help on that issue will be great.

Thanks again & best regards

Viewing all articles
Browse latest Browse all 1878

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>