private void Button_Click(object sender, RoutedEventArgs e)
        {
            var view = _container.Resolve(typeof(ViewA));

            Prism.Regions.IRegion region = this._regionManager.Regions["ContentRegion"];
            region.Add(view);
        }
示例#2
0
        public SettingsSubViewModel(Prism.Ioc.IContainerExtension cp) : base(cp)
        {
            mahDialogCoordinator = cp.Resolve <IDialogCoordinator>();
            appState             = cp.Resolve <AppState>();

            InvokeRegenerateProfileInfos(null);

            UsingProfileInfo = appState.UsingProfile == null ? null :
                               ProfileInfos.Where(x => x.Filename == appState.UsingProfileInfo.Filename).FirstOrDefault();

            LoadAvailableLanguages();

            appState.FoundedProfileInfosChanged += (s, e) =>
            {
                InvokeRegenerateProfileInfos(() => { UsingProfileInfo = ProfileInfos[appState.UsingProfileInfoIndex]; });
            };
            appState.UsingProfileChanged += (s, e) =>
            {
                InvokeRegenerateProfileInfos(() => { UsingProfileInfo = ProfileInfos[appState.UsingProfileInfoIndex]; });
                ExecuteSetLanguageCommand(appState.UsingProfile.LanguageCode);
            };
        }
示例#3
0
        //private readonly SettingsView settingsView;
        //private readonly AboutView aboutView;
        //private readonly IRegion mainRegion;

        public MainWindow(Prism.Ioc.IContainerExtension container)
        {
            // this.DataContext = new MainWindowViewModel(container);
            this.regionManager = container.Resolve <IRegionManager>();
            this.resource      = container.Resolve <ResourceDictionary>();
            // this.preference = container.Resolve<AppState>();

            mahDialogCoordinator = DialogCoordinator.Instance;
            container.RegisterInstance(mahDialogCoordinator);

            DataContext = viewModel = new MainWindowViewModel(container);

            InitializeComponent();



            //mainRegion.Activate(mainRegion.GetView("AboutView"));
            //mainRegion.Add(aboutView);
            //mainRegion.Add(settingsView);

            // string mainRegion = "MainRegion";
            // regionManager.RegisterViewWithRegion(mainRegion, typeof(SettingsView));
            // regionManager.RegisterViewWithRegion(mainRegion, typeof(AboutView));
        }
示例#4
0
 public MenuModelPatchSubViewModel(Prism.Ioc.IContainerExtension cp) : base(cp)
 {
     mahDialogCoordinator = cp.Resolve <IDialogCoordinator>();
     appState             = cp.Resolve <AppState>();
 }