예제 #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var shell = UiStarter.Start <IDockWindow>(
                new Bootstrap(),
                new UiShowStartWindowOptions
            {
                Title          = "WPF.Tools.Demo",
                DockingManager = new VsDockingManager()     // new CustomDockingManager()
            }
                );

            var tools = new[] { VsDockingManager.ToolsLeft, VsDockingManager.ToolsRight, VsDockingManager.ToolsBottom };

            foreach (var tool in tools)
            {
                shell.ShowToolIn <ToolsView>(
                    tool,
                    new ViewRequest(tool),
                    new UiShowOptions {
                    Title = tool
                }
                    );
            }
        }
예제 #2
0
파일: App.xaml.cs 프로젝트: BerndGit/Kamban
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            SetupExceptionHandling();

            var shell = UiStarter.Start <IDockWindow>(
                new Bootstrapper(),
                new UiShowStartWindowOptions
            {
                Title = "Kamban"
            });


            var container = shell.Container;

            mon = (MonikFile)container.Resolve <IMonik>();
            mon.ApplicationInfo("Bootstrapper initialized");


            shell.ShowView <StartupView>(
                viewRequest: new ViewRequest {
                ViewId = StartupViewModel.StartupViewId
            },
                options: new UiShowOptions {
                Title = "Start Page", CanClose = false
            });
        }
예제 #3
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var shell = UiStarter.Start <IDockWindow>(
                new Bootstrapper(),
                new UiShowStartWindowOptions
            {
                Title = "Kamban"
            });

            shell.DockingManager.ActiveContentChanged += (s, e) =>
            {
                var ga   = shell.Container.Resolve <IGa>();
                var view = shell.SelectedView;
                if (view == null)
                {
                    return;
                }

                if (view is StartupView)
                {
                    ga.TrackPage("startup");
                }
                else if (view is SettingsView)
                {
                    ga.TrackPage("settings");
                }
                else if (view is BoardView)
                {
                    ga.TrackPage("board");
                }
                else if (view is ExportView)
                {
                    ga.TrackPage("export");
                }
                else if (view is ImportView)
                {
                    ga.TrackPage("import");
                }
                else if (view is WizardView)
                {
                    ga.TrackPage("create");
                }
            };

            shell.ShowView <StartupView>(
                viewRequest: new ViewRequest {
                ViewId = StartupViewModel.StartupViewId
            },
                options: new UiShowOptions {
                Title = "Start Page", CanClose = false
            });
        }
예제 #4
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var shell = UiStarter.Start <IDockWindow>(
                new BootsTrap(),
                new UiShowStartWindowOptions
            {
                Title         = "ReportServer.Desktop",
                ToolPaneWidth = 100
            });

            (shell as CachedServiceShell)?.InitCachedServiceAsync(3);
        }
예제 #5
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var shell = UiStarter.Start <IDockWindow>(
                new Bootstrapper(),
                new UiShowStartWindowOptions
            {
                Title         = "Kanban.Desktop.LocalBase",
                ToolPaneWidth = 100
            });

            shell.ShowView <StartupView>(options: new UiShowOptions()
            {
                Title = "Start Page", CanClose = false
            });
        }
예제 #6
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var shell = UiStarter.Start <IDockWindow>(
                new Bootstrapper(),
                new UiShowStartWindowOptions
            {
                Title = "Kamban"
            });

            shell.ShowView <StartupView>(
                viewRequest: new ViewRequest {
                ViewId = StartupViewModel.StartupViewId
            },
                options: new UiShowOptions {
                Title = "Start Page", CanClose = false
            });
        }
예제 #7
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var dm = new DefaultDockingManager
            {
                DocumentPaneControlStyle   = FindResource("AvalonDockThemeCustomDocumentPaneControlStyle") as Style,
                AnchorablePaneControlStyle = FindResource("AvalonDockThemeCustomAnchorablePaneControlStyle") as Style,
            };

            dm.SetResourceReference(Control.BackgroundProperty, "MahApps.Brushes.White");

            var shell = UiStarter.Start <IDockWindow>(new Bootstrap(),
                                                      new UiShowStartWindowOptions
            {
                Title          = "Monik.Desktop",
                DockingManager = dm,
            });

            shell.SetContainerWidth(DefaultDockingManager.Tools, new GridLength(350));
            shell.ShowTool <StartupView>(new ViewRequest("startup"));
        }
예제 #8
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var shell = UiStarter.Start <IDockWindow>(
                new Bootstrap(),
                new UiShowStartWindowOptions
            {
                Title         = "Kanban.Desktop",
                ToolPaneWidth = 100
            });

            AuthProcess.Start(
                getAuthenticationData: () => LoginDialog.GetAutenticationDataTask(),
                authentication: async(x) =>
            {
                if (x == null)
                {
                    return(false);
                }

                var authContext = shell.Container.Resolve <IAuthenticationContext>();
                return(await authContext.LoginAsync(x.Username, x.Password));
            },
                authenticationSuccess: () =>
            {
                shell.ShowView <ISettingsView>(
                    options: new UiShowOptions
                {
                    Title = "Settings"
                });
                shell.ShowView <IKanbanBoardView>();
                shell.ShowView <IKanbanBoardView>(
                    new KanbanViewRequest
                {
                    ConfigurtaionName = "h_status_v_assigned_c_subject_treker_details"
                },
                    new KanbanShowOptions
                {
                    Title = "Kanban dynamic dimension",
                });
                shell.ShowView <IKanbanBoardView>(
                    new KanbanViewRequest
                {
                    ConfigurtaionName = "ods"
                },
                    new KanbanShowOptions
                {
                    Title = "ods",
                });

                shell.ShowView <IIssueView>(
                    new IssueViewRequest
                {
                    IssueId = 4689
                });

                shell.ShowTool <IIssuesTool>();
            },
                authenticationFail: () => Current.MainWindow.Close());
        }
예제 #9
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            var dm = new DefaultDockingManager
            {
                DocumentPaneControlStyle   = FindResource("AvalonDockThemeCustomDocumentPaneControlStyle") as Style,
                AnchorablePaneControlStyle = FindResource("AvalonDockThemeCustomAnchorablePaneControlStyle") as Style,
            };

            dm.SetResourceReference(Control.BackgroundProperty, "MahApps.Brushes.White");

            var shell = UiStarter.Start <IDockWindow>(
                new Bootstrap(),
                new UiShowStartWindowOptions
            {
                Title          = "Domain0.Desktop",
                DockingManager = dm,
            }
                );

            shell.SetContainerWidth(DefaultDockingManager.Tools, new GridLength(60));

            // log trace to monik
            var monik = shell.Container.Resolve <IMonik>();

            Trace.Listeners.Add(new MonikTraceListener(monik));
            // catch unhandled exceptions
            AppDomain.CurrentDomain.UnhandledException += (sender, args) =>
            {
                if (args.IsTerminating)
                {
                    monik.ApplicationFatal("Unhandled fatal exception: {1}", args.ExceptionObject);
                }
                else
                {
                    monik.ApplicationError("Unhandled exception: {1}", args.ExceptionObject);
                }
            };

            var config = shell.Container.Resolve <IAppConfigStorage>().Load();

            ThemeManager.ChangeTheme(this, config.AppTheme, config.AccentColor);

            shell.ShowTool <ManageToolsView>(new ViewRequest("manage-tools"), new UiShowOptions {
                Title = "Tools"
            });
            shell.ShowUsers();

            var domain0      = shell.Container.Resolve <IDomain0Service>();
            var loginService = shell.Container.Resolve <ILoginService>();

            if (config.HostUrl != null && loginService.IsLoggedIn)
            {
                shell.Container.Resolve <IAuthenticationContext>().HostUrl = config.HostUrl;
                domain0.LoadModel();
            }
            else
            {
                loginService.ShowLogin(() => domain0.LoadModel());
            }
        }