public MainModuleView(IServiceRunningIndicator model, IModuleManager ModuleManager, IRegionManager RegionManager)
        {
            this.ModuleManager = ModuleManager;
            this.RegionManager = RegionManager;
            InitializeComponent();
            DataContext = model;

            this.ModuleManager.LoadModuleCompleted +=
                (s, e) =>
            {
                // todo: 01 - Navigation on when modules are loaded.
                // When using region navigation, be sure to use it consistently
                // to ensure you get proper journal behavior.  If we mixed
                // usage of adding views directly to regions, such as through
                // RegionManager.AddToRegion, and then use RegionManager.RequestNavigate,
                // we may not be able to navigate back correctly.
                //
                // Here, we wait until the module we want to start with is
                // loaded and then navigate to the view we want to display
                // initially.
                //
                Log.DebugFormat("LoadModuleCompleted {0}", e.ModuleInfo.ModuleName);
                if (e.ModuleInfo.ModuleName == LoginModuleName)
                {
                    this.RegionManager.RequestNavigate(RegionNames.MainContentRegion, LoginViewUri, (r) =>
                    {
                        if (false == r.Result)
                        {
                            Log.ErrorFormat("Error navigating to LoginView, URI:{0}", r.Error, r.Context.Uri);
                        }
                    });
                }
            };
        }
Esempio n. 2
0
 public ChannelFactoryInterceptor(IServiceRunningIndicator indicator)
 {
     this.indicator = indicator;
 }