public void OnLoaded(object sender, RoutedEventArgs e)
 {
     RegionManager.AddToRegion("StatusBarRegion", ContainerExtension.Resolve <StatusBarView>());
     RegionManager.AddToRegion("FileListRegion", ContainerExtension.Resolve <FileListView>());
     RegionManager.AddToRegion("ToolTabRegion", ContainerExtension.Resolve <ToolTabView>());
     RegionManager.AddToRegion("SettingsTabRegion", ContainerExtension.Resolve <SettingsTabView>());
     RegionManager.AddToRegion("OthersTabRegion", ContainerExtension.Resolve <OthersTabView>());
 }
Exemple #2
0
        private void ShowDialogInternal(string name, IDialogParameters parameters, Action <IDialogResult> callback)
        {
            var content = ContainerExtension.Resolve <object>(name);

            var dialogContent = content as FrameworkElement ?? throw new NullReferenceException("A dialog's content must be a FrameworkElement");
            var viewModel     = dialogContent.DataContext as IDialogAware ?? throw new NullReferenceException("A dialog's ViewModel must be IDialogAware");

            MvvmHelpers.ViewAndViewModelAction <IDialogAware>(viewModel, d => d.OnDialogOpened(parameters));

            var host = CustomHost.Host
                       ?? throw new NullReferenceException("Dialog host must be specified in the ICustomDialogHost");

            // Lazy show
            host.IsOpen        = true;
            host.DialogContent = dialogContent;

            viewModel.RequestClose += r =>
            {
                host.IsOpen = false;
                callback?.Invoke(r);
                host.DialogContent = null;
            };
        }
Exemple #3
0
 public void OnLoaded(object sender, RoutedEventArgs e)
 {
     RegionManager.AddToRegion("MainRegion", ContainerExtension.Resolve <MainView>());
 }
Exemple #4
0
 public void OnLoaded(object sender, RoutedEventArgs e)
 {
     RegionManager.AddToRegion("OperandRegion", ContainerExtension.Resolve <OperandView>());
     RegionManager.AddToRegion("AnswerRegion", ContainerExtension.Resolve <AnswerView>());
 }
Exemple #5
0
        public void OnLoaded(object sender, RoutedEventArgs e)
        {
            RegionManager.AddToRegion("MainRegion", ContainerExtension.Resolve <MonsterEncountView>());

            RegionManager.RequestNavigate("MainRegion", nameof(MonsterEncountView));
        }