Tig Kindel 1 год назад
Родитель
Сommit
6930043911
100 измененных файлов с 1729 добавлено и 987 удалено
  1. 30 39
      .github/workflows/api-docs.yml
  2. 3 3
      .github/workflows/codeql-analysis.yml
  3. 81 0
      .github/workflows/codeql.yml
  4. 1 1
      .github/workflows/dotnet-core.yml
  5. 1 1
      .github/workflows/publish.yml
  6. 1 3
      .gitignore
  7. 2 1
      README.md
  8. 3 3
      ReactiveExample/ReactiveExample.csproj
  9. 72 8
      Terminal.Gui/ConsoleDrivers/CursesDriver/CursesDriver.cs
  10. 44 12
      Terminal.Gui/ConsoleDrivers/CursesDriver/binding.cs
  11. 1 0
      Terminal.Gui/ConsoleDrivers/CursesDriver/constants.cs
  12. 39 15
      Terminal.Gui/Core/Application.cs
  13. 5 1
      Terminal.Gui/Core/Border.cs
  14. 36 5
      Terminal.Gui/Core/Toplevel.cs
  15. 6 3
      Terminal.Gui/Core/View.cs
  16. 5 2
      Terminal.Gui/Core/Window.cs
  17. 6 4
      Terminal.Gui/Terminal.Gui.csproj
  18. BIN
      Terminal.Gui/Terminal.Gui.snk
  19. 5 1
      Terminal.Gui/Views/Button.cs
  20. 0 9
      Terminal.Gui/Views/ContextMenu.cs
  21. 5 2
      Terminal.Gui/Views/FrameView.cs
  22. 5 3
      Terminal.Gui/Views/ListView.cs
  23. 25 0
      Terminal.Gui/Views/Menu.cs
  24. 7 6
      Terminal.Gui/Views/ScrollBarView.cs
  25. 34 11
      Terminal.Gui/Views/ScrollView.cs
  26. 18 8
      Terminal.Gui/Views/StatusBar.cs
  27. 6 3
      Terminal.Gui/Views/TextView.cs
  28. 5 1
      Terminal.Gui/Windows/Wizard.cs
  29. 2 1
      Terminal.sln
  30. 2 1
      UICatalog/Scenarios/Editor.cs
  31. 101 0
      UICatalog/Scenarios/MainLoopTimeouts.cs
  32. 1 1
      UICatalog/Scenarios/SingleBackgroundWorker.cs
  33. 30 30
      UICatalog/UICatalog.csproj
  34. 63 6
      UnitTests/Application/ApplicationTests.cs
  35. 46 8
      UnitTests/Application/RunStateTests.cs
  36. 4 2
      UnitTests/Menus/ContextMenuTests.cs
  37. 15 0
      UnitTests/Menus/MenuTests.cs
  38. 43 0
      UnitTests/TopLevels/MdiTests.cs
  39. 45 0
      UnitTests/TopLevels/WindowTests.cs
  40. 6 4
      UnitTests/UnitTests.csproj
  41. BIN
      UnitTests/UnitTests.snk
  42. 23 6
      UnitTests/Views/ButtonTests.cs
  43. 32 0
      UnitTests/Views/ListViewTests.cs
  44. 23 0
      UnitTests/Views/ScrollViewTests.cs
  45. 19 0
      UnitTests/Views/StatusBarTests.cs
  46. 31 0
      UnitTests/Views/TextViewTests.cs
  47. 51 13
      UnitTests/Views/ViewDisposalTest.cs
  48. 18 0
      UnitTests/Views/ViewTests.cs
  49. 2 2
      docfx/README.md
  50. 0 31
      docfx/articles/views.md
  51. 15 5
      docfx/build.ps1
  52. 29 54
      docfx/docfx.json
  53. 2 0
      docfx/docs/drivers.md
  54. 2 0
      docfx/docs/index.md
  55. 2 0
      docfx/docs/keyboard.md
  56. 4 2
      docfx/docs/mainloop.md
  57. 18 16
      docfx/docs/overview.md
  58. 3 1
      docfx/docs/tableview.md
  59. 20 0
      docfx/docs/toc.yml
  60. 3 1
      docfx/docs/treeview.md
  61. 33 0
      docfx/docs/views.md
  62. 11 9
      docfx/index.md
  63. 0 121
      docfx/templates/default/partials/class.header.tmpl.partial
  64. 0 224
      docfx/templates/default/partials/class.tmpl.partial
  65. 0 304
      docfx/templates/default/styles/main.css
  66. 6 0
      docfx/templates/modern/ApiPage.html.primary.js
  67. 4 0
      docfx/templates/modern/ApiPage.html.primary.tmpl
  68. 148 0
      docfx/templates/modern/layout/_master.tmpl
  69. 158 0
      docfx/templates/modern/partials/class.header.tmpl.partial
  70. 31 0
      docfx/templates/modern/partials/class.memberpage.tmpl.partial
  71. 147 0
      docfx/templates/modern/partials/class.tmpl.partial
  72. 3 0
      docfx/templates/modern/partials/collection.tmpl.partial
  73. 10 0
      docfx/templates/modern/partials/customMREFContent.tmpl.partial
  74. 19 0
      docfx/templates/modern/partials/enum.tmpl.partial
  75. 3 0
      docfx/templates/modern/partials/item.tmpl.partial
  76. 16 0
      docfx/templates/modern/partials/namespace.tmpl.partial
  77. BIN
      docfx/templates/modern/public/bootstrap-icons-BNVXHMH5.woff
  78. BIN
      docfx/templates/modern/public/bootstrap-icons-UDRIHJCM.woff2
  79. 0 0
      docfx/templates/modern/public/c4Diagram-817c8e44-SGFOBFRD.min.js
  80. 3 0
      docfx/templates/modern/public/c4Diagram-817c8e44-SGFOBFRD.min.js.map
  81. 0 0
      docfx/templates/modern/public/chunk-334IV3XH.min.js
  82. 3 0
      docfx/templates/modern/public/chunk-334IV3XH.min.js.map
  83. 0 0
      docfx/templates/modern/public/chunk-3RELVOUY.min.js
  84. 3 0
      docfx/templates/modern/public/chunk-3RELVOUY.min.js.map
  85. 0 0
      docfx/templates/modern/public/chunk-CK25GZVZ.min.js
  86. 3 0
      docfx/templates/modern/public/chunk-CK25GZVZ.min.js.map
  87. 0 0
      docfx/templates/modern/public/chunk-CXT7N4L6.min.js
  88. 3 0
      docfx/templates/modern/public/chunk-CXT7N4L6.min.js.map
  89. 0 0
      docfx/templates/modern/public/chunk-DALFUHAB.min.js
  90. 2 0
      docfx/templates/modern/public/chunk-DALFUHAB.min.js.map
  91. 0 0
      docfx/templates/modern/public/chunk-EKFGDCJ4.min.js
  92. 2 0
      docfx/templates/modern/public/chunk-EKFGDCJ4.min.js.map
  93. 2 0
      docfx/templates/modern/public/chunk-F7JJDB3C.min.js
  94. 3 0
      docfx/templates/modern/public/chunk-F7JJDB3C.min.js.map
  95. 0 0
      docfx/templates/modern/public/chunk-I64Z623A.min.js
  96. 3 0
      docfx/templates/modern/public/chunk-I64Z623A.min.js.map
  97. 2 0
      docfx/templates/modern/public/chunk-P42HNYSU.min.js
  98. 7 0
      docfx/templates/modern/public/chunk-P42HNYSU.min.js.map
  99. 0 0
      docfx/templates/modern/public/chunk-U66T5BMR.min.js
  100. 3 0
      docfx/templates/modern/public/chunk-U66T5BMR.min.js.map

+ 30 - 39
.github/workflows/api-docs.yml

@@ -2,53 +2,44 @@ name: Build and publish API docs
 
 
 on:
 on:
   push:
   push:
-    branches: [main]
+  # only publish v2 (main or develop); v2 is published via the Terminal.GuiV2Docs repo
+    branches: [main, develop]
+
+permissions:
+  id-token: write 
+  pages: write
 
 
 jobs:
 jobs:
-  generate-docs:
+  # Single deploy job since we're just deploying
+  deploy:
+    name: Build and Deploy API docs to github-pages
+    environment:
+      name: github-pages
+      url: ${{ steps.deployment.outputs.page_url }}
     runs-on: windows-latest
     runs-on: windows-latest
-
     steps:
     steps:
     - name: Checkout
     - name: Checkout
       uses: actions/checkout@v4
       uses: actions/checkout@v4
 
 
-    - name: Setup .NET Core
-      uses: actions/[email protected]
-      with:
-        dotnet-version: 6.0.100
-    
-    - name: Setup DocFX
-      uses: crazy-max/ghaction-chocolatey@v2
-      with:
-        args: install docfx    
-
-    - name: Install dependencies
-      run: dotnet restore        
-
     - name: DocFX Build
     - name: DocFX Build
       working-directory: docfx
       working-directory: docfx
-      # https://stackoverflow.com/questions/56726429/how-to-run-multiple-commands-in-one-github-actions-docker
       run: |
       run: |
-        rm ../docs -Recurse -Force -ErrorAction SilentlyContinue
-        docfx docfx.json
-      continue-on-error: false      
-
-    - name: Publish
-      if: github.event_name == 'push'
-      uses: peaceiris/actions-gh-pages@v3
+        dotnet tool install -g docfx
+        $env:DOCFX_SOURCE_BRANCH_NAME="${{ github.ref_name }}"
+        docfx metadata
+        docfx build
+      continue-on-error: false
+
+    - name: Setup Pages
+      uses: actions/configure-pages@v4
+      
+    - name: Upload artifact
+      uses: actions/upload-pages-artifact@v2
       with:
       with:
-        github_token: ${{ secrets.GITHUB_TOKEN }}
-        publish_dir: docs
-        force_orphan: true
-
-    # - name: Use docfx to build API Docs
-    #   uses: nikeee/[email protected]
-    #   with:
-    #     args: docfx/docfx.json
-
-    # # Publish generated site using GitHub Pages
-    # - uses: maxheld83/ghpages@master
-    #   name: Publish API Documentation on GitHub Pages
-    #   env:
-    #     BUILD_DIR: docs # docfx's default output directory is _site
-    #     GH_PAT: ${{ secrets.GH_PAT }} # See https://github.com/maxheld83/ghpages
+        path: docfx/_site
+       
+    - name: Deploy to GitHub Pages
+      id: deployment
+      uses: actions/deploy-pages@v3
+      with:
+        token: ${{ secrets.GITHUB_TOKEN }}

+ 3 - 3
.github/workflows/codeql-analysis.yml

@@ -43,7 +43,7 @@ jobs:
       
       
     # Initializes the CodeQL tools for scanning.
     # Initializes the CodeQL tools for scanning.
     - name: Initialize CodeQL
     - name: Initialize CodeQL
-      uses: github/codeql-action/init@v2
+      uses: github/codeql-action/init@v3
       # Override language selection by uncommenting this and choosing your languages
       # Override language selection by uncommenting this and choosing your languages
       with:
       with:
         languages: csharp
         languages: csharp
@@ -51,7 +51,7 @@ jobs:
     # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).
     # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).
     # If this step fails, then you should remove it and run the build manually (see below)
     # If this step fails, then you should remove it and run the build manually (see below)
     - name: Autobuild
     - name: Autobuild
-      uses: github/codeql-action/autobuild@v2
+      uses: github/codeql-action/autobuild@v3
 
 
     # ℹ️ Command-line programs to run using the OS shell.
     # ℹ️ Command-line programs to run using the OS shell.
     # 📚 https://git.io/JvXDl
     # 📚 https://git.io/JvXDl
@@ -65,4 +65,4 @@ jobs:
     #   make release
     #   make release
 
 
     - name: Perform CodeQL Analysis
     - name: Perform CodeQL Analysis
-      uses: github/codeql-action/analyze@v2
+      uses: github/codeql-action/analyze@v3

+ 81 - 0
.github/workflows/codeql.yml

@@ -0,0 +1,81 @@
+# For most projects, this workflow file will not need changing; you simply need
+# to commit it to your repository.
+#
+# You may wish to alter this file to override the set of languages analyzed,
+# or to provide custom queries or build logic.
+#
+# ******** NOTE ********
+# We have attempted to detect the languages in your repository. Please check
+# the `language` matrix defined below to confirm you have the correct set of
+# supported CodeQL languages.
+#
+name: "CodeQL"
+
+on:
+  push:
+    branches: [ "develop", "main", "v2", "v2_develop" ]
+  pull_request:
+    branches: [ "develop", "main", "v2", "v2_develop" ]
+  schedule:
+    - cron: '35 4 * * 2'
+
+jobs:
+  analyze:
+    name: Analyze
+    # Runner size impacts CodeQL analysis time. To learn more, please see:
+    #   - https://gh.io/recommended-hardware-resources-for-running-codeql
+    #   - https://gh.io/supported-runners-and-hardware-resources
+    #   - https://gh.io/using-larger-runners
+    # Consider using larger runners for possible analysis time improvements.
+    runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
+    timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
+    permissions:
+      actions: read
+      contents: read
+      security-events: write
+
+    strategy:
+      fail-fast: false
+      matrix:
+        language: [ 'csharp', 'javascript-typescript' ]
+        # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
+        # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
+        # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
+        # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
+
+    steps:
+    - name: Checkout repository
+      uses: actions/checkout@v3
+
+    # Initializes the CodeQL tools for scanning.
+    - name: Initialize CodeQL
+      uses: github/codeql-action/init@v2
+      with:
+        languages: ${{ matrix.language }}
+        # If you wish to specify custom queries, you can do so here or in a config file.
+        # By default, queries listed here will override any specified in a config file.
+        # Prefix the list here with "+" to use these queries and those in the config file.
+
+        # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
+        # queries: security-extended,security-and-quality
+
+
+    # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
+    # If this step fails, then you should remove it and run the build manually (see below)
+    - name: Autobuild
+      uses: github/codeql-action/autobuild@v2
+
+    # ℹ️ Command-line programs to run using the OS shell.
+    # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
+
+    #   If the Autobuild fails above, remove it and uncomment the following three lines.
+    #   modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
+
+    # - run: |
+    #     echo "Run, Build Application using script"
+    #     ./location_of_script_within_repo/buildscript.sh
+
+    - name: Perform CodeQL Analysis
+      uses: github/codeql-action/analyze@v2
+      with:
+        category: "/language:${{matrix.language}}"

+ 1 - 1
.github/workflows/dotnet-core.yml

@@ -18,7 +18,7 @@ jobs:
     - uses: actions/checkout@v4
     - uses: actions/checkout@v4
 
 
     - name: Setup .NET Core
     - name: Setup .NET Core
-      uses: actions/setup-dotnet@v3
+      uses: actions/setup-dotnet@v4
       with:
       with:
         dotnet-version: 7.0
         dotnet-version: 7.0
         dotnet-quality: 'ga'
         dotnet-quality: 'ga'

+ 1 - 1
.github/workflows/publish.yml

@@ -32,7 +32,7 @@ jobs:
       id: gitversion # step id used as reference for output values
       id: gitversion # step id used as reference for output values
 
 
     - name: Setup dotnet
     - name: Setup dotnet
-      uses: actions/setup-dotnet@v3
+      uses: actions/setup-dotnet@v4
       with:
       with:
         dotnet-version: 7.0
         dotnet-version: 7.0
         dotnet-quality: 'ga'
         dotnet-quality: 'ga'

+ 1 - 3
.gitignore

@@ -10,9 +10,7 @@ packages
 
 
 # API Docs
 # API Docs
 docfx/api
 docfx/api
-
-# Never push ./docs folder - the gh-pages branch is now used to publish to GH Pages
-docs/
+docfx/_site
 
 
 UnitTests/TestResults
 UnitTests/TestResults
 
 

+ 2 - 1
README.md

@@ -10,6 +10,7 @@
 ***The current, stable, release of Terminal.Gui is [v1.x](https://www.nuget.org/packages/Terminal.Gui). It is stable, rich, and broadly used. The team is now focused on designing and building a significant upgrade we're referring to as `v2`. Therefore:***
 ***The current, stable, release of Terminal.Gui is [v1.x](https://www.nuget.org/packages/Terminal.Gui). It is stable, rich, and broadly used. The team is now focused on designing and building a significant upgrade we're referring to as `v2`. Therefore:***
  * *`v1` is now in maintenance mode, meaning we will accept PRs for v1.x (the `develop` branch) only for issues impacting existing functionality.*
  * *`v1` is now in maintenance mode, meaning we will accept PRs for v1.x (the `develop` branch) only for issues impacting existing functionality.*
  * *All new development happens on the `v2_develop` branch. See the V2 discussion [here](https://github.com/gui-cs/Terminal.Gui/discussions/1940).*
  * *All new development happens on the `v2_develop` branch. See the V2 discussion [here](https://github.com/gui-cs/Terminal.Gui/discussions/1940).*
+ * *The latest v2 API Docs* (generated from `v2_develop`) can be found [here](https://gui-cs.github.io/Terminal.GuiV2Docs/). 
  * *Developers are encouraged to continue building on [v1.x](https://www.nuget.org/packages/Terminal.Gui) until we announce `v2` is stable.*
  * *Developers are encouraged to continue building on [v1.x](https://www.nuget.org/packages/Terminal.Gui) until we announce `v2` is stable.*
 
 
 **Terminal.Gui**: A toolkit for building rich console apps for .NET, .NET Core, and Mono that works on Windows, the Mac, and Linux/Unix.
 **Terminal.Gui**: A toolkit for building rich console apps for .NET, .NET Core, and Mono that works on Windows, the Mac, and Linux/Unix.
@@ -35,7 +36,7 @@ dotnet run
 * [Terminal.Gui Overview](https://gui-cs.github.io/Terminal.Gui/articles/overview.html)
 * [Terminal.Gui Overview](https://gui-cs.github.io/Terminal.Gui/articles/overview.html)
 * [List of Views/Controls](https://gui-cs.github.io/Terminal.Gui/articles/views.html)
 * [List of Views/Controls](https://gui-cs.github.io/Terminal.Gui/articles/views.html)
 * [Conceptual Documentation](https://gui-cs.github.io/Terminal.Gui/articles/index.html)
 * [Conceptual Documentation](https://gui-cs.github.io/Terminal.Gui/articles/index.html)
-* [API Documentation](https://gui-cs.github.io/Terminal.Gui/api/Terminal.Gui/Terminal.Gui.html)
+* [API Documentation](https://gui-cs.github.io/Terminal.Gui)
 
 
 _The Documentation matches the most recent Nuget release from the `main` branch ([![Version](https://img.shields.io/nuget/v/Terminal.Gui.svg)](https://www.nuget.org/packages/Terminal.Gui))_
 _The Documentation matches the most recent Nuget release from the `main` branch ([![Version](https://img.shields.io/nuget/v/Terminal.Gui.svg)](https://www.nuget.org/packages/Terminal.Gui))_
 
 

+ 3 - 3
ReactiveExample/ReactiveExample.csproj

@@ -10,9 +10,9 @@
     <InformationalVersion>1.14.0-pre.1+Branch.develop.Sha.e0b7464669ef87b96b57f2285200e02bcf85d0e7</InformationalVersion>-->
     <InformationalVersion>1.14.0-pre.1+Branch.develop.Sha.e0b7464669ef87b96b57f2285200e02bcf85d0e7</InformationalVersion>-->
   </PropertyGroup>
   </PropertyGroup>
   <ItemGroup>
   <ItemGroup>
-    <PackageReference Include="ReactiveUI.Fody" Version="19.4.1" />
-    <PackageReference Include="ReactiveUI" Version="19.4.1" />
-    <PackageReference Include="ReactiveMarbles.ObservableEvents.SourceGenerator" Version="1.2.3" PrivateAssets="all" />
+    <PackageReference Include="ReactiveUI.Fody" Version="19.5.39" />
+    <PackageReference Include="ReactiveUI" Version="19.5.39" />
+    <PackageReference Include="ReactiveMarbles.ObservableEvents.SourceGenerator" Version="1.3.1" PrivateAssets="all" />
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\Terminal.Gui\Terminal.Gui.csproj" />
     <ProjectReference Include="..\Terminal.Gui\Terminal.Gui.csproj" />

+ 72 - 8
Terminal.Gui/ConsoleDrivers/CursesDriver/CursesDriver.cs

@@ -341,6 +341,7 @@ namespace Terminal.Gui {
 			Key k = Key.Null;
 			Key k = Key.Null;
 
 
 			if (code == Curses.KEY_CODE_YES) {
 			if (code == Curses.KEY_CODE_YES) {
+				var lastWch = wch;
 				while (code == Curses.KEY_CODE_YES && wch == Curses.KeyResize) {
 				while (code == Curses.KEY_CODE_YES && wch == Curses.KeyResize) {
 					ProcessWinChange ();
 					ProcessWinChange ();
 					code = Curses.get_wch (out wch);
 					code = Curses.get_wch (out wch);
@@ -379,6 +380,25 @@ namespace Terminal.Gui {
 				} else if (wch >= 325 && wch <= 327) { // Shift+Alt+(F1 - F3)
 				} else if (wch >= 325 && wch <= 327) { // Shift+Alt+(F1 - F3)
 					wch -= 60;
 					wch -= 60;
 					k = Key.ShiftMask | Key.AltMask | MapCursesKey (wch);
 					k = Key.ShiftMask | Key.AltMask | MapCursesKey (wch);
+				} else {
+					code = Curses.get_wch (out wch);
+					if (code == 0) {
+						switch (wch) {
+						// Shift code.
+						case 16:
+							keyModifiers.Shift = true;
+							break;
+						default:
+							if (lastWch == Curses.KeyResize && wch == 91) {
+								// Returns this keys to the std input which is a CSI (\x1b[).
+								Curses.ungetch (91); // [
+								Curses.ungetch (27); // Esc
+								return;
+							} else {
+								throw new Exception ();
+							}
+						}
+					}
 				}
 				}
 				keyDownHandler (new KeyEvent (k, MapKeyModifiers (k)));
 				keyDownHandler (new KeyEvent (k, MapKeyModifiers (k)));
 				keyHandler (new KeyEvent (k, MapKeyModifiers (k)));
 				keyHandler (new KeyEvent (k, MapKeyModifiers (k)));
@@ -388,8 +408,6 @@ namespace Terminal.Gui {
 
 
 			// Special handling for ESC, we want to try to catch ESC+letter to simulate alt-letter as well as Alt-Fkey
 			// Special handling for ESC, we want to try to catch ESC+letter to simulate alt-letter as well as Alt-Fkey
 			if (wch == 27) {
 			if (wch == 27) {
-				Curses.timeout (10);
-
 				code = Curses.get_wch (out int wch2);
 				code = Curses.get_wch (out int wch2);
 
 
 				if (code == Curses.KEY_CODE_YES) {
 				if (code == Curses.KEY_CODE_YES) {
@@ -425,6 +443,56 @@ namespace Terminal.Gui {
 						} else if (wch >= (uint)Key.A && wch <= (uint)Key.Z) {
 						} else if (wch >= (uint)Key.A && wch <= (uint)Key.Z) {
 							keyModifiers.Shift = true;
 							keyModifiers.Shift = true;
 							keyModifiers.Alt = true;
 							keyModifiers.Alt = true;
+						} else if (wch2 == Curses.KeySS3) {
+							while (code > -1) {
+								code = Curses.get_wch (out wch2);
+								if (code == 0) {
+									switch (wch2) {
+									case 16:
+										keyModifiers.Shift = true;
+										break;
+									case 108:
+										k = (Key)'+';
+										break;
+									case 109:
+										k = (Key)'-';
+										break;
+									case 112:
+										k = Key.InsertChar;
+										break;
+									case 113:
+										k = Key.End;
+										break;
+									case 114:
+										k = Key.CursorDown;
+										break;
+									case 115:
+										k = Key.PageDown;
+										break;
+									case 116:
+										k = Key.CursorLeft;
+										break;
+									case 117:
+										k = Key.Clear;
+										break;
+									case 118:
+										k = Key.CursorRight;
+										break;
+									case 119:
+										k = Key.Home;
+										break;
+									case 120:
+										k = Key.CursorUp;
+										break;
+									case 121:
+										k = Key.PageUp;
+										break;
+									default:
+										k = (Key)wch2;
+										break;
+									}
+								}
+							}
 						} else if (wch2 < 256) {
 						} else if (wch2 < 256) {
 							k = (Key)wch2;
 							k = (Key)wch2;
 							keyModifiers.Alt = true;
 							keyModifiers.Alt = true;
@@ -559,7 +627,6 @@ namespace Terminal.Gui {
 		public override void PrepareToRun (MainLoop mainLoop, Action<KeyEvent> keyHandler, Action<KeyEvent> keyDownHandler, Action<KeyEvent> keyUpHandler, Action<MouseEvent> mouseHandler)
 		public override void PrepareToRun (MainLoop mainLoop, Action<KeyEvent> keyHandler, Action<KeyEvent> keyDownHandler, Action<KeyEvent> keyUpHandler, Action<MouseEvent> mouseHandler)
 		{
 		{
 			// Note: Curses doesn't support keydown/up events and thus any passed keyDown/UpHandlers will never be called
 			// Note: Curses doesn't support keydown/up events and thus any passed keyDown/UpHandlers will never be called
-			Curses.timeout (0);
 			this.keyHandler = keyHandler;
 			this.keyHandler = keyHandler;
 			this.keyDownHandler = keyDownHandler;
 			this.keyDownHandler = keyDownHandler;
 			this.keyUpHandler = keyUpHandler;
 			this.keyUpHandler = keyUpHandler;
@@ -572,9 +639,7 @@ namespace Terminal.Gui {
 				return true;
 				return true;
 			});
 			});
 
 
-			mLoop.WinChanged += () => {
-				ProcessInput ();
-			};
+			mLoop.WinChanged += () => ProcessWinChange ();
 		}
 		}
 
 
 		public override void Init (Action terminalResized)
 		public override void Init (Action terminalResized)
@@ -585,6 +650,7 @@ namespace Terminal.Gui {
 			try {
 			try {
 				window = Curses.initscr ();
 				window = Curses.initscr ();
 				Curses.set_escdelay (10);
 				Curses.set_escdelay (10);
+				Curses.nodelay (window.Handle, true);
 			} catch (Exception e) {
 			} catch (Exception e) {
 				throw new Exception ($"Curses failed to initialize, the exception is: {e.Message}");
 				throw new Exception ($"Curses failed to initialize, the exception is: {e.Message}");
 			}
 			}
@@ -673,13 +739,11 @@ namespace Terminal.Gui {
 
 
 			ResizeScreen ();
 			ResizeScreen ();
 			UpdateOffScreen ();
 			UpdateOffScreen ();
-
 		}
 		}
 
 
 		public override void ResizeScreen ()
 		public override void ResizeScreen ()
 		{
 		{
 			Clip = new Rect (0, 0, Cols, Rows);
 			Clip = new Rect (0, 0, Cols, Rows);
-			Curses.refresh ();
 		}
 		}
 
 
 		public override void UpdateOffScreen ()
 		public override void UpdateOffScreen ()

+ 44 - 12
Terminal.Gui/ConsoleDrivers/CursesDriver/binding.cs

@@ -41,22 +41,26 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 //
+
+//#define USE_IOCTL
+
 using System;
 using System;
 using System.Runtime.InteropServices;
 using System.Runtime.InteropServices;
 using Terminal.Gui;
 using Terminal.Gui;
 
 
 namespace Unix.Terminal {
 namespace Unix.Terminal {
 #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
 #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
-
 	public partial class Curses {
 	public partial class Curses {
-		//[StructLayout (LayoutKind.Sequential)]
-		//public struct winsize {
-		//	public ushort ws_row;
-		//	public ushort ws_col;
-		//	public ushort ws_xpixel;   /* unused */
-		//	public ushort ws_ypixel;   /* unused */
-		//};
+#if USE_IOCTL
 
 
+		[StructLayout (LayoutKind.Sequential)]
+		public struct winsize {
+			public ushort ws_row;
+			public ushort ws_col;
+			public ushort ws_xpixel;   /* unused */
+			public ushort ws_ypixel;   /* unused */
+		};
+#endif
 		[StructLayout (LayoutKind.Sequential)]
 		[StructLayout (LayoutKind.Sequential)]
 		public struct MouseEvent {
 		public struct MouseEvent {
 			public short ID;
 			public short ID;
@@ -77,10 +81,11 @@ namespace Unix.Terminal {
 
 
 		[DllImport ("libc")]
 		[DllImport ("libc")]
 		public extern static int setlocale (int cate, [MarshalAs (UnmanagedType.LPStr)] string locale);
 		public extern static int setlocale (int cate, [MarshalAs (UnmanagedType.LPStr)] string locale);
+#if USE_IOCTL
 
 
-		//[DllImport ("libc")]
-		//public extern static int ioctl (int fd, int cmd, out winsize argp);
-
+		[DllImport ("libc")]
+		public extern static int ioctl (int fd, int cmd, out winsize argp);
+#endif
 		static void LoadMethods ()
 		static void LoadMethods ()
 		{
 		{
 			var libs = UnmanagedLibrary.IsMacOSPlatform ? new string [] { "libncurses.dylib" } : new string [] { "libncursesw.so.6", "libncursesw.so.5" };
 			var libs = UnmanagedLibrary.IsMacOSPlatform ? new string [] { "libncurses.dylib" } : new string [] { "libncursesw.so.6", "libncursesw.so.5" };
@@ -227,9 +232,32 @@ namespace Unix.Terminal {
 
 
 		internal static void console_sharp_get_dims (out int lines, out int cols)
 		internal static void console_sharp_get_dims (out int lines, out int cols)
 		{
 		{
+#if USE_IOCTL
+
+			if (UnmanagedLibrary.IsMacOSPlatform) {
+				int cmd = TIOCGWINSZ_MAC;
+
+				if (ioctl (1, cmd, out winsize ws) == 0) {
+					lines = ws.ws_row;
+					cols = ws.ws_col;
+
+					if (lines == Lines && cols == Cols) {
+						return;
+					}
+
+					resizeterm (lines, cols);
+				} else {
+					lines = Lines;
+					cols = Cols;
+				}
+			} else {
+				lines = Marshal.ReadInt32 (lines_ptr);
+				cols = Marshal.ReadInt32 (cols_ptr);
+			}
+#else
 			lines = Marshal.ReadInt32 (lines_ptr);
 			lines = Marshal.ReadInt32 (lines_ptr);
 			cols = Marshal.ReadInt32 (cols_ptr);
 			cols = Marshal.ReadInt32 (cols_ptr);
-
+#endif
 			//int cmd;
 			//int cmd;
 			//if (UnmanagedLibrary.IsMacOSPlatform) {
 			//if (UnmanagedLibrary.IsMacOSPlatform) {
 			//	cmd = TIOCGWINSZ_MAC;
 			//	cmd = TIOCGWINSZ_MAC;
@@ -347,6 +375,7 @@ namespace Unix.Terminal {
 		static public int savetty () => methods.savetty ();
 		static public int savetty () => methods.savetty ();
 		static public int resetty () => methods.resetty ();
 		static public int resetty () => methods.resetty ();
 		static public int set_escdelay (int size) => methods.set_escdelay (size);
 		static public int set_escdelay (int size) => methods.set_escdelay (size);
+		static public int nodelay (IntPtr win, bool bf) => methods.nodelay (win, bf);
 	}
 	}
 
 
 #pragma warning disable RCS1102 // Make class static.
 #pragma warning disable RCS1102 // Make class static.
@@ -424,6 +453,7 @@ namespace Unix.Terminal {
 		public delegate int savetty ();
 		public delegate int savetty ();
 		public delegate int resetty ();
 		public delegate int resetty ();
 		public delegate int set_escdelay (int size);
 		public delegate int set_escdelay (int size);
+		public delegate int nodelay (IntPtr win, bool bf);
 	}
 	}
 
 
 	internal class NativeMethods {
 	internal class NativeMethods {
@@ -498,6 +528,7 @@ namespace Unix.Terminal {
 		public readonly Delegates.savetty savetty;
 		public readonly Delegates.savetty savetty;
 		public readonly Delegates.resetty resetty;
 		public readonly Delegates.resetty resetty;
 		public readonly Delegates.set_escdelay set_escdelay;
 		public readonly Delegates.set_escdelay set_escdelay;
+		public readonly Delegates.nodelay nodelay;
 		public UnmanagedLibrary UnmanagedLibrary;
 		public UnmanagedLibrary UnmanagedLibrary;
 
 
 		public NativeMethods (UnmanagedLibrary lib)
 		public NativeMethods (UnmanagedLibrary lib)
@@ -574,6 +605,7 @@ namespace Unix.Terminal {
 			savetty = lib.GetNativeMethodDelegate<Delegates.savetty> ("savetty");
 			savetty = lib.GetNativeMethodDelegate<Delegates.savetty> ("savetty");
 			resetty = lib.GetNativeMethodDelegate<Delegates.resetty> ("resetty");
 			resetty = lib.GetNativeMethodDelegate<Delegates.resetty> ("resetty");
 			set_escdelay = lib.GetNativeMethodDelegate<Delegates.set_escdelay> ("set_escdelay");
 			set_escdelay = lib.GetNativeMethodDelegate<Delegates.set_escdelay> ("set_escdelay");
+			nodelay = lib.GetNativeMethodDelegate<Delegates.nodelay> ("nodelay");
 		}
 		}
 	}
 	}
 #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
 #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member

+ 1 - 0
Terminal.Gui/ConsoleDrivers/CursesDriver/constants.cs

@@ -106,6 +106,7 @@ namespace Unix.Terminal {
 		public const int KeyHome = unchecked((int)0x106);
 		public const int KeyHome = unchecked((int)0x106);
 		public const int KeyMouse = unchecked((int)0x199);
 		public const int KeyMouse = unchecked((int)0x199);
 		public const int KeyCSI = unchecked((int)0x5b);
 		public const int KeyCSI = unchecked((int)0x5b);
+		public const int KeySS3 = unchecked((int)0x4f);
 		public const int KeyEnd = unchecked((int)0x168);
 		public const int KeyEnd = unchecked((int)0x168);
 		public const int KeyDeleteChar = unchecked((int)0x14a);
 		public const int KeyDeleteChar = unchecked((int)0x14a);
 		public const int KeyInsertChar = unchecked((int)0x14b);
 		public const int KeyInsertChar = unchecked((int)0x14b);

+ 39 - 15
Terminal.Gui/Core/Application.cs

@@ -86,7 +86,7 @@ namespace Terminal.Gui {
 		/// </summary>
 		/// </summary>
 		public static Toplevel MdiTop {
 		public static Toplevel MdiTop {
 			get {
 			get {
-				if (Top.IsMdiContainer) {
+				if (Top?.IsMdiContainer == true) {
 					return Top;
 					return Top;
 				}
 				}
 				return null;
 				return null;
@@ -516,11 +516,8 @@ namespace Terminal.Gui {
 			protected virtual void Dispose (bool disposing)
 			protected virtual void Dispose (bool disposing)
 			{
 			{
 				if (Toplevel != null && disposing) {
 				if (Toplevel != null && disposing) {
-					throw new InvalidOperationException ("You must clean up (Dispose) the Toplevel before calling Application.RunState.Dispose");
-					// BUGBUG: It's insidious that we call EndFirstTopLevel here so I moved it to End.
-					//EndFirstTopLevel (Toplevel);
-					//Toplevel.Dispose ();
-					//Toplevel = null;
+					Toplevel.Dispose ();
+					Toplevel = null;
 				}
 				}
 			}
 			}
 		}
 		}
@@ -531,7 +528,7 @@ namespace Terminal.Gui {
 				return;
 				return;
 			}
 			}
 
 
-			var chain = toplevels.ToList ();
+			var chain = toplevels.Where (t => t.Visible).ToList ();
 			foreach (var topLevel in chain) {
 			foreach (var topLevel in chain) {
 				if (topLevel.ProcessHotKey (ke)) {
 				if (topLevel.ProcessHotKey (ke)) {
 					EnsuresMdiTopOnFrontIfMdiTopMostFocused ();
 					EnsuresMdiTopOnFrontIfMdiTopMostFocused ();
@@ -695,6 +692,16 @@ namespace Terminal.Gui {
 		/// </summary>
 		/// </summary>
 		public static View MouseGrabView => mouseGrabView;
 		public static View MouseGrabView => mouseGrabView;
 
 
+		/// <summary>
+		/// Invoked when a view wants to grab the mouse; can be canceled.
+		/// </summary>
+		public static event Func<View, bool> GrabbingMouse;
+
+		/// <summary>
+		/// Invoked when a view wants ungrab the mouse; can be canceled.
+		/// </summary>
+		public static event Func<View, bool> UnGrabbingMouse;
+
 		/// <summary>
 		/// <summary>
 		/// Event to be invoked when a view grab the mouse.
 		/// Event to be invoked when a view grab the mouse.
 		/// </summary>
 		/// </summary>
@@ -714,9 +721,11 @@ namespace Terminal.Gui {
 		{
 		{
 			if (view == null)
 			if (view == null)
 				return;
 				return;
-			OnGrabbedMouse (view);
-			mouseGrabView = view;
-			Driver.UncookMouse ();
+			if (!OnGrabbingMouse (view)) {
+				OnGrabbedMouse (view);
+				mouseGrabView = view;
+				Driver.UncookMouse ();
+			}
 		}
 		}
 
 
 		/// <summary>
 		/// <summary>
@@ -726,9 +735,25 @@ namespace Terminal.Gui {
 		{
 		{
 			if (mouseGrabView == null)
 			if (mouseGrabView == null)
 				return;
 				return;
-			OnUnGrabbedMouse (mouseGrabView);
-			mouseGrabView = null;
-			Driver.CookMouse ();
+			if (!OnUnGrabbingMouse (mouseGrabView)) {
+				OnUnGrabbedMouse (mouseGrabView);
+				mouseGrabView = null;
+				Driver.CookMouse ();
+			}
+		}
+
+		static bool OnGrabbingMouse (View view)
+		{
+			if (view == null || GrabbingMouse == null)
+				return false;
+			return (bool)(GrabbingMouse?.Invoke (view));
+		}
+
+		static bool OnUnGrabbingMouse (View view)
+		{
+			if (view == null || UnGrabbingMouse == null)
+				return false;
+			return (bool)(UnGrabbingMouse?.Invoke (view));
 		}
 		}
 
 
 		static void OnGrabbedMouse (View view)
 		static void OnGrabbedMouse (View view)
@@ -1062,6 +1087,7 @@ namespace Terminal.Gui {
 			// Set Current and Top to the next TopLevel on the stack
 			// Set Current and Top to the next TopLevel on the stack
 			if (toplevels.Count == 0) {
 			if (toplevels.Count == 0) {
 				Current = null;
 				Current = null;
+				Top = null;
 			} else {
 			} else {
 				Current = toplevels.Peek ();
 				Current = toplevels.Peek ();
 				if (toplevels.Count == 1 && Current == MdiTop) {
 				if (toplevels.Count == 1 && Current == MdiTop) {
@@ -1074,8 +1100,6 @@ namespace Terminal.Gui {
 				Refresh ();
 				Refresh ();
 			}
 			}
 
 
-			runState.Toplevel?.Dispose ();
-			runState.Toplevel = null;
 			runState.Dispose ();
 			runState.Dispose ();
 		}
 		}
 
 

+ 5 - 1
Terminal.Gui/Core/Border.cs

@@ -234,7 +234,11 @@ namespace Terminal.Gui {
 
 
 				SetNeedsDisplay ();
 				SetNeedsDisplay ();
 				var touched = view.Frame;
 				var touched = view.Frame;
-				Border.Child.Remove (view);
+				if (view == Border.Child) {
+					base.Remove (view);
+				} else {
+					Border.Child.Remove (view);
+				}
 
 
 				if (Border.Child.InternalSubviews.Count < 1) {
 				if (Border.Child.InternalSubviews.Count < 1) {
 					CanFocus = false;
 					CanFocus = false;

+ 36 - 5
Terminal.Gui/Core/Toplevel.cs

@@ -5,7 +5,7 @@ using System.Linq;
 
 
 namespace Terminal.Gui {
 namespace Terminal.Gui {
 	/// <summary>
 	/// <summary>
-	/// Toplevel views can be modally executed. They are used for both an application's main view (filling the entire screeN and
+	/// Toplevel views can be modally executed. They are used for both an application's main view (filling the entire screen and
 	/// for pop-up views such as <see cref="Dialog"/>, <see cref="MessageBox"/>, and <see cref="Wizard"/>.
 	/// for pop-up views such as <see cref="Dialog"/>, <see cref="MessageBox"/>, and <see cref="Wizard"/>.
 	/// </summary>
 	/// </summary>
 	/// <remarks>
 	/// <remarks>
@@ -220,6 +220,9 @@ namespace Terminal.Gui {
 		{
 		{
 			ColorScheme = Colors.TopLevel;
 			ColorScheme = Colors.TopLevel;
 
 
+			Application.GrabbingMouse += Application_GrabbingMouse;
+			Application.UnGrabbingMouse += Application_UnGrabbingMouse;
+
 			// Things this view knows how to do
 			// Things this view knows how to do
 			AddCommand (Command.QuitToplevel, () => { QuitToplevel (); return true; });
 			AddCommand (Command.QuitToplevel, () => { QuitToplevel (); return true; });
 			AddCommand (Command.Suspend, () => { Driver.Suspend (); ; return true; });
 			AddCommand (Command.Suspend, () => { Driver.Suspend (); ; return true; });
@@ -255,6 +258,24 @@ namespace Terminal.Gui {
 			AddKeyBinding (Key.L | Key.CtrlMask, Command.Refresh);
 			AddKeyBinding (Key.L | Key.CtrlMask, Command.Refresh);
 		}
 		}
 
 
+		private bool  Application_UnGrabbingMouse (View e)
+		{
+			if (dragPosition.HasValue) {
+				return true;
+			}
+
+			return false;
+		}
+
+		private bool Application_GrabbingMouse (View e)
+		{
+			if (Application.MouseGrabView == this && dragPosition.HasValue) {
+				return true;
+			}
+
+			return false;
+		}
+
 		/// <summary>
 		/// <summary>
 		/// Invoked when the <see cref="Application.AlternateForwardKey"/> is changed.
 		/// Invoked when the <see cref="Application.AlternateForwardKey"/> is changed.
 		/// </summary>
 		/// </summary>
@@ -628,7 +649,8 @@ namespace Terminal.Gui {
 			}
 			}
 			mb = null; sb = null;
 			mb = null; sb = null;
 			if (!(superView is Toplevel)) {
 			if (!(superView is Toplevel)) {
-				nx = x; ny = y;
+				nx = Math.Max (Math.Min (x, top.Frame.Right - 1), 0);
+				ny = Math.Max (Math.Min (y, top.Frame.Bottom - 1), 0);
 				return superView;
 				return superView;
 			}
 			}
 			var superViewBorder = superView.Border != null ? (superView.Border.DrawMarginFrame ? 1 : 0) : 0;
 			var superViewBorder = superView.Border != null ? (superView.Border.DrawMarginFrame ? 1 : 0) : 0;
@@ -835,11 +857,10 @@ namespace Terminal.Gui {
 				// Only start grabbing if the user clicks on the title bar.
 				// Only start grabbing if the user clicks on the title bar.
 				if (mouseEvent.Y == 0 && mouseEvent.Flags == MouseFlags.Button1Pressed) {
 				if (mouseEvent.Y == 0 && mouseEvent.Flags == MouseFlags.Button1Pressed) {
 					start = new Point (mouseEvent.X, mouseEvent.Y);
 					start = new Point (mouseEvent.X, mouseEvent.Y);
-					dragPosition = new Point ();
+					Application.GrabMouse (this);
 					nx = mouseEvent.X - mouseEvent.OfX;
 					nx = mouseEvent.X - mouseEvent.OfX;
 					ny = mouseEvent.Y - mouseEvent.OfY;
 					ny = mouseEvent.Y - mouseEvent.OfY;
 					dragPosition = new Point (nx, ny);
 					dragPosition = new Point (nx, ny);
-					Application.GrabMouse (this);
 				}
 				}
 
 
 				//System.Diagnostics.Debug.WriteLine ($"Starting at {dragPosition}");
 				//System.Diagnostics.Debug.WriteLine ($"Starting at {dragPosition}");
@@ -872,8 +893,8 @@ namespace Terminal.Gui {
 			}
 			}
 
 
 			if (mouseEvent.Flags.HasFlag (MouseFlags.Button1Released) && dragPosition.HasValue) {
 			if (mouseEvent.Flags.HasFlag (MouseFlags.Button1Released) && dragPosition.HasValue) {
-				Application.UngrabMouse ();
 				dragPosition = null;
 				dragPosition = null;
+				Application.UngrabMouse ();
 			}
 			}
 
 
 			//System.Diagnostics.Debug.WriteLine ($"dragPosition after: {dragPosition.HasValue}");
 			//System.Diagnostics.Debug.WriteLine ($"dragPosition after: {dragPosition.HasValue}");
@@ -1032,6 +1053,16 @@ namespace Terminal.Gui {
 		{
 		{
 			return MostFocused?.OnLeave (view) ?? base.OnLeave (view);
 			return MostFocused?.OnLeave (view) ?? base.OnLeave (view);
 		}
 		}
+
+		///<inheritdoc/>
+		protected override void Dispose (bool disposing)
+		{
+			Application.GrabbingMouse -= Application_GrabbingMouse;
+			Application.UnGrabbingMouse -= Application_UnGrabbingMouse;
+
+			dragPosition = null;
+			base.Dispose (disposing);
+		}
 	}
 	}
 
 
 	/// <summary>
 	/// <summary>

+ 6 - 3
Terminal.Gui/Core/View.cs

@@ -2,7 +2,6 @@
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.ComponentModel;
 using System.Linq;
 using System.Linq;
-using System.Reflection;
 using NStack;
 using NStack;
 
 
 namespace Terminal.Gui {
 namespace Terminal.Gui {
@@ -1501,8 +1500,11 @@ namespace Terminal.Gui {
 				(GetType ().IsNestedPublic && !IsOverridden (this, "Redraw") || GetType ().Name == "View") &&
 				(GetType ().IsNestedPublic && !IsOverridden (this, "Redraw") || GetType ().Name == "View") &&
 				(!NeedDisplay.IsEmpty || ChildNeedsDisplay || LayoutNeeded)) {
 				(!NeedDisplay.IsEmpty || ChildNeedsDisplay || LayoutNeeded)) {
 
 
-				Clear ();
-				SetChildNeedsDisplay ();
+				if (ColorScheme != null) {
+					Driver.SetAttribute (GetNormalColor ());
+					Clear ();
+					SetChildNeedsDisplay ();
+				}
 			}
 			}
 
 
 			if (!ustring.IsNullOrEmpty (TextFormatter.Text)) {
 			if (!ustring.IsNullOrEmpty (TextFormatter.Text)) {
@@ -2944,6 +2946,7 @@ namespace Terminal.Gui {
 				subview.Dispose ();
 				subview.Dispose ();
 			}
 			}
 			base.Dispose (disposing);
 			base.Dispose (disposing);
+			System.Diagnostics.Debug.Assert (InternalSubviews.Count == 0);
 		}
 		}
 
 
 		/// <summary>
 		/// <summary>

+ 5 - 2
Terminal.Gui/Core/Window.cs

@@ -10,7 +10,6 @@
 // Any udpates done here should probably be done in FrameView as well; TODO: Merge these classes
 // Any udpates done here should probably be done in FrameView as well; TODO: Merge these classes
 
 
 using System;
 using System;
-using System.Collections;
 using System.Linq;
 using System.Linq;
 using NStack;
 using NStack;
 
 
@@ -271,7 +270,11 @@ namespace Terminal.Gui {
 			}
 			}
 
 
 			SetNeedsDisplay ();
 			SetNeedsDisplay ();
-			contentView.Remove (view);
+			if (view == contentView) {
+				base.Remove (view);
+			} else {
+				contentView.Remove (view);
+			}
 
 
 			RemoveMenuStatusBar (view);
 			RemoveMenuStatusBar (view);
 			if (view != contentView && Focused == null) {
 			if (view != contentView && Focused == null) {

+ 6 - 4
Terminal.Gui/Terminal.Gui.csproj

@@ -29,11 +29,11 @@
   <!-- Dependencies -->
   <!-- Dependencies -->
   <!-- =================================================================== -->
   <!-- =================================================================== -->
   <ItemGroup>
   <ItemGroup>
-    <PackageReference Include="NStack.Core" Version="1.0.7" />
-    <PackageReference Include="System.Management" Version="7.0.2" />
+    <PackageReference Include="NStack.Core" Version="1.1.1" />
+    <PackageReference Include="System.Management" Version="8.0.0" />
     <!-- Enable Nuget Source Link for github -->
     <!-- Enable Nuget Source Link for github -->
-    <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
-    <InternalsVisibleTo Include="UnitTests" />
+    <PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
+    <InternalsVisibleTo Include="UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c135ca0dc72ed9549b7ebf23772eb9e3dc2dc9e4a4fb795fa88404a175cfbe230a3d5edb1802c7952b1b5edbeb8136dc16ea6ab03f3f6fed01e9937d8ef40378bee9a31502cd56bfc14adfb2858d438c66d87aea4c54c49bfad28a282bed869af33ac256fe9584b1c5b96479b52a0c95b5a400a7b833820faa272d16ce0586ed" />
   </ItemGroup>
   </ItemGroup>
   <PropertyGroup>
   <PropertyGroup>
     <!-- Uncomment the RestoreSources element to have dotnet restore pull NStack from a local dir for testing -->
     <!-- Uncomment the RestoreSources element to have dotnet restore pull NStack from a local dir for testing -->
@@ -101,5 +101,7 @@
     <EnableSourceLink>true</EnableSourceLink>
     <EnableSourceLink>true</EnableSourceLink>
     <!--<DebugType>Embedded</DebugType>-->
     <!--<DebugType>Embedded</DebugType>-->
     <Authors>Miguel de Icaza, Tig Kindel (@tig), @BDisp</Authors>
     <Authors>Miguel de Icaza, Tig Kindel (@tig), @BDisp</Authors>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>Terminal.Gui.snk</AssemblyOriginatorKeyFile>
   </PropertyGroup>
   </PropertyGroup>
 </Project>
 </Project>

BIN
Terminal.Gui/Terminal.Gui.snk


+ 5 - 1
Terminal.Gui/Views/Button.cs

@@ -129,6 +129,10 @@ namespace Terminal.Gui {
 		/// Gets or sets whether the <see cref="Button"/> is the default action to activate in a dialog.
 		/// Gets or sets whether the <see cref="Button"/> is the default action to activate in a dialog.
 		/// </summary>
 		/// </summary>
 		/// <value><c>true</c> if is default; otherwise, <c>false</c>.</value>
 		/// <value><c>true</c> if is default; otherwise, <c>false</c>.</value>
+		/// <remarks>
+		/// If is <see langword="true"/> the current focused view
+		/// will remain focused if the window is not closed.
+		/// </remarks>
 		public bool IsDefault {
 		public bool IsDefault {
 			get => is_default;
 			get => is_default;
 			set {
 			set {
@@ -219,7 +223,7 @@ namespace Terminal.Gui {
 
 
 		bool AcceptKey ()
 		bool AcceptKey ()
 		{
 		{
-			if (!HasFocus) {
+			if (!IsDefault && !HasFocus) {
 				SetFocus ();
 				SetFocus ();
 			}
 			}
 			OnClicked ();
 			OnClicked ();

+ 0 - 9
Terminal.Gui/Views/ContextMenu.cs

@@ -79,7 +79,6 @@ namespace Terminal.Gui {
 			}
 			}
 			if (container != null) {
 			if (container != null) {
 				container.Closing -= Container_Closing;
 				container.Closing -= Container_Closing;
-				container.Resized -= Container_Resized;
 			}
 			}
 		}
 		}
 
 
@@ -93,7 +92,6 @@ namespace Terminal.Gui {
 			}
 			}
 			container = Application.Current;
 			container = Application.Current;
 			container.Closing += Container_Closing;
 			container.Closing += Container_Closing;
-			container.Resized += Container_Resized;
 			var frame = container.Frame;
 			var frame = container.Frame;
 			var position = Position;
 			var position = Position;
 			if (Host != null) {
 			if (Host != null) {
@@ -145,13 +143,6 @@ namespace Terminal.Gui {
 			menuBar.OpenMenu ();
 			menuBar.OpenMenu ();
 		}
 		}
 
 
-		private void Container_Resized (Size obj)
-		{
-			if (IsShow) {
-				Show ();
-			}
-		}
-
 		private void Container_Closing (ToplevelClosingEventArgs obj)
 		private void Container_Closing (ToplevelClosingEventArgs obj)
 		{
 		{
 			Hide ();
 			Hide ();

+ 5 - 2
Terminal.Gui/Views/FrameView.cs

@@ -9,7 +9,6 @@
 //  - Does not support IEnumerable
 //  - Does not support IEnumerable
 // Any udpates done here should probably be done in Window as well; TODO: Merge these classes
 // Any udpates done here should probably be done in Window as well; TODO: Merge these classes
 
 
-using System;
 using System.Linq;
 using System.Linq;
 using NStack;
 using NStack;
 
 
@@ -202,7 +201,11 @@ namespace Terminal.Gui {
 
 
 			SetNeedsDisplay ();
 			SetNeedsDisplay ();
 			var touched = view.Frame;
 			var touched = view.Frame;
-			contentView.Remove (view);
+			if (view == contentView) {
+				base.Remove (view);
+			} else {
+				contentView.Remove (view);
+			}
 
 
 			if (contentView.InternalSubviews.Count < 1)
 			if (contentView.InternalSubviews.Count < 1)
 				this.CanFocus = false;
 				this.CanFocus = false;

+ 5 - 3
Terminal.Gui/Views/ListView.cs

@@ -866,10 +866,10 @@ namespace Terminal.Gui {
 
 
 		void RenderUstr (ConsoleDriver driver, ustring ustr, int col, int line, int width, int start = 0)
 		void RenderUstr (ConsoleDriver driver, ustring ustr, int col, int line, int width, int start = 0)
 		{
 		{
-			var u = TextFormatter.ClipAndJustify (ustr, width, TextAlignment.Left);
+			var u = TextFormatter.ClipAndJustify (ustr, width + start, TextAlignment.Left);
 			driver.AddStr (u);
 			driver.AddStr (u);
 			width -= TextFormatter.GetTextWidth (u);
 			width -= TextFormatter.GetTextWidth (u);
-			while (width-- > 0) {
+			while (width-- + start > 0) {
 				driver.AddRune (' ');
 				driver.AddRune (' ');
 			}
 			}
 		}
 		}
@@ -877,7 +877,8 @@ namespace Terminal.Gui {
 		/// <inheritdoc/>
 		/// <inheritdoc/>
 		public void Render (ListView container, ConsoleDriver driver, bool marked, int item, int col, int line, int width, int start = 0)
 		public void Render (ListView container, ConsoleDriver driver, bool marked, int item, int col, int line, int width, int start = 0)
 		{
 		{
-			container.Move (col, line);
+			var savedClip = container.ClipToBounds();
+			container.Move (col - start, line);
 			var t = src? [item];
 			var t = src? [item];
 			if (t == null) {
 			if (t == null) {
 				RenderUstr (driver, ustring.Make (""), col, line, width);
 				RenderUstr (driver, ustring.Make (""), col, line, width);
@@ -890,6 +891,7 @@ namespace Terminal.Gui {
 					RenderUstr (driver, t.ToString (), col, line, width, start);
 					RenderUstr (driver, t.ToString (), col, line, width, start);
 				}
 				}
 			}
 			}
+			driver.Clip = savedClip;
 		}
 		}
 
 
 		/// <inheritdoc/>
 		/// <inheritdoc/>

+ 25 - 0
Terminal.Gui/Views/Menu.cs

@@ -424,6 +424,10 @@ namespace Terminal.Gui {
 				WantMousePositionReports = host.WantMousePositionReports;
 				WantMousePositionReports = host.WantMousePositionReports;
 			}
 			}
 
 
+			if (Application.Current != null) {
+				Application.Current.Resized += Current_Resized;
+			}
+
 			// Things this view knows how to do
 			// Things this view knows how to do
 			AddCommand (Command.LineUp, () => MoveUp ());
 			AddCommand (Command.LineUp, () => MoveUp ());
 			AddCommand (Command.LineDown, () => MoveDown ());
 			AddCommand (Command.LineDown, () => MoveDown ());
@@ -449,6 +453,13 @@ namespace Terminal.Gui {
 			AddKeyBinding (Key.Enter, Command.Accept);
 			AddKeyBinding (Key.Enter, Command.Accept);
 		}
 		}
 
 
+		private void Current_Resized (Size obj)
+		{
+			if (host.IsMenuOpen) {
+				host.CloseAllMenus ();
+			}
+		}
+
 		internal Attribute DetermineColorSchemeFor (MenuItem item, int index)
 		internal Attribute DetermineColorSchemeFor (MenuItem item, int index)
 		{
 		{
 			if (item != null) {
 			if (item != null) {
@@ -846,6 +857,15 @@ namespace Terminal.Gui {
 
 
 			return base.OnEnter (view);
 			return base.OnEnter (view);
 		}
 		}
+
+		protected override void Dispose (bool disposing)
+		{
+			if (Application.Current != null) {
+				Application.Current.Resized -= Current_Resized;
+			}
+
+			base.Dispose (disposing);
+		}
 	}
 	}
 
 
 	/// <summary>
 	/// <summary>
@@ -1677,6 +1697,11 @@ namespace Terminal.Gui {
 			var c = ((uint)kb.Key & (uint)Key.CharMask);
 			var c = ((uint)kb.Key & (uint)Key.CharMask);
 			for (int i = 0; i < children.Length; i++) {
 			for (int i = 0; i < children.Length; i++) {
 				var mi = children [i];
 				var mi = children [i];
+
+				if (mi == null) {
+					continue;
+				}
+
 				int p = mi.Title.IndexOf (MenuBar.HotKeySpecifier);
 				int p = mi.Title.IndexOf (MenuBar.HotKeySpecifier);
 				if (p != -1 && p + 1 < mi.Title.RuneCount) {
 				if (p != -1 && p + 1 < mi.Title.RuneCount) {
 					if (Char.ToUpperInvariant ((char)mi.Title [p + 1]) == c) {
 					if (Char.ToUpperInvariant ((char)mi.Title [p + 1]) == c) {

+ 7 - 6
Terminal.Gui/Views/ScrollBarView.cs

@@ -116,6 +116,7 @@ namespace Terminal.Gui {
 			contentBottomRightCorner.Width = 1;
 			contentBottomRightCorner.Width = 1;
 			contentBottomRightCorner.Height = 1;
 			contentBottomRightCorner.Height = 1;
 			contentBottomRightCorner.MouseClick += ContentBottomRightCorner_MouseClick;
 			contentBottomRightCorner.MouseClick += ContentBottomRightCorner_MouseClick;
+			contentBottomRightCorner.DrawContent += ContentBottomRightCorner_DrawContent;
 			ClearOnVisibleFalse = false;
 			ClearOnVisibleFalse = false;
 		}
 		}
 
 
@@ -161,6 +162,12 @@ namespace Terminal.Gui {
 			}
 			}
 		}
 		}
 
 
+		private void ContentBottomRightCorner_DrawContent (Rect obj)
+		{
+			Driver.SetAttribute (Host.HasFocus ? GetFocusColor () : GetNormalColor ());
+			Host.SuperView.AddRune (contentBottomRightCorner.Frame.X, contentBottomRightCorner.Frame.Y, ' ');
+		}
+
 		void Init (int size, int position, bool isVertical)
 		void Init (int size, int position, bool isVertical)
 		{
 		{
 			vertical = isVertical;
 			vertical = isVertical;
@@ -601,12 +608,6 @@ namespace Terminal.Gui {
 					Driver.AddRune (Driver.RightArrow);
 					Driver.AddRune (Driver.RightArrow);
 				}
 				}
 			}
 			}
-
-			if (contentBottomRightCorner != null && hosted && showBothScrollIndicator) {
-				contentBottomRightCorner.Redraw (contentBottomRightCorner.Bounds);
-			} else if (otherScrollBarView != null && otherScrollBarView.contentBottomRightCorner != null && otherScrollBarView.hosted && otherScrollBarView.showBothScrollIndicator) {
-				otherScrollBarView.contentBottomRightCorner.Redraw (otherScrollBarView.contentBottomRightCorner.Bounds);
-			}
 		}
 		}
 
 
 		int lastLocation = -1;
 		int lastLocation = -1;

+ 34 - 11
Terminal.Gui/Views/ScrollView.cs

@@ -237,6 +237,39 @@ namespace Terminal.Gui {
 			SetNeedsLayout ();
 			SetNeedsLayout ();
 		}
 		}
 
 
+		/// <summary>
+		/// Removes the view from the scrollview.
+		/// </summary>
+		/// <param name="view">The view to remove from the scrollview.</param>
+		public override void Remove (View view)
+		{
+			if (view == null) {
+				return;
+			}
+
+			SetNeedsDisplay ();
+			var container = view?.SuperView;
+			if (container == this) {
+				base.Remove (view);
+			} else {
+				container?.Remove (view);
+			}
+
+			if (contentView.InternalSubviews.Count < 1) {
+				this.CanFocus = false;
+			}
+		}
+
+		/// <summary>
+		///   Removes all widgets from this container.
+		/// </summary>
+		/// <remarks>
+		/// </remarks>
+		public override void RemoveAll ()
+		{
+			contentView.RemoveAll ();
+		}
+
 		void View_MouseLeave (MouseEventArgs e)
 		void View_MouseLeave (MouseEventArgs e)
 		{
 		{
 			if (Application.MouseGrabView != null && Application.MouseGrabView != vertical && Application.MouseGrabView != horizontal) {
 			if (Application.MouseGrabView != null && Application.MouseGrabView != vertical && Application.MouseGrabView != horizontal) {
@@ -280,16 +313,6 @@ namespace Terminal.Gui {
 			}
 			}
 		}
 		}
 
 
-		/// <summary>
-		///   Removes all widgets from this container.
-		/// </summary>
-		/// <remarks>
-		/// </remarks>
-		public override void RemoveAll ()
-		{
-			contentView.RemoveAll ();
-		}
-
 		/// <summary>
 		/// <summary>
 		/// Gets or sets the visibility for the vertical scroll indicator.
 		/// Gets or sets the visibility for the vertical scroll indicator.
 		/// </summary>
 		/// </summary>
@@ -349,7 +372,7 @@ namespace Terminal.Gui {
 				}
 				}
 			}
 			}
 
 
-			// Fill in the bottom left corner
+			// Fill in the bottom right corner
 			if (ShowVerticalScrollIndicator && ShowHorizontalScrollIndicator) {
 			if (ShowVerticalScrollIndicator && ShowHorizontalScrollIndicator) {
 				AddRune (Bounds.Width - 1, Bounds.Height - 1, ' ');
 				AddRune (Bounds.Width - 1, Bounds.Height - 1, ' ');
 			}
 			}

+ 18 - 8
Terminal.Gui/Views/StatusBar.cs

@@ -16,9 +16,9 @@ namespace Terminal.Gui {
 	/// Each <see cref="StatusItem"/> has a title, a shortcut (hotkey), and an <see cref="Action"/> that will be invoked when the 
 	/// Each <see cref="StatusItem"/> has a title, a shortcut (hotkey), and an <see cref="Action"/> that will be invoked when the 
 	/// <see cref="StatusItem.Shortcut"/> is pressed.
 	/// <see cref="StatusItem.Shortcut"/> is pressed.
 	/// The <see cref="StatusItem.Shortcut"/> will be a global hotkey for the application in the current context of the screen.
 	/// The <see cref="StatusItem.Shortcut"/> will be a global hotkey for the application in the current context of the screen.
-	/// The colour of the <see cref="StatusItem.Title"/> will be changed after each ~. 
+	/// The colour of the <see cref="StatusItem.Title"/> will be changed after each ~ (can be customized using <see cref="HotTextSpecifier"/>).
 	/// A <see cref="StatusItem.Title"/> set to `~F1~ Help` will render as *F1* using <see cref="ColorScheme.HotNormal"/> and
 	/// A <see cref="StatusItem.Title"/> set to `~F1~ Help` will render as *F1* using <see cref="ColorScheme.HotNormal"/> and
-	/// *Help* as <see cref="ColorScheme.HotNormal"/>.
+	/// *Help* as <see cref="ColorScheme.Normal"/>.
 	/// </summary>
 	/// </summary>
 	public class StatusItem {
 	public class StatusItem {
 		/// <summary>
 		/// <summary>
@@ -65,6 +65,15 @@ namespace Terminal.Gui {
 		/// <value>Function to determine if the action is can be executed or not.</value>
 		/// <value>Function to determine if the action is can be executed or not.</value>
 		public Func<bool> CanExecute { get; set; }
 		public Func<bool> CanExecute { get; set; }
 
 
+		/// <summary>
+		/// Gets or sets the rune that toggles the text color between <see cref="ColorScheme.Normal"/> and <see cref="ColorScheme.HotNormal"/>.
+		/// The default value is '~'.
+		/// Therefore, '~F1~ Help' will be rendered as 'F1' using <see cref="ColorScheme.HotNormal"/> and 'Help' using <see cref="ColorScheme.Normal"/>.
+		/// In order to use '~' as part of the title (e.g., to denote the home directory as a part of the current directory),
+		/// <see cref="HotTextSpecifier"/> should be changed to a different rune.
+		/// </summary>
+		public Rune HotTextSpecifier { get; set; } = '~';
+
 		/// <summary>
 		/// <summary>
 		/// Returns <see langword="true"/> if the status item is enabled. This method is a wrapper around <see cref="CanExecute"/>.
 		/// Returns <see langword="true"/> if the status item is enabled. This method is a wrapper around <see cref="CanExecute"/>.
 		/// </summary>
 		/// </summary>
@@ -157,9 +166,10 @@ namespace Terminal.Gui {
 			Driver.SetAttribute (scheme);
 			Driver.SetAttribute (scheme);
 			for (int i = 0; i < Items.Length; i++) {
 			for (int i = 0; i < Items.Length; i++) {
 				var title = Items [i].Title.ToString ();
 				var title = Items [i].Title.ToString ();
+				var hotTextSpecifier = Items [i].HotTextSpecifier;
 				Driver.SetAttribute (DetermineColorSchemeFor (Items [i]));
 				Driver.SetAttribute (DetermineColorSchemeFor (Items [i]));
 				for (int n = 0; n < Items [i].Title.RuneCount; n++) {
 				for (int n = 0; n < Items [i].Title.RuneCount; n++) {
-					if (title [n] == '~') {
+					if (title [n] == hotTextSpecifier) {
 						if (Items [i].IsEnabled ()) {
 						if (Items [i].IsEnabled ()) {
 							scheme = ToggleScheme (scheme);
 							scheme = ToggleScheme (scheme);
 						}
 						}
@@ -197,23 +207,23 @@ namespace Terminal.Gui {
 
 
 			int pos = 1;
 			int pos = 1;
 			for (int i = 0; i < Items.Length; i++) {
 			for (int i = 0; i < Items.Length; i++) {
-				if (me.X >= pos && me.X < pos + GetItemTitleLength (Items [i].Title)) {
+				if (me.X >= pos && me.X < pos + GetItemTitleLength (Items [i])) {
 					var item = Items [i];
 					var item = Items [i];
 					if (item.IsEnabled ()) {
 					if (item.IsEnabled ()) {
 						Run (item.Action);
 						Run (item.Action);
 					}
 					}
 					break;
 					break;
 				}
 				}
-				pos += GetItemTitleLength (Items [i].Title) + 3;
+				pos += GetItemTitleLength (Items [i]) + 3;
 			}
 			}
 			return true;
 			return true;
 		}
 		}
 
 
-		int GetItemTitleLength (ustring title)
+		int GetItemTitleLength (StatusItem item)
 		{
 		{
 			int len = 0;
 			int len = 0;
-			foreach (var ch in title) {
-				if (ch == '~')
+			foreach (var ch in item.Title) {
+				if (ch == item.HotTextSpecifier)
 					continue;
 					continue;
 				len++;
 				len++;
 			}
 			}

+ 6 - 3
Terminal.Gui/Views/TextView.cs

@@ -1441,8 +1441,10 @@ namespace Terminal.Gui {
 		{
 		{
 			Autocomplete.HostControl = this;
 			Autocomplete.HostControl = this;
 
 
-			Application.Top.AlternateForwardKeyChanged += Top_AlternateForwardKeyChanged;
-			Application.Top.AlternateBackwardKeyChanged += Top_AlternateBackwardKeyChanged;
+			if (Application.Top != null) {
+				Application.Top.AlternateForwardKeyChanged += Top_AlternateForwardKeyChanged;
+				Application.Top.AlternateBackwardKeyChanged += Top_AlternateBackwardKeyChanged;
+			}
 			OnContentsChanged ();
 			OnContentsChanged ();
 		}
 		}
 
 
@@ -2342,6 +2344,8 @@ namespace Terminal.Gui {
 				selectionStartRow = nStartRow;
 				selectionStartRow = nStartRow;
 				selectionStartColumn = nStartCol;
 				selectionStartColumn = nStartCol;
 				wrapNeeded = true;
 				wrapNeeded = true;
+
+				SetNeedsDisplay ();
 			}
 			}
 			if (currentCaller != null)
 			if (currentCaller != null)
 				throw new InvalidOperationException ($"WordWrap settings was changed after the {currentCaller} call.");
 				throw new InvalidOperationException ($"WordWrap settings was changed after the {currentCaller} call.");
@@ -2529,7 +2533,6 @@ namespace Terminal.Gui {
 			if (!wrapNeeded) {
 			if (!wrapNeeded) {
 				SetNeedsDisplay (new Rect (0, prow, Math.Max (Frame.Width, 0), Math.Max (prow + 1, 0)));
 				SetNeedsDisplay (new Rect (0, prow, Math.Max (Frame.Width, 0), Math.Max (prow + 1, 0)));
 			}
 			}
-
 		}
 		}
 
 
 		ustring StringFromRunes (List<Rune> runes)
 		ustring StringFromRunes (List<Rune> runes)

+ 5 - 1
Terminal.Gui/Windows/Wizard.cs

@@ -316,7 +316,11 @@ namespace Terminal.Gui {
 
 
 				SetNeedsDisplay ();
 				SetNeedsDisplay ();
 				var touched = view.Frame;
 				var touched = view.Frame;
-				contentView.Remove (view);
+				if (view == contentView || view.GetType().Name == "ContentView") {
+					base.Remove (view);
+				} else {
+					contentView.Remove (view);
+				}
 
 
 				if (contentView.InternalSubviews.Count < 1)
 				if (contentView.InternalSubviews.Count < 1)
 					this.CanFocus = false;
 					this.CanFocus = false;

+ 2 - 1
Terminal.sln

@@ -15,6 +15,7 @@ EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E143FB1F-0B88-48CB-9086-72CDCECFCD22}"
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E143FB1F-0B88-48CB-9086-72CDCECFCD22}"
 	ProjectSection(SolutionItems) = preProject
 	ProjectSection(SolutionItems) = preProject
 		.gitignore = .gitignore
 		.gitignore = .gitignore
+		.github\workflows\api-docs.yml = .github\workflows\api-docs.yml
 		.github\CODEOWNERS = .github\CODEOWNERS
 		.github\CODEOWNERS = .github\CODEOWNERS
 		CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
 		CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
 		CONTRIBUTING.md = CONTRIBUTING.md
 		CONTRIBUTING.md = CONTRIBUTING.md
@@ -24,8 +25,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
 		nuget.config = nuget.config
 		nuget.config = nuget.config
 		.github\workflows\publish.yml = .github\workflows\publish.yml
 		.github\workflows\publish.yml = .github\workflows\publish.yml
 		README.md = README.md
 		README.md = README.md
-		testenvironments.json = testenvironments.json
 		Showcase.md = Showcase.md
 		Showcase.md = Showcase.md
+		testenvironments.json = testenvironments.json
 	EndProjectSection
 	EndProjectSection
 EndProject
 EndProject
 Global
 Global

+ 2 - 1
UICatalog/Scenarios/Editor.cs

@@ -166,7 +166,8 @@ namespace UICatalog.Scenarios {
 				_scrollBar.Size = _textView.Lines;
 				_scrollBar.Size = _textView.Lines;
 				_scrollBar.Position = _textView.TopRow;
 				_scrollBar.Position = _textView.TopRow;
 				if (_scrollBar.OtherScrollBarView != null) {
 				if (_scrollBar.OtherScrollBarView != null) {
-					_scrollBar.OtherScrollBarView.Size = _textView.Maxlength;
+					// + 1 is needed to show the cursor at the end of a line.
+					_scrollBar.OtherScrollBarView.Size = _textView.Maxlength + 1;
 					_scrollBar.OtherScrollBarView.Position = _textView.LeftColumn;
 					_scrollBar.OtherScrollBarView.Position = _textView.LeftColumn;
 				}
 				}
 				_scrollBar.LayoutSubviews ();
 				_scrollBar.LayoutSubviews ();

+ 101 - 0
UICatalog/Scenarios/MainLoopTimeouts.cs

@@ -0,0 +1,101 @@
+#pragma warning disable format
+
+#pragma warning restore format
+using System;
+using System.Collections.Generic;
+using Terminal.Gui;
+
+namespace UICatalog.Scenarios {
+	[ScenarioMetadata (Name: "MainLoopTimeouts", Description: "MainLoop Timeouts")]
+	[ScenarioCategory ("Tests")]
+	public class MainLoopTimeouts : Scenario {
+		static readonly List<string> GlobalList = new () { "1" };
+		static readonly ListView GlobalListView = new () { Width = Dim.Fill (), Height = Dim.Fill () };
+
+		static Label CounterLabel;
+		static Label BlinkingLabel;
+
+		static int Counter = 0;
+
+		static object _listToken = null;
+		static object _blinkToken = null;
+		static object _countToken = null;
+
+		public override void Init (ColorScheme colorScheme)
+		{
+			Application.Init ();
+
+			var startButton = new Button ("Start");
+			var stopButton = new Button ("Stop") { Y = 1 };
+			var container = new View () { X = Pos.Center (), Y = Pos.Center (), Width = 8, Height = 8, ColorScheme = Colors.Error };
+
+			CounterLabel = new Label ("0") { X = Pos.X (container), Y = Pos.Y (container) - 2 };
+			BlinkingLabel = new Label ("Blink") { X = Pos.X (container), Y = Pos.Bottom (container) + 1 };
+
+			startButton.Clicked += Start;
+			stopButton.Clicked += Stop;
+
+			GlobalListView.SetSource (GlobalList);
+			container.Add (GlobalListView);
+
+			Application.Top.Add (container, CounterLabel, BlinkingLabel);
+			Application.Top.Add (startButton, stopButton);
+			Application.Run ();
+			Application.Shutdown ();
+		}
+
+		public override void Run ()
+		{
+		}
+
+		private static void Start ()
+		{
+			_listToken = Application.MainLoop.AddTimeout (TimeSpan.FromMilliseconds (100), Add);
+			_blinkToken = Application.MainLoop.AddTimeout (TimeSpan.FromMilliseconds (1000), Blink);
+			_countToken = Application.MainLoop.AddTimeout (TimeSpan.FromMilliseconds (1000), Count);
+		}
+
+		private static void Stop ()
+		{
+			Application.MainLoop.RemoveTimeout (_listToken);
+			Application.MainLoop.RemoveTimeout (_blinkToken);
+			Application.MainLoop.RemoveTimeout (_countToken);
+		}
+
+		private static bool Add (MainLoop mainLoop)
+		{
+			Application.MainLoop.Invoke (() => {
+				GlobalList.Add (new Random ().Next (100).ToString ());
+				GlobalListView.MoveDown ();
+			});
+
+			return true;
+		}
+
+		private static bool Blink (MainLoop mainLoop)
+		{
+			Application.MainLoop.Invoke (() => {
+				if (BlinkingLabel.Visible) {
+					BlinkingLabel.Visible = false;
+					System.Diagnostics.Debug.WriteLine (BlinkingLabel.Visible);
+				} else {
+					BlinkingLabel.Visible = true;
+					System.Diagnostics.Debug.WriteLine (BlinkingLabel.Visible);
+				}
+
+			});
+
+			return true;
+		}
+
+		private static bool Count (MainLoop mainLoop)
+		{
+			Application.MainLoop.Invoke (() => {
+				Counter++;
+				CounterLabel.Text = Counter.ToString ();
+			});
+
+			return true;
+		}
+	}
+}

+ 1 - 1
UICatalog/Scenarios/SingleBackgroundWorker.cs

@@ -15,7 +15,7 @@ namespace UICatalog.Scenarios {
 
 
 			Application.Run<MainApp> ();
 			Application.Run<MainApp> ();
 
 
-			Application.Top.Dispose ();
+			System.Diagnostics.Debug.Assert (Application.Top == null);
 		}
 		}
 
 
 		public class MainApp : Toplevel {
 		public class MainApp : Toplevel {

+ 30 - 30
UICatalog/UICatalog.csproj

@@ -1,31 +1,31 @@
-<Project Sdk="Microsoft.NET.Sdk">
-  <PropertyGroup>
-    <OutputType>Exe</OutputType>
-    <TargetFramework>net7.0</TargetFramework>
-    <LangVersion>9.0</LangVersion>
-    <StartupObject>UICatalog.UICatalogApp</StartupObject>
-    <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
-    <!-- Version numbers are automatically updated by gitversion when a release is released -->
-    <!-- Do not modify these. -->
-    <FileVersion>1.0.0.0</FileVersion>
-    <Version>1.0.0</Version>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
-    <DefineConstants>TRACE</DefineConstants>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
-    <DefineConstants>TRACE;DEBUG_IDISPOSABLE</DefineConstants>
-  </PropertyGroup>
-  <ItemGroup>
-    <None Update="./Scenarios/Spinning_globe_dark_small.gif" CopyToOutputDirectory="PreserveNewest" />
-  </ItemGroup>
-  <ItemGroup>
-    <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
-    <PackageReference Include="SixLabors.ImageSharp" Version="3.0.2" />
-    <PackageReference Include="CsvHelper" Version="30.0.1" />
-    <PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="3.1.6" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\Terminal.Gui\Terminal.Gui.csproj" />
-  </ItemGroup>
+<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+    <TargetFramework>net7.0</TargetFramework>
+    <LangVersion>9.0</LangVersion>
+    <StartupObject>UICatalog.UICatalogApp</StartupObject>
+    <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
+    <!-- Version numbers are automatically updated by gitversion when a release is released -->
+    <!-- Do not modify these. -->
+    <FileVersion>1.0.0.0</FileVersion>
+    <Version>1.0.0</Version>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
+    <DefineConstants>TRACE</DefineConstants>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
+    <DefineConstants>TRACE;DEBUG_IDISPOSABLE</DefineConstants>
+  </PropertyGroup>
+  <ItemGroup>
+    <None Update="./Scenarios/Spinning_globe_dark_small.gif" CopyToOutputDirectory="PreserveNewest" />
+  </ItemGroup>
+  <ItemGroup>
+    <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" />
+    <PackageReference Include="SixLabors.ImageSharp" Version="3.1.2" />
+    <PackageReference Include="CsvHelper" Version="30.0.1" />
+    <PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="3.1.6" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\Terminal.Gui\Terminal.Gui.csproj" />
+  </ItemGroup>
 </Project>
 </Project>

+ 63 - 6
UnitTests/Application/ApplicationTests.cs

@@ -159,13 +159,12 @@ namespace Terminal.Gui.ApplicationTests {
 			Application.End (runstate);
 			Application.End (runstate);
 
 
 			Assert.Null (Application.Current);
 			Assert.Null (Application.Current);
-			Assert.NotNull (Application.Top);
+			Assert.Null (Application.Top);
 			Assert.NotNull (Application.MainLoop);
 			Assert.NotNull (Application.MainLoop);
 			Assert.NotNull (Application.Driver);
 			Assert.NotNull (Application.Driver);
 
 
 			Shutdown ();
 			Shutdown ();
 
 
-			Assert.Null (Application.Top);
 			Assert.Null (Application.MainLoop);
 			Assert.Null (Application.MainLoop);
 			Assert.Null (Application.Driver);
 			Assert.Null (Application.Driver);
 		}
 		}
@@ -203,13 +202,12 @@ namespace Terminal.Gui.ApplicationTests {
 			Application.End (runstate);
 			Application.End (runstate);
 
 
 			Assert.Null (Application.Current);
 			Assert.Null (Application.Current);
-			Assert.NotNull (Application.Top);
+			Assert.Null (Application.Top);
 			Assert.NotNull (Application.MainLoop);
 			Assert.NotNull (Application.MainLoop);
 			Assert.NotNull (Application.Driver);
 			Assert.NotNull (Application.Driver);
 
 
 			Shutdown ();
 			Shutdown ();
 
 
-			Assert.Null (Application.Top);
 			Assert.Null (Application.MainLoop);
 			Assert.Null (Application.MainLoop);
 			Assert.Null (Application.Driver);
 			Assert.Null (Application.Driver);
 		}
 		}
@@ -529,7 +527,10 @@ namespace Terminal.Gui.ApplicationTests {
 
 
 			Application.Run (t1);
 			Application.Run (t1);
 
 
-			Assert.Equal (t1, Application.Top);
+			Assert.Null (Application.Top);
+#if DEBUG_IDISPOSABLE
+			Assert.True (t1.WasDisposed);
+#endif
 		}
 		}
 
 
 		[Fact]
 		[Fact]
@@ -941,16 +942,20 @@ namespace Terminal.Gui.ApplicationTests {
 		}
 		}
 
 
 		[Fact, AutoInitShutdown]
 		[Fact, AutoInitShutdown]
-		public void MouseGrabView_GrabbedMouse_UnGrabbedMouse ()
+		public void MouseGrabView_GrabbedMouse_UnGrabbedMouse_GrabbingMouse_UnGrabbingMouse ()
 		{
 		{
 			View grabView = null;
 			View grabView = null;
 			var count = 0;
 			var count = 0;
+			var wasGrabbingMouse = false;
+			var wasUnGrabbingMouse = false;
 
 
 			var view1 = new View ();
 			var view1 = new View ();
 			var view2 = new View ();
 			var view2 = new View ();
 
 
 			Application.GrabbedMouse += Application_GrabbedMouse;
 			Application.GrabbedMouse += Application_GrabbedMouse;
 			Application.UnGrabbedMouse += Application_UnGrabbedMouse;
 			Application.UnGrabbedMouse += Application_UnGrabbedMouse;
+			Application.GrabbingMouse += Application_GrabbingMouse;
+			Application.UnGrabbingMouse += Application_UnGrabbingMouse;
 
 
 			Application.GrabMouse (view1);
 			Application.GrabMouse (view1);
 			Assert.Equal (0, count);
 			Assert.Equal (0, count);
@@ -964,16 +969,20 @@ namespace Terminal.Gui.ApplicationTests {
 
 
 			Application.GrabbedMouse += Application_GrabbedMouse;
 			Application.GrabbedMouse += Application_GrabbedMouse;
 			Application.UnGrabbedMouse += Application_UnGrabbedMouse;
 			Application.UnGrabbedMouse += Application_UnGrabbedMouse;
+			Application.GrabbingMouse += Application_GrabbingMouse;
+			Application.UnGrabbingMouse += Application_UnGrabbingMouse;
 
 
 			Application.GrabMouse (view2);
 			Application.GrabMouse (view2);
 			Assert.Equal (1, count);
 			Assert.Equal (1, count);
 			Assert.Equal (grabView, view2);
 			Assert.Equal (grabView, view2);
 			Assert.Equal (view2, Application.MouseGrabView);
 			Assert.Equal (view2, Application.MouseGrabView);
+			Assert.True (wasGrabbingMouse);
 
 
 			Application.UngrabMouse ();
 			Application.UngrabMouse ();
 			Assert.Equal (2, count);
 			Assert.Equal (2, count);
 			Assert.Equal (grabView, view2);
 			Assert.Equal (grabView, view2);
 			Assert.Null (Application.MouseGrabView);
 			Assert.Null (Application.MouseGrabView);
+			Assert.True (wasUnGrabbingMouse);
 
 
 			void Application_GrabbedMouse (View obj)
 			void Application_GrabbedMouse (View obj)
 			{
 			{
@@ -1001,6 +1010,54 @@ namespace Terminal.Gui.ApplicationTests {
 
 
 				Application.UnGrabbedMouse -= Application_UnGrabbedMouse;
 				Application.UnGrabbedMouse -= Application_UnGrabbedMouse;
 			}
 			}
+
+			bool Application_GrabbingMouse (View obj)
+			{
+				if (count == 0) {
+					Assert.Equal (view1, obj);
+					grabView = view1;
+				} else {
+					Assert.Equal (view2, obj);
+					grabView = view2;
+				}
+				wasGrabbingMouse = true;
+
+				Application.GrabbingMouse -= Application_GrabbingMouse;
+
+				return false;
+			}
+
+			bool Application_UnGrabbingMouse (View obj)
+			{
+				if (count == 0) {
+					Assert.Equal (view1, obj);
+					Assert.Equal (grabView, obj);
+				} else {
+					Assert.Equal (view2, obj);
+					Assert.Equal (grabView, obj);
+				}
+				wasUnGrabbingMouse = true;
+
+				Application.UnGrabbingMouse -= Application_UnGrabbingMouse;
+
+				return false;
+			}
+		}
+
+		[Fact, AutoInitShutdown]
+		public void GrabbingMouse_UnGrabbingMouse_Does_Not_Throws_If_Null ()
+		{
+			// This is needed to unsubscribe all the toplevel static events.
+			Application.Top.Dispose ();
+
+			var view = new View ();
+			var exception = Record.Exception (() => Application.GrabMouse (view));
+			Assert.Null (exception);
+
+			Assert.Equal (view, Application.MouseGrabView);
+
+			exception = Record.Exception (() => Application.UngrabMouse ());
+			Assert.Null (exception);
 		}
 		}
 		#endregion
 		#endregion
 	}
 	}

+ 46 - 8
UnitTests/Application/RunStateTests.cs

@@ -48,12 +48,11 @@ namespace Terminal.Gui.ApplicationTests {
 			rs = new Application.RunState (top);
 			rs = new Application.RunState (top);
 			Assert.NotNull (rs);
 			Assert.NotNull (rs);
 
 
-			// Should throw because Toplevel was not cleaned up
-			Assert.Throws<InvalidOperationException> (() => rs.Dispose ());
+			// Should not throw because Toplevel was cleaned up
+			var exception = Record.Exception (() => rs.Dispose ());
+			Assert.Null (exception);
 
 
-			rs.Toplevel.Dispose ();
-			rs.Toplevel = null;
-			rs.Dispose ();
+			Assert.Null (rs.Toplevel);
 #if DEBUG_IDISPOSABLE
 #if DEBUG_IDISPOSABLE
 			Assert.True (rs.WasDisposed);
 			Assert.True (rs.WasDisposed);
 			Assert.True (top.WasDisposed);
 			Assert.True (top.WasDisposed);
@@ -63,7 +62,7 @@ namespace Terminal.Gui.ApplicationTests {
 		void Init ()
 		void Init ()
 		{
 		{
 			Application.Init (new FakeDriver ());
 			Application.Init (new FakeDriver ());
-			
+
 			Assert.NotNull (Application.Driver);
 			Assert.NotNull (Application.Driver);
 			Assert.NotNull (Application.MainLoop);
 			Assert.NotNull (Application.MainLoop);
 			Assert.NotNull (SynchronizationContext.Current);
 			Assert.NotNull (SynchronizationContext.Current);
@@ -74,7 +73,7 @@ namespace Terminal.Gui.ApplicationTests {
 			Application.Shutdown ();
 			Application.Shutdown ();
 #if DEBUG_IDISPOSABLE
 #if DEBUG_IDISPOSABLE
 			// Validate there are no outstanding RunState-based instances left
 			// Validate there are no outstanding RunState-based instances left
-			foreach (var inst in Application.RunState.Instances) 				Assert.True (inst.WasDisposed);
+			foreach (var inst in Application.RunState.Instances) Assert.True (inst.WasDisposed);
 #endif
 #endif
 		}
 		}
 
 
@@ -94,7 +93,7 @@ namespace Terminal.Gui.ApplicationTests {
 			Application.End (rs);
 			Application.End (rs);
 
 
 			Assert.Null (Application.Current);
 			Assert.Null (Application.Current);
-			Assert.NotNull (Application.Top);
+			Assert.Null (Application.Top);
 			Assert.NotNull (Application.MainLoop);
 			Assert.NotNull (Application.MainLoop);
 			Assert.NotNull (Application.Driver);
 			Assert.NotNull (Application.Driver);
 
 
@@ -104,7 +103,46 @@ namespace Terminal.Gui.ApplicationTests {
 			Assert.True (rs.WasDisposed);
 			Assert.True (rs.WasDisposed);
 #endif
 #endif
 
 
+			Assert.Null (Application.MainLoop);
+			Assert.Null (Application.Driver);
+		}
+
+		WeakReference CreateToplevelInstance ()
+		{
+			// Setup Mock driver
+			Init ();
+
+			var top = new Toplevel ();
+			var rs = Application.Begin (top);
+
+			Assert.NotNull (rs);
+			Assert.Equal (top, Application.Current);
+			Assert.Equal (top, Application.Top);
+			Application.End (rs);
+#if DEBUG_IDISPOSABLE
+			Assert.True (rs.WasDisposed);
+			Assert.True (top.WasDisposed);
+#endif
+			Assert.Null (Application.Current);
 			Assert.Null (Application.Top);
 			Assert.Null (Application.Top);
+			Assert.NotNull (top);
+			Assert.NotNull (Application.MainLoop);
+			Assert.NotNull (Application.Driver);
+
+			return new WeakReference (top, true);
+		}
+
+		[Fact]
+		public void Begin_End_Cleans_Up_RunState_Without_Shutdown ()
+		{
+			WeakReference wrInstance = CreateToplevelInstance ();
+
+			GC.Collect ();
+			GC.WaitForPendingFinalizers ();
+			Assert.False (wrInstance.IsAlive);
+
+			// Shutdown Mock driver
+			Shutdown ();
 			Assert.Null (Application.MainLoop);
 			Assert.Null (Application.MainLoop);
 			Assert.Null (Application.Driver);
 			Assert.Null (Application.Driver);
 		}
 		}

+ 4 - 2
UnitTests/Menus/ContextMenuTests.cs

@@ -385,6 +385,8 @@ namespace Terminal.Gui.MenuTests {
 		[Fact, AutoInitShutdown]
 		[Fact, AutoInitShutdown]
 		public void Show_Display_At_Zero_If_The_Toplevel_Width_Is_Less_Than_The_Menu_Width ()
 		public void Show_Display_At_Zero_If_The_Toplevel_Width_Is_Less_Than_The_Menu_Width ()
 		{
 		{
+			((FakeDriver)Application.Driver).SetBufferSize (5, 25);
+
 			var cm = new ContextMenu (0, 0,
 			var cm = new ContextMenu (0, 0,
 				new MenuBarItem (new MenuItem [] {
 				new MenuBarItem (new MenuItem [] {
 					new MenuItem ("One", "", null),
 					new MenuItem ("One", "", null),
@@ -397,7 +399,6 @@ namespace Terminal.Gui.MenuTests {
 			cm.Show ();
 			cm.Show ();
 			Assert.Equal (new Point (0, 0), cm.Position);
 			Assert.Equal (new Point (0, 0), cm.Position);
 			Application.Begin (Application.Top);
 			Application.Begin (Application.Top);
-			((FakeDriver)Application.Driver).SetBufferSize (5, 25);
 
 
 			var expected = @"
 			var expected = @"
 ┌────
 ┌────
@@ -416,6 +417,8 @@ namespace Terminal.Gui.MenuTests {
 		[Fact, AutoInitShutdown]
 		[Fact, AutoInitShutdown]
 		public void Show_Display_At_Zero_If_The_Toplevel_Height_Is_Less_Than_The_Menu_Height ()
 		public void Show_Display_At_Zero_If_The_Toplevel_Height_Is_Less_Than_The_Menu_Height ()
 		{
 		{
+			((FakeDriver)Application.Driver).SetBufferSize (80, 3);
+
 			var cm = new ContextMenu (0, 0,
 			var cm = new ContextMenu (0, 0,
 				new MenuBarItem (new MenuItem [] {
 				new MenuBarItem (new MenuItem [] {
 					new MenuItem ("One", "", null),
 					new MenuItem ("One", "", null),
@@ -428,7 +431,6 @@ namespace Terminal.Gui.MenuTests {
 			cm.Show ();
 			cm.Show ();
 			Assert.Equal (new Point (0, 0), cm.Position);
 			Assert.Equal (new Point (0, 0), cm.Position);
 			Application.Begin (Application.Top);
 			Application.Begin (Application.Top);
-			((FakeDriver)Application.Driver).SetBufferSize (80, 3);
 
 
 			var expected = @"
 			var expected = @"
 ┌──────┐
 ┌──────┐

+ 15 - 0
UnitTests/Menus/MenuTests.cs

@@ -1809,5 +1809,20 @@ Edit
 			Assert.True (menu.ProcessHotKey (new KeyEvent (menu.Key, new KeyModifiers ())));
 			Assert.True (menu.ProcessHotKey (new KeyEvent (menu.Key, new KeyModifiers ())));
 			Assert.False (menu.IsMenuOpen);
 			Assert.False (menu.IsMenuOpen);
 		}
 		}
+
+		[Fact]
+		public void Separators_Does_Not_Throws_Pressing_Menu_Shortcut ()
+		{
+			var menu = new MenuBar (new MenuBarItem [] {
+				new MenuBarItem ("File", new MenuItem [] {
+					new MenuItem ("_New", "", null),
+					null,
+					new MenuItem ("_Quit", "", null)
+				})
+			});
+
+			var exception = Record.Exception (() => Assert.True (menu.ProcessHotKey (new KeyEvent (Key.AltMask | Key.Q, new KeyModifiers () { Alt = true }))));
+			Assert.Null (exception);
+		}
 	}
 	}
 }
 }

+ 43 - 0
UnitTests/TopLevels/MdiTests.cs

@@ -692,5 +692,48 @@ namespace Terminal.Gui.TopLevelTests {
 
 
 			Assert.Empty (Application.MdiChildes);
 			Assert.Empty (Application.MdiChildes);
 		}
 		}
+
+		[Fact, AutoInitShutdown]
+		public void MdiChild_Set_Visible_False_Does_Not_Process_Keys ()
+		{
+			var count = 0;
+			var mdi = new Mdi ();
+			var button = new Button ();
+			button.Clicked += () => count++;
+			var child = new Window ();
+			child.Add (button);
+			var iterations = -1;
+			Application.Iteration += () => {
+				iterations++;
+				if (iterations == 0) {
+					Application.Run (child);
+				} else if (iterations == 1) {
+					Assert.Equal (child, Application.Current);
+					ReflectionTools.InvokePrivate (
+						typeof (Application),
+						"ProcessKeyEvent",
+						new KeyEvent (Key.Enter, new KeyModifiers ()));
+				} else if (iterations == 2) {
+					Assert.Equal (child, Application.Current);
+					Assert.True (child.Visible);
+					child.Visible = false;
+				} else if (iterations == 3) {
+					Assert.Equal (mdi, Application.Current);
+					ReflectionTools.InvokePrivate (
+						typeof (Application),
+						"ProcessKeyEvent",
+						new KeyEvent (Key.Enter, new KeyModifiers ()));
+				} else if (iterations == 4) {
+					ReflectionTools.InvokePrivate (
+						typeof (Application),
+						"ProcessKeyEvent",
+						new KeyEvent (Application.QuitKey, new KeyModifiers ()));
+				}
+			};
+			Application.Run (mdi);
+			Assert.Equal (4, iterations);
+			Assert.Equal (1, count);
+		}
+
 	}
 	}
 }
 }

+ 45 - 0
UnitTests/TopLevels/WindowTests.cs

@@ -363,5 +363,50 @@ namespace Terminal.Gui.TopLevelTests {
 │                  │
 │                  │
 └──────────────────┘", output);
 └──────────────────┘", output);
 		}
 		}
+
+		[Fact, AutoInitShutdown]
+		public void Window_On_Non_Toplevel_Superview_Cannot_Overflows_His_Bounds ()
+		{
+			var win = new Window () { Width = Dim.Fill (5), Height = Dim.Fill (5) };
+			var view = new View () { X = 3, Y = 3, Width = 10, Height = 10 };
+			view.Add (win);
+			Application.Top.Add (view);
+			Application.Begin (Application.Top);
+
+			ReflectionTools.InvokePrivate (
+				typeof (Application),
+				"ProcessMouseEvent",
+				new MouseEvent () {
+					X = 3,
+					Y = 3,
+					Flags = MouseFlags.Button1Pressed
+				});
+
+			Assert.Equal (win, Application.MouseGrabView);
+
+			ReflectionTools.InvokePrivate (
+				typeof (Application),
+				"ProcessMouseEvent",
+				new MouseEvent () {
+					X = 2,
+					Y = 2,
+					Flags = MouseFlags.Button1Pressed | MouseFlags.ReportMousePosition
+				});
+
+			Assert.Equal (win, Application.MouseGrabView);
+			Assert.Equal (new Rect (0, 0, 5, 5), win.Frame);
+
+			ReflectionTools.InvokePrivate (
+				typeof (Application),
+				"ProcessMouseEvent",
+				new MouseEvent () {
+					X = 14,
+					Y = 14,
+					Flags = MouseFlags.Button1Pressed | MouseFlags.ReportMousePosition
+				});
+
+			Assert.Equal (win, Application.MouseGrabView);
+			Assert.Equal (new Rect (4, 4, 5, 5), win.Frame);
+		}
 	}
 	}
 }
 }

+ 6 - 4
UnitTests/UnitTests.csproj

@@ -18,11 +18,11 @@
     <DefineConstants>TRACE;DEBUG_IDISPOSABLE</DefineConstants>
     <DefineConstants>TRACE;DEBUG_IDISPOSABLE</DefineConstants>
   </PropertyGroup>
   </PropertyGroup>
   <ItemGroup>
   <ItemGroup>
-    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
-    <PackageReference Include="ReportGenerator" Version="5.1.24" />
+    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
+    <PackageReference Include="ReportGenerator" Version="5.2.0" />
     <PackageReference Include="System.Collections" Version="4.3.0" />
     <PackageReference Include="System.Collections" Version="4.3.0" />
-    <PackageReference Include="xunit" Version="2.5.3" />
-    <PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
+    <PackageReference Include="xunit" Version="2.6.6" />
+    <PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
       <PrivateAssets>all</PrivateAssets>
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>
     </PackageReference>
@@ -58,5 +58,7 @@
     <IncludeTestAssembly>
     <IncludeTestAssembly>
       False
       False
     </IncludeTestAssembly>
     </IncludeTestAssembly>
+    <SignAssembly>True</SignAssembly>
+    <AssemblyOriginatorKeyFile>UnitTests.snk</AssemblyOriginatorKeyFile>
   </PropertyGroup>
   </PropertyGroup>
 </Project>
 </Project>

BIN
UnitTests/UnitTests.snk


+ 23 - 6
UnitTests/Views/ButtonTests.cs

@@ -16,8 +16,9 @@ namespace Terminal.Gui.ViewTests {
 		{
 		{
 			var btn = new Button ();
 			var btn = new Button ();
 			Assert.Equal (string.Empty, btn.Text);
 			Assert.Equal (string.Empty, btn.Text);
-			Application.Top.Add (btn);
-			var rs = Application.Begin (Application.Top);
+			var top = Application.Top;
+			top.Add (btn);
+			var rs = Application.Begin (top);
 
 
 			Assert.Equal ("[  ]", btn.TextFormatter.Text);
 			Assert.Equal ("[  ]", btn.TextFormatter.Text);
 			Assert.False (btn.IsDefault);
 			Assert.False (btn.IsDefault);
@@ -34,8 +35,8 @@ namespace Terminal.Gui.ViewTests {
 			Application.End (rs);
 			Application.End (rs);
 			btn = new Button ("ARGS", true) { Text = "Test" };
 			btn = new Button ("ARGS", true) { Text = "Test" };
 			Assert.Equal ("Test", btn.Text);
 			Assert.Equal ("Test", btn.Text);
-			Application.Top.Add (btn);
-			rs = Application.Begin (Application.Top);
+			top.Add (btn);
+			rs = Application.Begin (top);
 
 
 			Assert.Equal ("[◦ Test ◦]", btn.TextFormatter.Text);
 			Assert.Equal ("[◦ Test ◦]", btn.TextFormatter.Text);
 			Assert.True (btn.IsDefault);
 			Assert.True (btn.IsDefault);
@@ -52,8 +53,8 @@ namespace Terminal.Gui.ViewTests {
 			Application.End (rs);
 			Application.End (rs);
 			btn = new Button (3, 4, "Test", true);
 			btn = new Button (3, 4, "Test", true);
 			Assert.Equal ("Test", btn.Text);
 			Assert.Equal ("Test", btn.Text);
-			Application.Top.Add (btn);
-			rs = Application.Begin (Application.Top);
+			top.Add (btn);
+			rs = Application.Begin (top);
 
 
 			Assert.Equal ("[◦ Test ◦]", btn.TextFormatter.Text);
 			Assert.Equal ("[◦ Test ◦]", btn.TextFormatter.Text);
 			Assert.True (btn.IsDefault);
 			Assert.True (btn.IsDefault);
@@ -584,5 +585,21 @@ namespace Terminal.Gui.ViewTests {
 
 
 			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 			TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
 		}
 		}
+
+		[Fact, AutoInitShutdown]
+		public void IsDefault_True_Does_Not_Get_The_Focus_On_Enter_Key ()
+		{
+			var wasClicked = false;
+			var view = new View { CanFocus = true };
+			var btn = new Button { Text = "Ok", IsDefault = true };
+			btn.Clicked += () => wasClicked = true;
+			Application.Top.Add (view, btn);
+			Application.Begin (Application.Top);
+			Assert.True (view.HasFocus);
+
+			Application.Top.ProcessColdKey (new KeyEvent (Key.Enter, new KeyModifiers ()));
+			Assert.True (view.HasFocus);
+			Assert.True (wasClicked);
+		}
 	}
 	}
 }
 }

+ 32 - 0
UnitTests/Views/ListViewTests.cs

@@ -513,5 +513,37 @@ Item 4
 Item 5
 Item 5
 Item 6", output);
 Item 6", output);
 		}
 		}
+
+		[Fact, AutoInitShutdown]
+		public void LeftItem_TopItem_Tests ()
+		{
+			var source = new List<string> ();
+			for (int i = 0; i < 5; i++) {
+				source.Add ($"Item {i}");
+			}
+			var lv = new ListView (source) {
+				X = 1,
+				Width = 10,
+				Height = 5
+			};
+			Application.Top.Add (lv);
+			Application.Begin (Application.Top);
+
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
+ Item 0
+ Item 1
+ Item 2
+ Item 3
+ Item 4", output);
+
+			lv.LeftItem = 1;
+			lv.TopItem = 1;
+			Application.Refresh ();
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
+ tem 1
+ tem 2
+ tem 3
+ tem 4", output);
+		}
 	}
 	}
 }
 }

+ 23 - 0
UnitTests/Views/ScrollViewTests.cs

@@ -498,5 +498,28 @@ namespace Terminal.Gui.ViewTests {
 00000000000000000000000
 00000000000000000000000
 00000000000000000000000", attributes);
 00000000000000000000000", attributes);
 		}
 		}
+
+		[Fact, AutoInitShutdown]
+		public void Remove_Added_View_Is_Allowed ()
+		{
+			var sv = new ScrollView () {
+				Width = 20,
+				Height = 20,
+				ContentSize = new Size (100, 100)
+			};
+			sv.Add (new View () { Width = Dim.Fill (), Height = Dim.Fill (50), Id = "View1" },
+				new View () { Y = 51, Width = Dim.Fill (), Height = Dim.Fill (), Id = "View2" });
+
+			Application.Top.Add (sv);
+			Application.Begin (Application.Top);
+
+			Assert.Equal (3, sv.Subviews.Count);
+			Assert.Equal (2, sv.Subviews [0].Subviews.Count);
+
+			sv.Remove (sv.Subviews [0].Subviews [1]);
+			Assert.Equal (3, sv.Subviews.Count);
+			Assert.Single (sv.Subviews [0].Subviews);
+			Assert.Equal ("View1", sv.Subviews [0].Subviews [0].Id);
+		}
 	}
 	}
 }
 }

+ 19 - 0
UnitTests/Views/StatusBarTests.cs

@@ -128,6 +128,25 @@ CTRL-O Open {Application.Driver.VLine} CTRL-Q Quit
 			TestHelpers.AssertDriverContentsAre (expected, output);
 			TestHelpers.AssertDriverContentsAre (expected, output);
 		}
 		}
 
 
+		[Fact]
+		[AutoInitShutdown]
+		public void Redraw_Output_Custom_HotTextSpecifier ()
+		{
+			var sb = new StatusBar (new StatusItem [] {
+				new StatusItem (Key.CtrlMask | Key.T, "~CTRL-T~ _Text_", null),
+				new StatusItem (Key.CtrlMask | Key.O, "_CTRL-O_ ~/Work", null) { HotTextSpecifier = '_' },
+			});
+			Application.Top.Add (sb);
+
+			sb.Redraw (sb.Bounds);
+
+			string expected = @$"
+CTRL-T _Text_ {Application.Driver.VLine} CTRL-O ~/Work
+";
+
+			TestHelpers.AssertDriverContentsAre (expected, output);
+		}
+
 		[Fact]
 		[Fact]
 		public void AddItemAt_RemoveItem_Replacing ()
 		public void AddItemAt_RemoveItem_Replacing ()
 		{
 		{

+ 31 - 0
UnitTests/Views/TextViewTests.cs

@@ -6857,5 +6857,36 @@ TAB to jump between text field", output);
  to jump between text fields.
  to jump between text fields.
  to jump between text fields.", output);
  to jump between text fields.", output);
 		}
 		}
+
+		[Theory]
+		[TextViewTestsAutoInitShutdown]
+		[InlineData (Key.Delete)]
+		[InlineData (Key.DeleteChar)]
+		public void WordWrap_Draw_Typed_Keys_After_Text_Is_Deleted (Key del)
+		{
+			Application.Top.Add (_textView);
+			_textView.Text = "Line 1.\nLine 2.";
+			_textView.WordWrap = true;
+			Application.Begin (Application.Top);
+
+			Assert.True (_textView.WordWrap);
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
+Line 1.
+Line 2.", output);
+
+			Assert.True (_textView.ProcessKey (new KeyEvent (Key.End | Key.ShiftMask, new KeyModifiers () { Shift = true })));
+			Assert.Equal ("Line 1.", _textView.SelectedText);
+
+			Assert.True (_textView.ProcessKey (new KeyEvent (del, new KeyModifiers ())));
+			Application.Refresh ();
+			TestHelpers.AssertDriverContentsWithFrameAre ("Line 2.", output);
+
+			Assert.True (_textView.ProcessKey (new KeyEvent (Key.H, new KeyModifiers ())));
+			Assert.NotEqual (Rect.Empty, _textView.NeedDisplay);
+			Application.Refresh ();
+			TestHelpers.AssertDriverContentsWithFrameAre (@"
+H      
+Line 2.", output);
+		}
 	}
 	}
 }
 }

+ 51 - 13
UnitTests/Views/ViewDisposalTest.cs

@@ -1,3 +1,4 @@
+using SixLabors.ImageSharp.Processing.Processors.Quantization;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.Linq;
 using System.Linq;
@@ -23,21 +24,38 @@ namespace UnitTests.ViewsTests {
 			}
 			}
 		}
 		}
 
 
-		[Fact]
-		[AutoInitShutdown]
-		public void TestViewsDisposeCorrectly ()
+		[Theory]
+		[InlineData (true)]
+		[InlineData (false)]
+		public void TestViewsDisposeCorrectly (bool callShutdown)
 		{
 		{
-			var reference = DoTest ();
-			for (var i = 0; i < 10 && reference.IsAlive; i++) {
+			var refs = DoTest (callShutdown);
+			//var reference = refs [0];
+			for (var i = 0; i < 10 && refs [0].IsAlive; i++) {
 				GC.Collect ();
 				GC.Collect ();
 				GC.WaitForPendingFinalizers ();
 				GC.WaitForPendingFinalizers ();
 			}
 			}
+			foreach (var reference in refs) {
+				if (reference.IsAlive) {
 #if DEBUG_IDISPOSABLE
 #if DEBUG_IDISPOSABLE
-			if (reference.IsAlive) {
-				Assert.True (((View)reference.Target).WasDisposed);
-				Assert.Fail ($"Some Views didnt get Garbage Collected: {((View)reference.Target).Subviews}");
-			}
+					Assert.True (((View)reference.Target).WasDisposed);
 #endif
 #endif
+					string alive = "";						// Instead of just checking the subviews of the container, we now iterate through a list
+					foreach (var r in refs) {					// of Weakreferences Referencing every View that was tested. This makes more sense because 
+						if (r.IsAlive) {					// View.Dispose removes all of its subviews, wich is why View.Subviews is always empty 
+							if (r == refs [0]) {				// after View.Dispose has run. Luckily I didnt discover any more bugs or this wouldv'e
+								alive += "\n View (Container)";         // been a little bit annoying to find an answer for. Thanks to BDisp for listening to
+							}						// me and giving his best to help me fix this thing. If you take a look at the commit log
+							alive += ",\n--";				// you will find that he did most of the work. -a-usr
+							alive += r.Target.GetType ().Name;
+						}							// NOTE: DELETE BEFORE NEXT COMMIT
+					}
+					Assert.Fail ($"Some Views didnt get Garbage Collected: {alive}");
+				}
+			}
+			if (!callShutdown) {
+				Application.Shutdown ();
+			}
 		}
 		}
 
 
 		void getSpecialParams ()
 		void getSpecialParams ()
@@ -46,11 +64,16 @@ namespace UnitTests.ViewsTests {
 			//special_params.Add (typeof (LineView), new object [] { Orientation.Horizontal });
 			//special_params.Add (typeof (LineView), new object [] { Orientation.Horizontal });
 		}
 		}
 
 
-		WeakReference DoTest ()
+		List<WeakReference> DoTest (bool callShutdown)
 		{
 		{
+			var driver = new FakeDriver ();
+			Application.Init (driver, new FakeMainLoop (driver));
 			getSpecialParams ();
 			getSpecialParams ();
 			View Container = new View ();
 			View Container = new View ();
-			Toplevel top = Application.Top;
+			List<WeakReference> refs = new List<WeakReference> { new WeakReference (Container, true) };
+			Container.Add (new View ());
+			Toplevel top = new ();
+			var state = Application.Begin (top);
 			var views = GetViews ();
 			var views = GetViews ();
 			foreach (var view in views) {
 			foreach (var view in views) {
 				View instance;
 				View instance;
@@ -63,6 +86,8 @@ namespace UnitTests.ViewsTests {
 
 
 				Assert.NotNull (instance);
 				Assert.NotNull (instance);
 				Container.Add (instance);
 				Container.Add (instance);
+
+				refs.Add (new WeakReference (instance, true));
 				output.WriteLine ($"Added instance of {view}!");
 				output.WriteLine ($"Added instance of {view}!");
 			}
 			}
 			top.Add (Container);
 			top.Add (Container);
@@ -72,9 +97,22 @@ namespace UnitTests.ViewsTests {
 			}
 			}
 
 
 			top.Remove (Container);
 			top.Remove (Container);
-			WeakReference reference = new (Container, true);
+			Application.End (state);
+			Assert.True (refs.All (r => r.IsAlive));
+#if DEBUG_IDISPOSABLE
+			Assert.True (top.WasDisposed);
+			Assert.False (Container.WasDisposed);
+#endif
+			Assert.Null (Application.Top);
 			Container.Dispose ();
 			Container.Dispose ();
-			return reference;
+#if DEBUG_IDISPOSABLE
+			Assert.True (Container.WasDisposed);
+#endif
+			if (callShutdown) {
+				Application.Shutdown ();
+			}
+
+			return refs;
 		}
 		}
 
 
 		/// <summary>
 		/// <summary>

+ 18 - 0
UnitTests/Views/ViewTests.cs

@@ -4563,5 +4563,23 @@ Label", output);
 			TestHelpers.AssertDriverContentsAre (@"
 			TestHelpers.AssertDriverContentsAre (@"
 Label", output);
 Label", output);
 		}
 		}
+
+		[Fact, AutoInitShutdown]
+		public void View_Instance_Use_Attribute_Normal_On_Draw ()
+		{
+			var view = new View { Id = "view", X = 1, Y = 1, Width = 4, Height = 1, Text = "Test", CanFocus = true };
+			var root = new View { Id = "root", Width = Dim.Fill (), Height = Dim.Fill () };
+			root.Add (view);
+			Application.Top.Add (root);
+			Application.Begin (Application.Top);
+
+			TestHelpers.AssertDriverContentsAre (@"
+Test", output);
+
+			TestHelpers.AssertDriverColorsAre (@"
+000000
+011110
+000000", new Attribute [] { Colors.TopLevel.Normal, Colors.TopLevel.Focus });
+		}
 	}
 	}
 }
 }

+ 2 - 2
docfx/README.md

@@ -2,6 +2,8 @@ This folder generates the API docs for Terminal.Gui.
 
 
 The API documentation is generated via a GitHub Action (`.github/workflows/api-docs.yml`) using [DocFX](https://github.com/dotnet/docfx). The Action publishes the docs to the `gh-pages` branch, which gets published to https://gui-cs.github.io/Terminal.Gui/.
 The API documentation is generated via a GitHub Action (`.github/workflows/api-docs.yml`) using [DocFX](https://github.com/dotnet/docfx). The Action publishes the docs to the `gh-pages` branch, which gets published to https://gui-cs.github.io/Terminal.Gui/.
 
 
+NOTE: the v2 are generated from another repository (https://github.com/gui-cs/Terminal.GuiV2Docs) and are published here: https://gui-cs.github.io/Terminal.GuiV2Docs/. 
+
 ## To Generate the Docs Locally
 ## To Generate the Docs Locally
 
 
 0. Install DotFX https://dotnet.github.io/docfx/tutorial/docfx_getting_started.html
 0. Install DotFX https://dotnet.github.io/docfx/tutorial/docfx_getting_started.html
@@ -9,6 +11,4 @@ The API documentation is generated via a GitHub Action (`.github/workflows/api-d
 2. Browse to http://localhost:8080 and verify everything looks good.
 2. Browse to http://localhost:8080 and verify everything looks good.
 3. Hit ctrl-c to stop the script.
 3. Hit ctrl-c to stop the script.
 
 
-If `docfx` fails with a `Stackoverflow` error. Just run it again. And again. Sometimes it takes a few times. If that doesn't work, create a fresh clone or delete the `docfx/api`, `docfx/obj`, and `docs/` folders and run the steps above again.
 
 
-Note the `./docfx/build.ps1` script will create a `./docs` folder. This folder is ignored by `.gitignore`.

+ 0 - 31
docfx/articles/views.md

@@ -1,31 +0,0 @@
-*Terminal.Gui* provides a rich set of views and controls for building terminal user interfaces:
-
-* [Button](~/api/Terminal.Gui/Terminal.Gui.Button.yml) - A View that provides an item that invokes an System.Action when activated by the user.
-* [CheckBox](~/api/Terminal.Gui/Terminal.Gui.CheckBox.yml) - Shows an on/off toggle that the user can set.
-* [ColorPicker](~/api/Terminal.Gui/Terminal.Gui.ColorPicker.yml) - Enables to user to pick a color.
-* [ComboBox](~/api/Terminal.Gui/Terminal.Gui.ComboBox.yml) - Provides a drop-down list of items the user can select from.
-* [Dialog](~/api/Terminal.Gui/Terminal.Gui.Dialog.yml) - A pop-up Window that contains one or more Buttons.
-  * [OpenDialog](~/api/Terminal.Gui/Terminal.Gui.OpenDialog.yml) - A Dialog providing an interactive pop-up Window for users to select files or directories.
-  * [SaveDialog](~/api/Terminal.Gui/Terminal.Gui.SaveDialog.yml) - A Dialog providing an interactive pop-up Window for users to save files.
-* [FrameView](~/api/Terminal.Gui/Terminal.Gui.FrameView.yml) - A container View that draws a frame around its contents. Similar to a GroupBox in Windows.
-* [GraphView](~/api/Terminal.Gui/Terminal.Gui.GraphView.yml) - A View for rendering graphs (bar, scatter etc).
-* [Hex viewer/editor](~/api/Terminal.Gui/Terminal.Gui.HexView.yml) - A hex viewer and editor that operates over a file stream. 
-* [Label](~/api/Terminal.Gui/Terminal.Gui.Label.yml) - Displays a string at a given position and supports multiple lines.
-* [ListView](~/api/Terminal.Gui/Terminal.Gui.ListView.yml) - Displays a scrollable list of data where each item can be activated to perform an action.
-* [MenuBar](~/api/Terminal.Gui/Terminal.Gui.MenuBar.yml) - Provides a menu bar with drop-down and cascading menus.
-* [MessageBox](~/api/Terminal.Gui/Terminal.Gui.MessageBox.yml) - Displays a modal (pup-up) message to the user, with a title, a message and a series of options that the user can choose from. 
-* [ProgressBar](~/api/Terminal.Gui/Terminal.Gui.ProgressBar.yml) - Displays a progress Bar indicating progress of an activity.
-* [RadioGroup](~/api/Terminal.Gui/Terminal.Gui.RadioGroup.yml) - Displays a group of labels each with a selected indicator. Only one of those can be selected at a given time
-* [ScrollView](~/api/Terminal.Gui/Terminal.Gui.ScrollView.yml) - Present a window into a virtual space where subviews are added. Similar to the iOS UIScrollView.
-* [ScrollBarView](~/api/Terminal.Gui/Terminal.Gui.ScrollBarView.yml) - display a 1-character scrollbar, either horizontal or vertical.
-* [StatusBar](~/api/Terminal.Gui/Terminal.Gui.StatusBar.yml) - A View that snaps to the bottom of a Toplevel displaying set of status items. Includes support for global app keyboard shortcuts.
-* [TableView](~/api/Terminal.Gui/Terminal.Gui.TableView.yml) - A View for tabular data based on a System.Data.DataTable. 
-* [TimeField](~/api/Terminal.Gui/Terminal.Gui.TimeField.yml) & [DateField](~/api/Terminal.Gui/Terminal.Gui.TimeField.yml) - Enables structured editing of dates and times.
-* [TextField](~/api/Terminal.Gui/Terminal.Gui.TextField.yml) - Provides a single-line text entry.
-* [TextValidateField](~/api/Terminal.Gui/Terminal.Gui.TextValidateField.yml) - Text field that validates input through a ITextValidateProvider.
-* [TextView](~/api/Terminal.Gui/Terminal.Gui.TextView.yml)- A multi-line text editing View supporting word-wrap, auto-complete, context menus, undo/redo, and clipboard operations, 
-* [TopLevel](~/api/Terminal.Gui/Terminal.Gui.Toplevel.yml) - The base class for modal/pop-up Windows.
-* [TreeView](~/api/Terminal.Gui/Terminal.Gui.TreeView.yml) - A hierarchical tree view with expandable branches. Branch objects are dynamically determined when expanded using a user defined ITreeBuilder.
-* [View](~/api/Terminal.Gui/Terminal.Gui.View.yml) - The base class for all views on the screen and represents a visible element that can render itself and contains zero or more nested views.
-* [Window](~/api/Terminal.Gui/Terminal.Gui.Window.yml) - A Toplevel view that draws a border around its Frame with a title at the top.
-* [Wizard](~/api/Terminal.Gui/Terminal.Gui.Wizard.yml) - Provides navigation and a user interface to collect related data across multiple steps.

+ 15 - 5
docfx/build.ps1

@@ -1,11 +1,21 @@
 # Builds the Terminal.gui API documentation using docfx
 # Builds the Terminal.gui API documentation using docfx
 
 
-dotnet build --configuration Release ../Terminal.sln
+$prevPwd = $PWD; Set-Location -ErrorAction Stop -LiteralPath $PSScriptRoot
 
 
-rm ../docs -Recurse -Force -ErrorAction SilentlyContinue
+try {
+    $PWD  # output the current location 
 
 
-$env:DOCFX_SOURCE_BRANCH_NAME="main"
+    dotnet tool update -g docfx
 
 
-docfx --metadata
+    # Force delete metadata
+    rm ./api  -Recurse -Force -ErrorAction SilentlyContinue
+
+    $env:DOCFX_SOURCE_BRANCH_NAME="v2_develop"
+
+    docfx --serve
+}
+finally {
+  # Restore the previous location.
+  $prevPwd | Set-Location
+}
 
 
-docfx --serve --force

+ 29 - 54
docfx/docfx.json

@@ -3,63 +3,43 @@
     {
     {
       "src": [
       "src": [
         {
         {
+          "src": "../Terminal.Gui",
           "files": [
           "files": [
-            "Terminal.Gui.csproj"
-          ],
-          "exclude": [
-            "**/obj/**",
-            "_site/**"
-          ],
-          "src": "../Terminal.Gui"
+            "**/*.csproj"
+          ]
         }
         }
       ],
       ],
-      "dest": "api/Terminal.Gui",
-      "shouldSkipMarkup": true,
-      "properties": {
-          "TargetFramework": "net6.0"
-      }
+      "dest": "api",
+      "memberLayout": "separatePages"
     },
     },
     {
     {
       "src": [
       "src": [
         {
         {
+          "src": "../UICatalog",
           "files": [
           "files": [
-            "UICatalog.csproj"
-          ],
-          "exclude": [
-            "**/obj/**",
-            "_site/**"
-          ],
-          "src": "../UICatalog"
+            "**/*.csproj"
+          ]
         }
         }
       ],
       ],
       "dest": "api/UICatalog",
       "dest": "api/UICatalog",
-      "shouldSkipMarkup": false,
-      "properties": {
-          "TargetFramework": "net6.0"
-      }
+      "memberLayout": "separatePages"
     }
     }
   ],
   ],
   "build": {
   "build": {
     "template": [
     "template": [
       "default",
       "default",
-      "./templates/default"
+      "templates/modern"
+      // ,
+      // "templates/singulinkfx"
     ],
     ],
+    "theme": "light",
+    "output": "_site",
     "content": [
     "content": [
       {
       {
         "files": [
         "files": [
-          "api/**.yml",
-          "api/index.md"
-        ]
-      },
-      {
-        "files": [
-          "articles/**.md",
-          "articles/**/toc.yml",
-          "toc.yml",
-          "*.md"
+          "**/*.{md,yml}"
         ],
         ],
         "exclude": [
         "exclude": [
-          "obj/**",
           "_site/**"
           "_site/**"
         ]
         ]
       }
       }
@@ -68,29 +48,21 @@
       {
       {
         "files": [
         "files": [
           "images/**"
           "images/**"
-        ],
-        "exclude": [
-          "obj/**",
-          "_site/**"
         ]
         ]
       }
       }
     ],
     ],
-    "overwrite": [
-      {
-        "files": [
-          "apidoc/**.md"
-        ],
-        "exclude": [
-          "obj/**",
-          "_site/**"
-        ]
-      }
-    ],
-    "dest": "../docs",
     "globalMetadata": {
     "globalMetadata": {
-      "_enableSearch": "true",
+      "_appName": "Terminal.Gui v1",
+      "_appTitle": "Terminal.Gui v1",
+      "pdf": false,
+      "_appFaviconPath": "images/icon48.png",
       "_appLogoPath": "images/logo48.png",
       "_appLogoPath": "images/logo48.png",
+      "_appFooter": "Terminal.Gui - Part of the gui-cs Organization",
+      "_enableSearch": true,
+      "_disableSideFilter": false,
+      "_enableNewTab": true,
       "_disableContribution": false,
       "_disableContribution": false,
+      "_disableBreadcrumb": false,
       "_gitContribute": {
       "_gitContribute": {
         "repo": "https://github.com/gui-cs/Terminal.Gui",
         "repo": "https://github.com/gui-cs/Terminal.Gui",
         "branch": "develop",
         "branch": "develop",
@@ -98,10 +70,13 @@
       },
       },
       "_gitUrlPattern": "github"
       "_gitUrlPattern": "github"
     },
     },
+    "markdownEngineName": "markdig",
     "globalMetadataFiles": [],
     "globalMetadataFiles": [],
     "fileMetadataFiles": [],
     "fileMetadataFiles": [],
-    "postProcessors": ["ExtractSearchIndex"],
+    "postProcessors": [
+      "ExtractSearchIndex"
+    ],
     "noLangKeyword": false,
     "noLangKeyword": false,
     "keepFileLink": false
     "keepFileLink": false
   }
   }
-}
+}

+ 2 - 0
docfx/articles/drivers.md → docfx/docs/drivers.md

@@ -1,6 +1,8 @@
 
 
 # Cross-Platform Driver Model
 # Cross-Platform Driver Model
 
 
+**These are the v1 API docs**. The v2 API docs are [here](https://gui-cs.github.io/Terminal.GuiV2Docs/).
+
 **Terminal.Gui** has support for [ncurses](https://github.com/gui-cs/Terminal.Gui/blob/master/Terminal.Gui/ConsoleDrivers/CursesDriver/CursesDriver.cs), [`System.Console`](https://github.com/gui-cs/Terminal.Gui/blob/master/Terminal.Gui/ConsoleDrivers/NetDriver.cs), and a full [Win32 Console](https://github.com/gui-cs/Terminal.Gui/blob/master/Terminal.Gui/ConsoleDrivers/WindowsDriver.cs) front-end.
 **Terminal.Gui** has support for [ncurses](https://github.com/gui-cs/Terminal.Gui/blob/master/Terminal.Gui/ConsoleDrivers/CursesDriver/CursesDriver.cs), [`System.Console`](https://github.com/gui-cs/Terminal.Gui/blob/master/Terminal.Gui/ConsoleDrivers/NetDriver.cs), and a full [Win32 Console](https://github.com/gui-cs/Terminal.Gui/blob/master/Terminal.Gui/ConsoleDrivers/WindowsDriver.cs) front-end.
 
 
 `ncurses` is used on Mac/Linux/Unix with color support based on what your library is compiled with; the Windows driver supports full color and mouse, and an easy-to-debug `System.Console` can be used on Windows and Unix, but lacks mouse support.
 `ncurses` is used on Mac/Linux/Unix with color support based on what your library is compiled with; the Windows driver supports full color and mouse, and an easy-to-debug `System.Console` can be used on Windows and Unix, but lacks mouse support.

+ 2 - 0
docfx/articles/index.md → docfx/docs/index.md

@@ -1,5 +1,7 @@
 # Conceptual Documentation
 # Conceptual Documentation
 
 
+**These are the v1 API docs**. The v2 API docs are [here](https://gui-cs.github.io/Terminal.GuiV2Docs/).
+
 * [Terminal.Gui Overview](overview.md)
 * [Terminal.Gui Overview](overview.md)
 * [List of Views](views.md)
 * [List of Views](views.md)
 * [Keyboard Event Processing](keyboard.md)
 * [Keyboard Event Processing](keyboard.md)

+ 2 - 0
docfx/articles/keyboard.md → docfx/docs/keyboard.md

@@ -1,6 +1,8 @@
 Keyboard Event Processing
 Keyboard Event Processing
 =========================
 =========================
 
 
+**These are the v1 API docs**. The v2 API docs are [here](https://gui-cs.github.io/Terminal.GuiV2Docs/).
+
 **Terminal.Gui** respects common Linux, Mac, and Windows keyboard idioms. For example, clipboard operations use the familiar `Control/Command-C, X, V` model. `CTRL-Q` is used for exiting views (and apps).
 **Terminal.Gui** respects common Linux, Mac, and Windows keyboard idioms. For example, clipboard operations use the familiar `Control/Command-C, X, V` model. `CTRL-Q` is used for exiting views (and apps).
 
 
 The input handling of **Terminal.Gui** is similar in some ways to Emacs and the Midnight Commander, so you can expect some of the special key combinations to be active.
 The input handling of **Terminal.Gui** is similar in some ways to Emacs and the Midnight Commander, so you can expect some of the special key combinations to be active.

+ 4 - 2
docfx/articles/mainloop.md → docfx/docs/mainloop.md

@@ -1,5 +1,7 @@
 # Event Processing and the Application Main Loop
 # Event Processing and the Application Main Loop
 
 
+**These are the v1 API docs**. The v2 API docs are [here](https://gui-cs.github.io/Terminal.GuiV2Docs/).
+
 _See also [Cross-platform Driver Model](drivers.md)_
 _See also [Cross-platform Driver Model](drivers.md)_
 
 
 The method `Application.Run` that we covered before will wait for
 The method `Application.Run` that we covered before will wait for
@@ -26,12 +28,12 @@ This class provides the following capabilities:
 * On Unix systems, it can monitor file descriptors for readability or writability.
 * On Unix systems, it can monitor file descriptors for readability or writability.
 
 
 The `MainLoop` property in the the
 The `MainLoop` property in the the
-[`Application`](~/api/Terminal.Gui/Terminal.Gui.Application.yml)
+[`Application`](~/api/Terminal.Gui.Application.yml)
 provides access to these functions.
 provides access to these functions.
 
 
 When your code invokes `Application.Run (Toplevel)`, the application
 When your code invokes `Application.Run (Toplevel)`, the application
 will prepare the current
 will prepare the current
-[`Toplevel`](~/api/Terminal.Gui/Terminal.Gui.Toplevel.yml) instance by
+[`Toplevel`](~/api/Terminal.Gui.Toplevel.yml) instance by
 redrawing the screen appropriately and then calling the mainloop to
 redrawing the screen appropriately and then calling the mainloop to
 run.   
 run.   
 
 

+ 18 - 16
docfx/articles/overview.md → docfx/docs/overview.md

@@ -1,5 +1,7 @@
 # Terminal.Gui API Overview
 # Terminal.Gui API Overview
 
 
+**These are the v1 API docs**. The v2 API docs are [here](https://gui-cs.github.io/Terminal.GuiV2Docs/).
+
 `Terminal.Gui` is a library intended to create console-based
 `Terminal.Gui` is a library intended to create console-based
 applications using C#. The framework has been designed to make it
 applications using C#. The framework has been designed to make it
 easy to write applications that will work on monochrome terminals, as
 easy to write applications that will work on monochrome terminals, as
@@ -42,10 +44,10 @@ the various views that are included. In the following sections, you
 will see how applications are put together.
 will see how applications are put together.
 
 
 In the example above, you can see that we have initialized the runtime by calling the 
 In the example above, you can see that we have initialized the runtime by calling the 
-[`Init`](~/api/Terminal.Gui/Terminal.Gui.Application.yml#Terminal_Gui_Application_Init_Terminal_Gui_ConsoleDriver_Terminal_Gui_IMainLoopDriver_) method in the Application class - this sets up the environment, initializes the color
+[`Init`](~/api/Terminal.Gui.Application.yml#Terminal_Gui_Application_Init_Terminal_Gui_ConsoleDriver_Terminal_Gui_IMainLoopDriver_) method in the Application class - this sets up the environment, initializes the color
 schemes available for your application and clears the screen to start your application.
 schemes available for your application and clears the screen to start your application.
 
 
-The [`Application`](~/api/Terminal.Gui/Terminal.Gui.Application.yml) class, additionally creates an instance of the [`Toplevel`](~/api/Terminal.Gui/Terminal.Gui.Toplevel.yml) class that is ready to be consumed, 
+The [`Application`](~/api/Terminal.Gui.Application.yml) class, additionally creates an instance of the [`Toplevel`](~/api/Terminal.Gui.Toplevel.yml) class that is ready to be consumed, 
 this instance is available in the `Application.Top` property, and can be used like this:
 this instance is available in the `Application.Top` property, and can be used like this:
 
 
 ```csharp
 ```csharp
@@ -105,13 +107,13 @@ class Demo {
 ## Views
 ## Views
 
 
 All visible elements on a Terminal.Gui application are implemented as
 All visible elements on a Terminal.Gui application are implemented as
-[Views](~/api/Terminal.Gui/Terminal.Gui.View.yml). Views are self-contained objects that take care of displaying themselves, can receive keyboard and mouse input and participate in the focus mechanism.
+[Views](~/api/Terminal.Gui.View.yml). Views are self-contained objects that take care of displaying themselves, can receive keyboard and mouse input and participate in the focus mechanism.
 
 
 See the full list of [Views provided by the Terminal.Gui library here](views.md).
 See the full list of [Views provided by the Terminal.Gui library here](views.md).
 
 
 Every view can contain an arbitrary number of children views. These are called
 Every view can contain an arbitrary number of children views. These are called
 the Subviews. You can add a view to an existing view, by calling the 
 the Subviews. You can add a view to an existing view, by calling the 
-[`Add`](~/api/Terminal.Gui/Terminal.Gui.View.yml#Terminal_Gui_View_Add_Terminal_Gui_View_) method, for example, to add a couple of buttons to a UI, you can do this:
+[`Add`](~/api/Terminal.Gui.View.yml#Terminal_Gui_View_Add_Terminal_Gui_View_) method, for example, to add a couple of buttons to a UI, you can do this:
 
 
 ```csharp
 ```csharp
 void SetupMyView (View myView)
 void SetupMyView (View myView)
@@ -140,12 +142,12 @@ View.
 ## Layout
 ## Layout
 
 
 `Terminal.Gui` supports two different layout systems, absolute and computed \
 `Terminal.Gui` supports two different layout systems, absolute and computed \
-(controlled by the [`LayoutStyle`](~/api/Terminal.Gui/Terminal.Gui.LayoutStyle.yml)
+(controlled by the [`LayoutStyle`](~/api/Terminal.Gui.LayoutStyle.yml)
 property on the view.
 property on the view.
 
 
 The absolute system is used when you want the view to be positioned exactly in
 The absolute system is used when you want the view to be positioned exactly in
 one location and want to manually control where the view is. This is done
 one location and want to manually control where the view is. This is done
-by invoking your View constructor with an argument of type [`Rect`](~/api/Terminal.Gui/Terminal.Gui.Rect.yml). When you do this, to change the
+by invoking your View constructor with an argument of type [`Rect`](~/api/Terminal.Gui.Rect.yml). When you do this, to change the
 position of the View, you can change the `Frame` property on the View.
 position of the View, you can change the `Frame` property on the View.
 
 
 The computed layout system offers a few additional capabilities, like automatic
 The computed layout system offers a few additional capabilities, like automatic
@@ -169,7 +171,7 @@ var label = new Label ("Hello") {
 var label2 = new Label (new Rect (1, 2, 20, 1), "World")
 var label2 = new Label (new Rect (1, 2, 20, 1), "World")
 ```
 ```
 
 
-The computed layout system does not take integers, instead the `X` and `Y` properties are of type [`Pos`](~/api/Terminal.Gui/Terminal.Gui.Pos.yml) and the `Width` and `Height` properties are of type [`Dim`](~/api/Terminal.Gui/Terminal.Gui.Dim.yml) both which can be created implicitly from integer values.
+The computed layout system does not take integers, instead the `X` and `Y` properties are of type [`Pos`](~/api/Terminal.Gui.Pos.yml) and the `Width` and `Height` properties are of type [`Dim`](~/api/Terminal.Gui.Dim.yml) both which can be created implicitly from integer values.
 
 
 ### The `Pos` Type
 ### The `Pos` Type
 
 
@@ -220,8 +222,8 @@ anotherView.Height = Dim.Height (view)+1
 
 
 ## TopLevels, Windows and Dialogs.
 ## TopLevels, Windows and Dialogs.
 
 
-Among the many kinds of views, you typically will create a [Toplevel](~/api/Terminal.Gui/Terminal.Gui.Toplevel.yml) view (or any of its subclasses,
-like [Window](~/api/Terminal.Gui/Terminal.Gui.Window.yml) or [Dialog](~/api/Terminal.Gui/Terminal.Gui.Dialog.yml) which is special kind of views
+Among the many kinds of views, you typically will create a [Toplevel](~/api/Terminal.Gui.Toplevel.yml) view (or any of its subclasses,
+like [Window](~/api/Terminal.Gui.Window.yml) or [Dialog](~/api/Terminal.Gui.Dialog.yml) which is special kind of views
 that can be executed modally - that is, the view can take over all input and returns
 that can be executed modally - that is, the view can take over all input and returns
 only when the user chooses to complete their work there. 
 only when the user chooses to complete their work there. 
 
 
@@ -229,7 +231,7 @@ The following sections cover the differences.
 
 
 ### TopLevel Views
 ### TopLevel Views
 
 
-[Toplevel](~/api/Terminal.Gui/Terminal.Gui.Toplevel.yml) views have no visible user interface elements and occupy an arbitrary portion of the screen.
+[Toplevel](~/api/Terminal.Gui.Toplevel.yml) views have no visible user interface elements and occupy an arbitrary portion of the screen.
 
 
 You would use a toplevel Modal view for example to launch an entire new experience in your application, one where you would have a new top-level menu for example. You 
 You would use a toplevel Modal view for example to launch an entire new experience in your application, one where you would have a new top-level menu for example. You 
 typically would add a Menu and a Window to your Toplevel, it would look like this:
 typically would add a Menu and a Window to your Toplevel, it would look like this:
@@ -281,20 +283,20 @@ class Demo {
 
 
 ### Window Views
 ### Window Views
 
 
-[Window](~/api/Terminal.Gui/Terminal.Gui.Window.yml) views extend the Toplevel view by providing a frame and a title around the toplevel - and can be moved on the screen with the mouse (caveat: code is currently disabled)
+[Window](~/api/Terminal.Gui.Window.yml) views extend the Toplevel view by providing a frame and a title around the toplevel - and can be moved on the screen with the mouse (caveat: code is currently disabled)
 
 
 From a user interface perspective, you might have more than one Window on the screen at a given time.
 From a user interface perspective, you might have more than one Window on the screen at a given time.
 
 
 ### Dialogs
 ### Dialogs
 
 
-[Dialog](~/api/Terminal.Gui/Terminal.Gui.Dialog.yml) are [Window](~/api/Terminal.Gui/Terminal.Gui.Window.yml) objects that happen to be centered in the middle of the screen.
+[Dialog](~/api/Terminal.Gui.Dialog.yml) are [Window](~/api/Terminal.Gui.Window.yml) objects that happen to be centered in the middle of the screen.
 
 
 Dialogs are instances of a Window that are centered in the screen, and are intended
 Dialogs are instances of a Window that are centered in the screen, and are intended
 to be used modally - that is, they run, and they are expected to return a result 
 to be used modally - that is, they run, and they are expected to return a result 
 before resuming execution of your application.
 before resuming execution of your application.
 
 
 Dialogs are a subclass of `Window` and additionally expose the 
 Dialogs are a subclass of `Window` and additionally expose the 
-[`AddButton`](https://migueldeicaza.github.io/gui.cs/api/Terminal.Gui/Terminal.Gui.Dialog.yml#Terminal_Gui_Dialog_AddButton_Terminal_Gui_Button_) API which manages the layout
+[`AddButton`](https://migueldeicaza.github.io/gui.cs/api/Terminal.Gui.Dialog.yml#Terminal_Gui_Dialog_AddButton_Terminal_Gui_Button_) API which manages the layout
 of any button passed to it, ensuring that the buttons are at the bottom of the dialog.
 of any button passed to it, ensuring that the buttons are at the bottom of the dialog.
 
 
 Example:
 Example:
@@ -384,7 +386,7 @@ More details are available on the [`Keyboard Event Processing`](keyboard.md) doc
 All views have been configured with a color scheme that will work both in color
 All views have been configured with a color scheme that will work both in color
 terminals as well as the more limited black and white terminals. 
 terminals as well as the more limited black and white terminals. 
 
 
-The various styles are captured in the [`Colors`](~/api/Terminal.Gui/Terminal.Gui.Colors.yml) class which defined color schemes for
+The various styles are captured in the [`Colors`](~/api/Terminal.Gui.Colors.yml) class which defined color schemes for
 the toplevel, the normal views, the menu bar, popup dialog boxes and error dialog boxes, that you can use like this:
 the toplevel, the normal views, the menu bar, popup dialog boxes and error dialog boxes, that you can use like this:
 
 
 * `Colors.Toplevel`
 * `Colors.Toplevel`
@@ -400,7 +402,7 @@ var w = new Window ("Hello");
 w.ColorScheme = Colors.Error
 w.ColorScheme = Colors.Error
 ```
 ```
 
 
-The [`ColorScheme`](~/api/Terminal.Gui/Terminal.Gui.ColorScheme.yml) represents
+The [`ColorScheme`](~/api/Terminal.Gui.ColorScheme.yml) represents
 four values, the color used for Normal text, the color used for normal text when
 four values, the color used for Normal text, the color used for normal text when
 a view is focused an the colors for the hot-keys both in focused and unfocused modes.
 a view is focused an the colors for the hot-keys both in focused and unfocused modes.
 
 
@@ -418,7 +420,7 @@ label.TextColor = myColor
 
 
 ## MainLoop, Threads and Input Handling
 ## MainLoop, Threads and Input Handling
 
 
-Detailed description of the mainloop is described on the [Event Processing and the Application Main Loop](~/articles/mainloop.md) document.
+Detailed description of the mainloop is described on the [Event Processing and the Application Main Loop](~/docs/mainloop.md) document.
 
 
 ## Cross-Platform Drivers
 ## Cross-Platform Drivers
 
 

+ 3 - 1
docfx/articles/tableview.md → docfx/docs/tableview.md

@@ -1,10 +1,12 @@
 # Table View
 # Table View
 
 
+**These are the v1 API docs**. The v2 API docs are [here](https://gui-cs.github.io/Terminal.GuiV2Docs/).
+
 This control supports viewing and editing tabular data. It provides a view of a [System.DataTable](https://docs.microsoft.com/en-us/dotnet/api/system.data.datatable?view=net-5.0).
 This control supports viewing and editing tabular data. It provides a view of a [System.DataTable](https://docs.microsoft.com/en-us/dotnet/api/system.data.datatable?view=net-5.0).
 
 
 System.DataTable is a core class of .net standard and can be created very easily
 System.DataTable is a core class of .net standard and can be created very easily
 
 
-[TableView API Reference](~/api/Terminal.Gui/Terminal.Gui.TableView.yml)
+[TableView API Reference](~/api/Terminal.Gui.TableView.yml)
 
 
 ## Csv Example
 ## Csv Example
 
 

+ 20 - 0
docfx/docs/toc.yml

@@ -0,0 +1,20 @@
+- name: API Reference
+  href: api/Terminal.Gui/
+- name: Terminal.Gui Overview
+  href: overview.md
+- name: List of Views
+  href: views.md
+- name: Keyboard Event Processing
+  href: keyboard.md
+- name: Event Processing and the Application Main Loop
+  href: mainloop.md
+- name: Cross-platform Driver Model
+  href: drivers.md
+- name: TableView Deep Dive
+  href: tableview.md
+- name: TreeView Deep Dive
+  href: treeview.md
+- name: UI Catalog API
+  href: api/UICatalog/
+- name: Source
+  href: https://github.com/gui-cs/Terminal.Gui

+ 3 - 1
docfx/articles/treeview.md → docfx/docs/treeview.md

@@ -1,8 +1,10 @@
 # Tree View
 # Tree View
 
 
+**These are the v1 API docs**. The v2 API docs are [here](https://gui-cs.github.io/Terminal.GuiV2Docs/).
+
 TreeView is a control for navigating hierarchical objects. It comes in two forms `TreeView` and `TreeView<T>`.
 TreeView is a control for navigating hierarchical objects. It comes in two forms `TreeView` and `TreeView<T>`.
 
 
-[TreeView API Reference](~/api/Terminal.Gui/Terminal.Gui.TreeView.yml)
+[TreeView API Reference](~/api/Terminal.Gui.TreeView.yml)
 
 
 ## Using TreeView
 ## Using TreeView
 
 

+ 33 - 0
docfx/docs/views.md

@@ -0,0 +1,33 @@
+*Terminal.Gui* provides a rich set of views and controls for building terminal user interfaces:
+
+**These are the v1 API docs**. The v2 API docs are [here](https://gui-cs.github.io/Terminal.GuiV2Docs/).
+
+* [Button](~/api/Terminal.Gui.Button.yml) - A View that provides an item that invokes an System.Action when activated by the user.
+* [CheckBox](~/api/Terminal.Gui.CheckBox.yml) - Shows an on/off toggle that the user can set.
+* [ColorPicker](~/api/Terminal.Gui.ColorPicker.yml) - Enables to user to pick a color.
+* [ComboBox](~/api/Terminal.Gui.ComboBox.yml) - Provides a drop-down list of items the user can select from.
+* [Dialog](~/api/Terminal.Gui.Dialog.yml) - A pop-up Window that contains one or more Buttons.
+  * [OpenDialog](~/api/Terminal.Gui.OpenDialog.yml) - A Dialog providing an interactive pop-up Window for users to select files or directories.
+  * [SaveDialog](~/api/Terminal.Gui.SaveDialog.yml) - A Dialog providing an interactive pop-up Window for users to save files.
+* [FrameView](~/api/Terminal.Gui.FrameView.yml) - A container View that draws a frame around its contents. Similar to a GroupBox in Windows.
+* [GraphView](~/api/Terminal.Gui.GraphView.yml) - A View for rendering graphs (bar, scatter etc).
+* [Hex viewer/editor](~/api/Terminal.Gui.HexView.yml) - A hex viewer and editor that operates over a file stream. 
+* [Label](~/api/Terminal.Gui.Label.yml) - Displays a string at a given position and supports multiple lines.
+* [ListView](~/api/Terminal.Gui.ListView.yml) - Displays a scrollable list of data where each item can be activated to perform an action.
+* [MenuBar](~/api/Terminal.Gui.MenuBar.yml) - Provides a menu bar with drop-down and cascading menus.
+* [MessageBox](~/api/Terminal.Gui.MessageBox.yml) - Displays a modal (pup-up) message to the user, with a title, a message and a series of options that the user can choose from. 
+* [ProgressBar](~/api/Terminal.Gui.ProgressBar.yml) - Displays a progress Bar indicating progress of an activity.
+* [RadioGroup](~/api/Terminal.Gui.RadioGroup.yml) - Displays a group of labels each with a selected indicator. Only one of those can be selected at a given time
+* [ScrollView](~/api/Terminal.Gui.ScrollView.yml) - Present a window into a virtual space where subviews are added. Similar to the iOS UIScrollView.
+* [ScrollBarView](~/api/Terminal.Gui.ScrollBarView.yml) - display a 1-character scrollbar, either horizontal or vertical.
+* [StatusBar](~/api/Terminal.Gui.StatusBar.yml) - A View that snaps to the bottom of a Toplevel displaying set of status items. Includes support for global app keyboard shortcuts.
+* [TableView](~/api/Terminal.Gui.TableView.yml) - A View for tabular data based on a System.Data.DataTable. 
+* [TimeField](~/api/Terminal.Gui.TimeField.yml) & [DateField](~/api/Terminal.Gui.TimeField.yml) - Enables structured editing of dates and times.
+* [TextField](~/api/Terminal.Gui.TextField.yml) - Provides a single-line text entry.
+* [TextValidateField](~/api/Terminal.Gui.TextValidateField.yml) - Text field that validates input through a ITextValidateProvider.
+* [TextView](~/api/Terminal.Gui.TextView.yml)- A multi-line text editing View supporting word-wrap, auto-complete, context menus, undo/redo, and clipboard operations, 
+* [TopLevel](~/api/Terminal.Gui.Toplevel.yml) - The base class for modal/pop-up Windows.
+* [TreeView](~/api/Terminal.Gui.TreeView.yml) - A hierarchical tree view with expandable branches. Branch objects are dynamically determined when expanded using a user defined ITreeBuilder.
+* [View](~/api/Terminal.Gui.View.yml) - The base class for all views on the screen and represents a visible element that can render itself and contains zero or more nested views.
+* [Window](~/api/Terminal.Gui.Window.yml) - A Toplevel view that draws a border around its Frame with a title at the top.
+* [Wizard](~/api/Terminal.Gui.Wizard.yml) - Provides navigation and a user interface to collect related data across multiple steps.

+ 11 - 9
docfx/index.md

@@ -1,4 +1,6 @@
-# Terminal.Gui - Cross Platform Terminal UI toolkit for .NET
+# Terminal.Gui v1 - Cross Platform Terminal UI toolkit for .NET
+
+**These are the v1 API docs**. The v2 API docs are [here](https://gui-cs.github.io/Terminal.GuiV2Docs/).
 
 
 A toolkit for building rich console apps for .NET, .NET Core, and Mono that works on Windows, the Mac, and Linux/Unix.
 A toolkit for building rich console apps for .NET, .NET Core, and Mono that works on Windows, the Mac, and Linux/Unix.
 
 
@@ -8,14 +10,14 @@ A toolkit for building rich console apps for .NET, .NET Core, and Mono that work
 
 
 ## Terminal.Gui API Documentation
 ## Terminal.Gui API Documentation
 
 
-* [API Reference](~/api/Terminal.Gui/Terminal.Gui.yml)
-* [Views and controls built into the Terminal.Gui library](~/articles/views.md)
-* [Terminal.Gui API Overview](~/articles/overview.md)
-* [Keyboard Event Processing](~/articles/keyboard.md)
-* [Event Processing and the Application Main Loop](~/articles/mainloop.md)
-* [Cross-platform Driver Model](~/articles/drivers.md)
-* [TableView Deep Dive](~/articles/tableview.md)
-* [TreeView Deep Dive](~/articles/treeview.md)
+* [API Reference](~/api/Terminal.Gui.yml)
+* [Views and controls built into the Terminal.Gui library](~/docs/views.md)
+* [Terminal.Gui API Overview](~/docs/overview.md)
+* [Keyboard Event Processing](~/docs/keyboard.md)
+* [Event Processing and the Application Main Loop](~/docs/mainloop.md)
+* [Cross-platform Driver Model](~/docs/drivers.md)
+* [TableView Deep Dive](~/docs/tableview.md)
+* [TreeView Deep Dive](~/docs/treeview.md)
 
 
 ## UI Catalog
 ## UI Catalog
 
 

+ 0 - 121
docfx/templates/default/partials/class.header.tmpl.partial

@@ -1,121 +0,0 @@
-{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}}
-
-<h1 id="{{id}}" data-uid="{{uid}}" class="text-break">{{>partials/title}}</h1>
-<div class="markdown level0 summary">{{{summary}}}</div>
-<div class="markdown level0 conceptual">{{{conceptual}}}</div>
-{{#inClass}}
-<div class="inheritance">
-  <h5>{{__global.inheritance}}</h5>
-  {{#inheritance}}
-  <div class="level{{index}}">{{{specName.0.value}}}</div>
-  {{/inheritance}}
-  <div class="level{{level}}"><span class="xref">{{name.0.value}}</span></div>
-  {{#derivedClasses}}
-    <div class="level{{index}}">{{{specName.0.value}}}</div>
-  {{/derivedClasses}}
-</div>
-{{/inClass}}
-{{#implements.0}}
-<div class="implements">
-  <h5>{{__global.implements}}</h5>
-{{/implements.0}}
-{{#implements}}
-  <div>{{{specName.0.value}}}</div>
-{{/implements}}
-{{#implements.0}}
-</div>
-{{/implements.0}}
-{{#remarks}}
-<h5 id="{{id}}_remarks"><strong>{{__global.remarks}}</strong></h5>
-<div class="markdown level0 remarks">{{{remarks}}}</div>
-{{/remarks}}
-{{#example.0}}
-<h5 id="{{id}}_examples"><strong>{{__global.examples}}</strong></h5>
-{{/example.0}}
-{{#example}}
-{{{.}}}
-{{/example}}
-{{#inheritedMembers.0}}
-<div class="inheritedMembers">
-  <h5>{{__global.inheritedMembers}}</h5>
-{{/inheritedMembers.0}}
-{{#inheritedMembers}}
-  <div>
-  {{#definition}}
-    <xref uid="{{definition}}" text="{{nameWithType.0.value}}" alt="{{fullName.0.value}}"/>
-  {{/definition}}
-  {{^definition}}
-    <xref uid="{{uid}}" text="{{nameWithType.0.value}}" alt="{{fullName.0.value}}"/>
-  {{/definition}}
-  </div>
-{{/inheritedMembers}}
-{{#inheritedMembers.0}}
-</div>
-{{/inheritedMembers.0}}
-<h6><strong>{{__global.namespace}}</strong>: {{{namespace.specName.0.value}}}</h6>
-<h6><strong>{{__global.assembly}}</strong>: {{assemblies.0}}.dll</h6>
-<h5 id="{{id}}_syntax">{{__global.syntax}}</h5>
-<div class="codewrapper">
-  <pre><code class="lang-{{_lang}} hljs">{{syntax.content.0.value}}</code></pre>
-</div>
-{{#syntax.parameters.0}}
-<h5 class="parameters">{{__global.parameters}}</h5>
-<table class="table table-bordered table-striped table-condensed">
-  <thead>
-    <tr>
-      <th>{{__global.type}}</th>
-      <th>{{__global.name}}</th>
-      <th>{{__global.description}}</th>
-    </tr>
-  </thead>
-  <tbody>
-{{/syntax.parameters.0}}
-{{#syntax.parameters}}
-    <tr>
-      <td>{{{type.specName.0.value}}}</td>
-      <td><span class="parametername">{{{id}}}</span></td>
-      <td>{{{description}}}</td>
-    </tr>
-{{/syntax.parameters}}
-{{#syntax.parameters.0}}
-  </tbody>
-</table>
-{{/syntax.parameters.0}}
-{{#syntax.return}}
-<h5 class="returns">{{__global.returns}}</h5>
-<table class="table table-bordered table-striped table-condensed">
-  <thead>
-    <tr>
-      <th>{{__global.type}}</th>
-      <th>{{__global.description}}</th>
-    </tr>
-  </thead>
-  <tbody>
-    <tr>
-      <td>{{{type.specName.0.value}}}</td>
-      <td>{{{description}}}</td>
-    </tr>
-  </tbody>
-</table>
-{{/syntax.return}}
-{{#syntax.typeParameters.0}}
-<h5 class="typeParameters">{{__global.typeParameters}}</h5>
-<table class="table table-bordered table-striped table-condensed">
-  <thead>
-    <tr>
-      <th>{{__global.name}}</th>
-      <th>{{__global.description}}</th>
-    </tr>
-  </thead>
-  <tbody>
-{{/syntax.typeParameters.0}}
-{{#syntax.typeParameters}}
-    <tr>
-      <td><span class="parametername">{{{id}}}</span></td>
-      <td>{{{description}}}</td>
-    </tr>
-{{/syntax.typeParameters}}
-{{#syntax.typeParameters.0}}
-  </tbody>
-</table>
-{{/syntax.typeParameters.0}}

+ 0 - 224
docfx/templates/default/partials/class.tmpl.partial

@@ -1,224 +0,0 @@
-{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}}
-
-{{>partials/class.header}}
-{{#children}}
-<h3 id="{{id}}">{{>partials/classSubtitle}}</h3>
-{{#children}}
-{{^_disableContribution}}
-{{#docurl}}
-<span class="small pull-right mobile-hide">
-  <span class="divider">|</span>
-  <a href="{{docurl}}">{{__global.improveThisDoc}}</a>
-</span>{{/docurl}}
-{{#sourceurl}}
-<span class="small pull-right mobile-hide">
-  <a href="{{sourceurl}}">{{__global.viewSource}}</a>
-</span>{{/sourceurl}}
-{{/_disableContribution}}
-{{#overload}}
-<a id="{{id}}" data-uid="{{uid}}"></a>
-{{/overload}}
-<h4 id="{{id}}" data-uid="{{uid}}">{{name.0.value}}</h4>
-<div class="markdown level1 summary">{{{summary}}}</div>
-<div class="markdown level1 conceptual">{{{conceptual}}}</div>
-<h5 class="decalaration">{{__global.declaration}}</h5>
-{{#syntax}}
-<div class="codewrapper">
-  <pre><code class="lang-{{_lang}} hljs">{{syntax.content.0.value}}</code></pre>
-</div>
-{{#parameters.0}}
-<h5 class="parameters">{{__global.parameters}}</h5>
-<table class="table table-bordered table-striped table-condensed">
-  <thead>
-    <tr>
-      <th>{{__global.type}}</th>
-      <th>{{__global.name}}</th>
-      <th>{{__global.description}}</th>
-    </tr>
-  </thead>
-  <tbody>
-{{/parameters.0}}
-{{#parameters}}
-    <tr>
-      <td>{{{type.specName.0.value}}}</td>
-      <td><span class="parametername">{{{id}}}</span></td>
-      <td>{{{description}}}</td>
-    </tr>
-{{/parameters}}
-{{#parameters.0}}
-  </tbody>
-</table>
-{{/parameters.0}}
-{{#return}}
-<h5 class="returns">{{__global.returns}}</h5>
-<table class="table table-bordered table-striped table-condensed">
-  <thead>
-    <tr>
-      <th>{{__global.type}}</th>
-      <th>{{__global.description}}</th>
-    </tr>
-  </thead>
-  <tbody>
-    <tr>
-      <td>{{{type.specName.0.value}}}</td>
-      <td>{{{description}}}</td>
-    </tr>
-  </tbody>
-</table>
-{{/return}}
-{{#typeParameters.0}}
-<h5 class="typeParameters">{{__global.typeParameters}}</h5>
-<table class="table table-bordered table-striped table-condensed">
-  <thead>
-    <tr>
-      <th>{{__global.name}}</th>
-      <th>{{__global.description}}</th>
-    </tr>
-  </thead>
-  <tbody>
-{{/typeParameters.0}}
-{{#typeParameters}}
-    <tr>
-      <td><span class="parametername">{{{id}}}</span></td>
-      <td>{{{description}}}</td>
-    </tr>
-{{/typeParameters}}
-{{#typeParameters.0}}
-  </tbody>
-</table>
-{{/typeParameters.0}}
-{{#fieldValue}}
-<h5 class="fieldValue">{{__global.fieldValue}}</h5>
-<table class="table table-bordered table-striped table-condensed">
-  <thead>
-    <tr>
-      <th>{{__global.type}}</th>
-      <th>{{__global.description}}</th>
-    </tr>
-  </thead>
-  <tbody>
-    <tr>
-      <td>{{{type.specName.0.value}}}</td>
-      <td>{{{description}}}</td>
-    </tr>
-  </tbody>
-</table>
-{{/fieldValue}}
-{{#propertyValue}}
-<h5 class="propertyValue">{{__global.propertyValue}}</h5>
-<table class="table table-bordered table-striped table-condensed">
-  <thead>
-    <tr>
-      <th>{{__global.type}}</th>
-      <th>{{__global.description}}</th>
-    </tr>
-  </thead>
-  <tbody>
-    <tr>
-      <td>{{{type.specName.0.value}}}</td>
-      <td>{{{description}}}</td>
-    </tr>
-  </tbody>
-</table>
-{{/propertyValue}}
-{{#eventType}}
-<h5 class="eventType">{{__global.eventType}}</h5>
-<table class="table table-bordered table-striped table-condensed">
-  <thead>
-    <tr>
-      <th>{{__global.type}}</th>
-      <th>{{__global.description}}</th>
-    </tr>
-  </thead>
-  <tbody>
-    <tr>
-      <td>{{{type.specName.0.value}}}</td>
-      <td>{{{description}}}</td>
-    </tr>
-  </tbody>
-</table>
-{{/eventType}}
-{{/syntax}}
-{{#overridden}}
-<h5 class="overrides">{{__global.overrides}}</h5>
-<div><xref uid="{{uid}}" altProperty="fullName" displayProperty="nameWithType"/></div>
-{{/overridden}}
-{{#exceptions.0}}
-<h5 class="exceptions">{{__global.exceptions}}</h5>
-<table class="table table-bordered table-striped table-condensed">
-  <thead>
-    <tr>
-      <th>{{__global.type}}</th>
-      <th>{{__global.condition}}</th>
-    </tr>
-  </thead>
-  <tbody>
-{{/exceptions.0}}
-{{#exceptions}}
-    <tr>
-      <td>{{{type.specName.0.value}}}</td>
-      <td>{{{description}}}</td>
-    </tr>
-{{/exceptions}}
-{{#exceptions.0}}
-  </tbody>
-</table>
-{{/exceptions.0}}
-{{#seealso.0}}
-<h5 id="{{id}}_seealso">{{__global.seealso}}</h5>
-<div class="seealso">
-{{/seealso.0}}
-{{#seealso}}
-  {{#isCref}}
-    <div>{{{type.specName.0.value}}}</div>
-  {{/isCref}}
-  {{^isCref}}
-    <div>{{{url}}}</div>
-  {{/isCref}}
-{{/seealso}}
-{{#seealso.0}}
-</div>
-{{/seealso.0}}
-{{/children}}
-{{/children}}
-{{#implements.0}}
-<h3 id="implements">{{__global.implements}}</h3>
-{{/implements.0}}
-{{#implements}}
-<div>
-  {{#definition}}
-    <xref uid="{{definition}}" altProperty="fullName" displayProperty="nameWithType"/>
-  {{/definition}}
-  {{^definition}}
-    <xref uid="{{uid}}" altProperty="fullName" displayProperty="nameWithType"/>
-  {{/definition}}
-</div>
-{{/implements}}
-{{#extensionMethods.0}}
-<h3 id="extensionmethods">{{__global.extensionMethods}}</h3>
-{{/extensionMethods.0}}
-{{#extensionMethods}}
-<div>
-  {{#definition}}
-    <xref uid="{{definition}}" altProperty="fullName" displayProperty="nameWithType"/>
-  {{/definition}}
-  {{^definition}}
-    <xref uid="{{uid}}" altProperty="fullName" displayProperty="nameWithType"/>
-  {{/definition}}
-</div>
-{{/extensionMethods}}
-{{#seealso.0}}
-<h3 id="seealso">{{__global.seealso}}</h3>
-<div class="seealso">
-{{/seealso.0}}
-{{#seealso}}
-  {{#isCref}}
-    <div>{{{type.specName.0.value}}}</div>
-  {{/isCref}}
-  {{^isCref}}
-    <div>{{{url}}}</div>
-  {{/isCref}}
-{{/seealso}}
-{{#seealso.0}}
-</div>
-{{/seealso.0}}

+ 0 - 304
docfx/templates/default/styles/main.css

@@ -1,304 +0,0 @@
-/* COLOR VARIABLES*/
-:root {
-  --header-bg-color: #03265a;
-  --header-ft-color: #fff;
-  --highlight-light: #5e92f3;
-  --highlight-dark: #003c8f;
-  --accent-dim: #eee;
-  --font-color: #3c3d3e;
-  --card-box-shadow: 0 1px 2px 0 rgba(61, 65, 68, 0.06), 0 1px 3px 1px rgba(61, 65, 68, 0.16);
-  --under-box-shadow: 0 4px 4px -2px #eee;
-  --search-box-shadow: 0px 0px 5px 0px rgba(255,255,255,1);
-}
-
-body {
-  color: var(--font-color);
-  font-family: "Source Sans Pro", sans-serif;
-  line-height: 1.5;
-  font-size: 16px;
-  -ms-text-size-adjust: 100%;
-  -webkit-text-size-adjust: 100%;
-  word-wrap: break-word;
-}
-
-code,kbd,pre,samp{ 
-  font-family: "Source Code Pro", Menlo, Monaco, Consolas, "Courier New", monospace
-}
-
-/* HIGHLIGHT COLOR */
-
-button,
-a {
-  color: var(--highlight-light);
-  cursor: pointer;
-}
-
-button:hover,
-button:focus,
-a:hover,
-a:focus {
-  color: var(--highlight-light);
-  text-decoration: none;
-}
-
-.toc .nav > li.active > a {
-  color: var(--highlight-dark);
-}
-
-.toc .nav > li.active > a:hover,
-.toc .nav > li.active > a:focus {
-  color: var(--highlight-light);
-}
-
-.pagination > .active > a {
-  background-color: var(--header-bg-color);
-  border-color: var(--header-bg-color);
-}
-
-.pagination > .active > a,
-.pagination > .active > a:focus,
-.pagination > .active > a:hover,
-.pagination > .active > span,
-.pagination > .active > span:focus,
-.pagination > .active > span:hover {
-  background-color: var(--highlight-light);
-  border-color: var(--highlight-light);
-}
-
-/* HEADINGS */
-
-h1 {
-  font-weight: 600;
-  font-size: 32px;
-}
-
-h2 {
-  font-weight: 600;
-  font-size: 24px;
-  line-height: 1.8;
-}
-
-h3 {
-  font-weight: 600;
-  font-size: 20px;
-  line-height: 1.8;
-}
-
-h5 {
-  font-size: 14px;
-  padding: 10px 0px;
-}
-
-article h1,
-article h2,
-article h3,
-article h4 {
-  margin-top: 35px;
-  margin-bottom: 15px;
-}
-
-article h4 {
-  padding-bottom: 8px;
-  border-bottom: 2px solid #ddd;
-}
-
-/* NAVBAR */
-
-.navbar-brand > img {
-  color: var(--header-ft-color);
-}
-
-.navbar {
-  border: none;
-  /* Both navbars use box-shadow */
-  -webkit-box-shadow: var(--card-box-shadow);
-  -moz-box-shadow: var(--card-box-shadow);
-  box-shadow: var(--card-box-shadow);
-  font-family: 'Source Code Pro', 'Courier New', Courier, monospace
-}
-
-.subnav {
-  border-top: 1px solid #ddd;
-  background-color: #fff;
-}
-
-.navbar-inverse {
-  background-color: var(--header-bg-color);
-  z-index: 100;
-}
-
-.navbar-inverse .navbar-nav > li > a,
-.navbar-inverse .navbar-text {
-  color: var(--header-ft-color);
-  background-color: var(--header-bg-color);
-  border-bottom: 3px solid transparent;
-  padding-bottom: 12px;
-}
-
-.navbar-inverse .navbar-nav > li > a:focus,
-.navbar-inverse .navbar-nav > li > a:hover {
-  color: var(--header-ft-color);
-  background-color: var(--header-bg-color);
-  border-bottom: 3px solid white;
-}
-
-.navbar-inverse .navbar-nav > .active > a,
-.navbar-inverse .navbar-nav > .active > a:focus,
-.navbar-inverse .navbar-nav > .active > a:hover {
-  color: var(--header-ft-color);
-  background-color: var(--header-bg-color);
-  border-bottom: 3px solid white;
-}
-
-.navbar-form .form-control {
-  border: 0;
-  border-radius: 0;
-}
-
-.navbar-form .form-control:hover {
-  box-shadow: var(--search-box-shadow);
-}
-
-.toc-filter > input:hover {
-  box-shadow: var(--under-box-shadow);
-}
-
-/* NAVBAR TOGGLED (small screens) */
-
-.navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form {
-  border: none;
-}
-.navbar-inverse .navbar-toggle {
-  box-shadow: var(--card-box-shadow);
-  border: none;
-}
-
-.navbar-inverse .navbar-toggle:focus,
-.navbar-inverse .navbar-toggle:hover {
-  background-color: var(--header-ft-color);
-}
-
-/* SIDEBAR */
-
-.toc .level1 > li {
-  font-weight: 400;
-}
-
-.toc .nav > li > a {
-  color: var(--font-color);
-}
-
-.sidefilter {
-  background-color: #fff;
-  border-left: none;
-  border-right: none;
-}
-
-.sidefilter {
-  background-color: #fff;
-  border-left: none;
-  border-right: none;
-}
-
-.toc-filter {
-  padding: 10px;
-  margin: 0;
-}
-
-.toc-filter > input {
-  border: none;
-  border-bottom: 2px solid var(--accent-dim);
-}
-
-.toc-filter > .filter-icon {
-  display: none;
-}
-
-.sidetoc > .toc {
-  background-color: #fff;
-  overflow-x: hidden;
-}
-
-.sidetoc {
-  background-color: #fff;
-  border: none;
-}
-
-/* ALERTS */
-
-.alert {
-  padding: 0px 0px 5px 0px;
-  color: inherit;
-  background-color: inherit;
-  border: none;
-  box-shadow: var(--card-box-shadow);
-}
-
-.alert > p {
-  margin-bottom: 0;
-  padding: 5px 10px;
-}
-
-.alert > ul {
-  margin-bottom: 0;
-  padding: 5px 40px;
-}
-
-.alert > h5 {
-  padding: 10px 15px;
-  margin-top: 0;
-  text-transform: uppercase;
-  font-weight: bold;
-  border-radius: 4px 4px 0 0;
-}
-
-.alert-info > h5 {
-  color: #1976d2;
-  border-bottom: 4px solid #1976d2;
-  background-color: #e3f2fd;
-}
-
-.alert-warning > h5 {
-  color: #f57f17;
-  border-bottom: 4px solid #f57f17;
-  background-color: #fff3e0;
-}
-
-.alert-danger > h5 {
-  color: #d32f2f;
-  border-bottom: 4px solid #d32f2f;
-  background-color: #ffebee;
-}
-
-/* CODE HIGHLIGHT */
-pre {
-  padding: 9.5px;
-  margin: 0 0 10px;
-  font-size: 13px;
-  word-break: break-all;
-  word-wrap: break-word;
-  background-color: #fffaef;
-  border-radius: 4px;
-  border: none;
-  box-shadow: var(--card-box-shadow);
-}
-
-/* STYLE FOR IMAGES */
-
-.article .small-image {
-  margin-top: 15px;
-  box-shadow: var(--card-box-shadow);
-  max-width: 350px;
-}
-
-.article .medium-image {
-  margin-top: 15px;
-  box-shadow: var(--card-box-shadow);
-  max-width: 550px;
-}
-
-.article .large-image {
-  margin-top: 15px;
-  box-shadow: var(--card-box-shadow);
-  max-width: 700px;
-}

+ 6 - 0
docfx/templates/modern/ApiPage.html.primary.js

@@ -0,0 +1,6 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+exports.transform = function (model) {
+  return model;
+}

+ 4 - 0
docfx/templates/modern/ApiPage.html.primary.tmpl

@@ -0,0 +1,4 @@
+{{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}}
+{{!master(layout/_master.tmpl)}}
+
+{{{content}}}

+ 148 - 0
docfx/templates/modern/layout/_master.tmpl

@@ -0,0 +1,148 @@
+{{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}}
+{{!include(/^public/.*/)}}
+{{!include(favicon.ico)}}
+{{!include(logo.svg)}}
+<!DOCTYPE html>
+<html {{#_lang}}lang="{{_lang}}"{{/_lang}}>
+  <head>
+    <meta charset="utf-8">
+    {{#redirect_url}}
+      <meta http-equiv="refresh" content="0;URL='{{redirect_url}}'">
+    {{/redirect_url}}
+    {{^redirect_url}}
+      <title>{{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}}</title>
+      <meta name="viewport" content="width=device-width, initial-scale=1.0">
+      <meta name="title" content="{{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}}">
+      {{#_description}}<meta name="description" content="{{_description}}">{{/_description}}
+      <link rel="icon" href="{{_rel}}{{{_appFaviconPath}}}{{^_appFaviconPath}}favicon.ico{{/_appFaviconPath}}">
+      <link rel="stylesheet" href="{{_rel}}public/docfx.min.css">
+      <link rel="stylesheet" href="{{_rel}}public/main.css">
+      <meta name="docfx:navrel" content="{{_navRel}}">
+      <meta name="docfx:tocrel" content="{{_tocRel}}">
+      {{#_noindex}}<meta name="searchOption" content="noindex">{{/_noindex}}
+      {{#_enableSearch}}<meta name="docfx:rel" content="{{_rel}}">{{/_enableSearch}}
+      {{#_disableNewTab}}<meta name="docfx:disablenewtab" content="true">{{/_disableNewTab}}
+      {{#_disableTocFilter}}<meta name="docfx:disabletocfilter" content="true">{{/_disableTocFilter}}
+      {{#docurl}}<meta name="docfx:docurl" content="{{docurl}}">{{/docurl}}
+      <meta name="loc:inThisArticle" content="{{__global.inThisArticle}}">
+      <meta name="loc:searchResultsCount" content="{{__global.searchResultsCount}}">
+      <meta name="loc:searchNoResults" content="{{__global.searchNoResults}}">
+      <meta name="loc:tocFilter" content="{{__global.tocFilter}}">
+      <meta name="loc:nextArticle" content="{{__global.nextArticle}}">
+      <meta name="loc:prevArticle" content="{{__global.prevArticle}}">
+      <meta name="loc:themeLight" content="{{__global.themeLight}}">
+      <meta name="loc:themeDark" content="{{__global.themeDark}}">
+      <meta name="loc:themeAuto" content="{{__global.themeAuto}}">
+      <meta name="loc:changeTheme" content="{{__global.changeTheme}}">
+      <meta name="loc:copy" content="{{__global.copy}}">
+      <meta name="loc:downloadPdf" content="{{__global.downloadPdf}}">
+    {{/redirect_url}}
+  </head>
+
+  {{^redirect_url}}
+  <script type="module" src="./{{_rel}}public/docfx.min.js"></script>
+
+  <script>
+    const theme = localStorage.getItem('theme') || 'auto'
+    document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
+  </script>
+
+  {{#_googleAnalyticsTagId}}
+  <script async src="https://www.googletagmanager.com/gtag/js?id={{_googleAnalyticsTagId}}"></script>
+  <script>
+    window.dataLayer = window.dataLayer || [];
+    function gtag() { dataLayer.push(arguments); }
+    gtag('js', new Date());
+    gtag('config', '{{_googleAnalyticsTagId}}');
+  </script>
+  {{/_googleAnalyticsTagId}}
+
+  <body class="tex2jax_ignore" data-layout="{{_layout}}{{layout}}" data-yaml-mime="{{yamlmime}}">
+    <header class="bg-body border-bottom">
+      <nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
+        <div class="container-xxl flex-nowrap">
+          <a class="navbar-brand" href="{{_appLogoUrl}}{{^_appLogoUrl}}{{_rel}}index.html{{/_appLogoUrl}}">
+            <img id="logo" class="svg" src="{{_rel}}{{{_appLogoPath}}}{{^_appLogoPath}}logo.svg{{/_appLogoPath}}" alt="{{_appName}}" >
+            {{_appName}}
+          </a>
+          <button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
+            <i class="bi bi-three-dots"></i>
+          </button>
+          <div class="collapse navbar-collapse" id="navpanel">
+            <div id="navbar">
+              {{#_enableSearch}}
+              <form class="search" role="search" id="search">
+                <i class="bi bi-search"></i>
+                <input class="form-control" id="search-query" type="search" disabled placeholder="{{__global.search}}" autocomplete="off" aria-label="Search">
+              </form>
+              {{/_enableSearch}}
+            </div>
+          </div>
+        </div>
+      </nav>
+    </header>
+
+    <main class="container-xxl">
+      <div class="toc-offcanvas">
+        <div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
+          <div class="offcanvas-header">
+            <h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
+            <button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
+          </div>
+          <div class="offcanvas-body">
+            <nav class="toc" id="toc"></nav>
+          </div>
+        </div>
+      </div>
+
+      <div class="content">
+        <div class="actionbar">
+          <button class="btn btn-lg border-0 d-md-none" style="margin-top: -.65em; margin-left: -.8em"
+              type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas"
+              aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
+            <i class="bi bi-list"></i>
+          </button>
+
+          <nav id="breadcrumb"></nav>
+        </div>
+
+        <article data-uid="{{uid}}">
+          {{!body}}
+        </article>
+
+        {{^_disableContribution}}
+        <div class="contribution d-print-none">
+          {{#sourceurl}}
+          <a href="{{sourceurl}}" class="edit-link">{{__global.improveThisDoc}}</a>
+          {{/sourceurl}}
+          {{^sourceurl}}{{#docurl}}
+          <a href="{{docurl}}" class="edit-link">{{__global.improveThisDoc}}</a>
+          {{/docurl}}{{/sourceurl}}
+        </div>
+        {{/_disableContribution}}
+
+        {{^_disableNextArticle}}
+        <div class="next-article d-print-none border-top" id="nextArticle"></div>
+        {{/_disableNextArticle}}
+
+      </div>
+
+      <div class="affix">
+        <nav id="affix"></nav>
+      </div>
+    </main>
+
+    {{#_enableSearch}}
+    <div class="container-xxl search-results" id="search-results"></div>
+    {{/_enableSearch}}
+
+    <footer class="border-top text-secondary">
+      <div class="container-xxl">
+        <div class="flex-fill">
+          {{{_appFooter}}}{{^_appFooter}}<span>Made with <a href="https://dotnet.github.io/docfx">docfx</a></span>{{/_appFooter}}
+        </div>
+      </div>
+    </footer>
+  </body>
+  {{/redirect_url}}
+</html>

+ 158 - 0
docfx/templates/modern/partials/class.header.tmpl.partial

@@ -0,0 +1,158 @@
+{{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}}
+
+<h1 id="{{id}}" data-uid="{{uid}}" class="text-break">
+  {{>partials/title}}
+  {{#sourceurl}}<a class="header-action link-secondary" title="View source" href="{{sourceurl}}"><i class="bi bi-code-slash"></i></a>{{/sourceurl}}
+</h1>
+
+<div class="facts text-secondary">
+  <dl><dt>{{__global.namespace}}</dt><dd>{{{namespace.specName.0.value}}}</dd></dl>
+  {{#assemblies.0}}<dl><dt>{{__global.assembly}}</dt><dd>{{assemblies.0}}.dll</dd></dl>{{/assemblies.0}}
+</div>
+
+<div class="markdown summary">{{{summary}}}</div>
+<div class="markdown conceptual">{{{conceptual}}}</div>
+
+{{#syntax.content.0.value}}
+<div class="codewrapper">
+  <pre><code class="lang-csharp hljs">{{syntax.content.0.value}}</code></pre>
+</div>
+{{/syntax.content.0.value}}
+
+{{#syntax.parameters.0}}
+<h4 class="section">{{__global.parameters}}</h4>
+<dl class="parameters">
+{{/syntax.parameters.0}}
+{{#syntax.parameters}}
+  <dt><code>{{{id}}}</code> {{{type.specName.0.value}}}</dt>
+  <dd>{{{description}}}</dd>
+{{/syntax.parameters}}
+{{#syntax.parameters.0}}
+</dl>
+{{/syntax.parameters.0}}
+
+{{#syntax.return}}
+<h4 class="section">{{__global.returns}}</h4>
+<dl class="parameters">
+  <dt>{{{type.specName.0.value}}}</dt>
+  <dd>{{{description}}}</dd>
+</dl>
+{{/syntax.return}}
+
+{{#syntax.typeParameters.0}}
+<h4 class="section">{{__global.typeParameters}}</h4>
+<dl class="parameters">
+{{/syntax.typeParameters.0}}
+{{#syntax.typeParameters}}
+  <dt><code>{{{id}}}</code></dt>
+  <dd>{{{description}}}</dd>
+{{/syntax.typeParameters}}
+{{#syntax.typeParameters.0}}
+</dl>
+{{/syntax.typeParameters.0}}
+
+{{#inClass}}
+{{#inheritance.0}}
+<dl class="typelist inheritance">
+  <dt>{{__global.inheritance}}</dt>
+  <dd>
+{{/inheritance.0}}
+{{#inheritance}}
+    <div>{{{specName.0.value}}}</div>
+{{/inheritance}}
+    <div><span class="xref">{{name.0.value}}</span></div>
+{{#inheritance.0}}
+  </dd>
+</dl>
+{{/inheritance.0}}
+{{/inClass}}
+
+{{#implements.0}}
+<dl class="typelist implements">
+  <dt>{{__global.implements}}</dt>
+  <dd>
+{{/implements.0}}
+{{#implements}}
+    <div>{{{specName.0.value}}}</div>
+{{/implements}}
+{{#implements.0}}
+  </dd>
+</dl>
+{{/implements.0}}
+
+{{#inClass}}
+{{#derivedClasses.0}}
+<dl class="typelist derived">
+  <dt>{{__global.derived}}</dt>
+  <dd>
+{{/derivedClasses.0}}
+{{#derivedClasses}}
+    <div>{{{specName.0.value}}}</div>
+{{/derivedClasses}}
+{{#derivedClasses.0}}
+  </dd>
+</dl>
+{{/derivedClasses.0}}
+{{/inClass}}
+
+{{#inheritedMembers.0}}
+<dl class="typelist derived">
+  <dt>{{__global.inheritedMembers}}</dt>
+  <dd>
+{{/inheritedMembers.0}}
+{{#inheritedMembers}}
+  <div>
+  {{#definition}}
+    <xref uid="{{definition}}" text="{{nameWithType.0.value}}" alt="{{fullName.0.value}}"/>
+  {{/definition}}
+  {{^definition}}
+    <xref uid="{{uid}}" text="{{nameWithType.0.value}}" alt="{{fullName.0.value}}"/>
+  {{/definition}}
+  </div>
+{{/inheritedMembers}}
+{{#inheritedMembers.0}}
+</dl>
+{{/inheritedMembers.0}}
+
+{{#extensionMethods.0}}
+<dl class="typelist extensionMethods">
+  <dt>{{__global.extensionMethods}}</dt>
+  <dd>
+{{/extensionMethods.0}}
+{{#extensionMethods}}
+<div>
+  {{#definition}}
+    <xref uid="{{definition}}" altProperty="fullName" displayProperty="nameWithType"/>
+  {{/definition}}
+  {{^definition}}
+    <xref uid="{{uid}}" altProperty="fullName" displayProperty="nameWithType"/>
+  {{/definition}}
+</div>
+{{/extensionMethods}}
+{{#extensionMethods.0}}
+</dl>
+{{/extensionMethods.0}}
+
+{{#isEnum}}
+{{#children}}
+<h2 id="{{id}}">{{>partials/classSubtitle}}</h2>
+<dl class="parameters">
+{{#children}}
+  <dt id="{{id}}"><code>{{syntax.content.0.value}}</code></dt>
+  <dd>{{{summary}}}</dd>
+{{/children}}
+</dl>
+{{/children}}
+{{/isEnum}}
+
+{{#example.0}}
+<h2 id="{{id}}_examples">{{__global.examples}}</h2>
+{{/example.0}}
+{{#example}}
+{{{.}}}
+{{/example}}
+
+{{#remarks}}
+<h2 id="{{id}}_remarks">{{__global.remarks}}</h2>
+<div class="markdown level0 remarks">{{{remarks}}}</div>
+{{/remarks}}

+ 31 - 0
docfx/templates/modern/partials/class.memberpage.tmpl.partial

@@ -0,0 +1,31 @@
+{{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}}
+
+{{>partials/class.header}}
+
+{{#children}}
+<h2 class="section" id="{{id}}">{{>partials/classSubtitle}}</h2>
+
+{{#children}}
+<dl class="jumplist">
+  <dt><xref uid="{{uid}}" altProperty="fullName" displayProperty="name"/></dt>
+  <dd>{{{summary}}}</dd>
+</dl>
+{{/children}}
+
+{{/children}}
+
+{{#seealso.0}}
+<h2 id="seealso">{{__global.seealso}}</h2>
+<div class="seealso">
+{{/seealso.0}}
+{{#seealso}}
+  {{#isCref}}
+    <div>{{{type.specName.0.value}}}</div>
+  {{/isCref}}
+  {{^isCref}}
+    <div>{{{url}}}</div>
+  {{/isCref}}
+{{/seealso}}
+{{#seealso.0}}
+</div>
+{{/seealso.0}}

+ 147 - 0
docfx/templates/modern/partials/class.tmpl.partial

@@ -0,0 +1,147 @@
+{{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}}
+
+{{>partials/class.header}}
+
+{{#children}}
+
+{{^_splitReference}}
+<h2 class="section" id="{{id}}">{{>partials/classSubtitle}}</h2>
+{{/_splitReference}}
+
+{{#children}}
+
+{{#overload}}
+<a id="{{id}}" data-uid="{{uid}}"></a>
+{{/overload}}
+
+<h3 id="{{id}}" data-uid="{{uid}}">
+  {{name.0.value}}
+  {{#sourceurl}}<a class="header-action link-secondary" title="View source" href="{{sourceurl}}"><i class="bi bi-code-slash"></i></a>{{/sourceurl}}
+</h3>
+
+<div class="markdown level1 summary">{{{summary}}}</div>
+<div class="markdown level1 conceptual">{{{conceptual}}}</div>
+
+{{#syntax}}
+<div class="codewrapper">
+  <pre><code class="lang-csharp hljs">{{syntax.content.0.value}}</code></pre>
+</div>
+
+{{#syntax.parameters.0}}
+<h4 class="section">{{__global.parameters}}</h4>
+<dl class="parameters">
+{{/syntax.parameters.0}}
+{{#syntax.parameters}}
+  <dt><code>{{{id}}}</code> {{{type.specName.0.value}}}</dt>
+  <dd>{{{description}}}</dd>
+{{/syntax.parameters}}
+{{#syntax.parameters.0}}
+</dl>
+{{/syntax.parameters.0}}
+
+{{#syntax.return}}
+<h4 class="section">{{__global.returns}}</h4>
+<dl class="parameters">
+  <dt>{{{type.specName.0.value}}}</dt>
+  <dd>{{{description}}}</dd>
+</dl>
+{{/syntax.return}}
+
+{{#syntax.typeParameters.0}}
+<h4 class="section">{{__global.typeParameters}}</h4>
+<dl class="parameters">
+{{/syntax.typeParameters.0}}
+{{#syntax.typeParameters}}
+  <dt><code>{{{id}}}</code></dt>
+  <dd>{{{description}}}</dd>
+{{/syntax.typeParameters}}
+{{#syntax.typeParameters.0}}
+</dl>
+{{/syntax.typeParameters.0}}
+
+{{#fieldValue}}
+<h4 class="section">{{__global.fieldValue}}</h4>
+<dl class="parameters">
+  <dt>{{{type.specName.0.value}}}</dt>
+  <dd>{{{description}}}</dd>
+</dl>
+{{/fieldValue}}
+
+{{#propertyValue}}
+<h4 class="section">{{__global.propertyValue}}</h4>
+<dl class="parameters">
+  <dt>{{{type.specName.0.value}}}</dt>
+  <dd>{{{description}}}</dd>
+</dl>
+{{/propertyValue}}
+
+{{#eventType}}
+<h4 class="section">{{__global.eventType}}</h4>
+<dl class="parameters">
+  <dt>{{{type.specName.0.value}}}</dt>
+  <dd>{{{description}}}</dd>
+</dl>
+{{/eventType}}
+
+{{/syntax}}
+
+{{#example.0}}
+<h4 class="section" id="{{id}}_examples">{{__global.examples}}</h4>
+{{/example.0}}
+{{#example}}
+{{{.}}}
+{{/example}}
+
+{{#remarks}}
+<h4 class="section" id="{{id}}_remarks">{{__global.remarks}}</h4>
+<div class="markdown level1 remarks">{{{remarks}}}</div>
+{{/remarks}}
+
+{{#exceptions.0}}
+<h4 class="section">{{__global.exceptions}}</h4>
+<dl class="parameters">
+{{/exceptions.0}}
+{{#exceptions}}
+  <dt>{{{type.specName.0.value}}}</dt>
+  <dd>{{{description}}}</dd>
+{{/exceptions}}
+{{#exceptions.0}}
+</dl>
+{{/exceptions.0}}
+
+{{#seealso.0}}
+<dl class="typelist seealso">
+  <dt>{{__global.seealso}}</dt>
+  <dd>
+{{/seealso.0}}
+{{#seealso}}
+  {{#isCref}}
+  <div>{{{type.specName.0.value}}}</div>
+  {{/isCref}}
+  {{^isCref}}
+  <div>{{{url}}}</div>
+  {{/isCref}}
+{{/seealso}}
+{{#seealso.0}}
+  </dd>
+</dl>
+{{/seealso.0}}
+
+{{/children}}
+{{/children}}
+
+{{#seealso.0}}
+<h2 id="seealso">{{__global.seealso}}</h2>
+<div class="seealso">
+{{/seealso.0}}
+{{#seealso}}
+  {{#isCref}}
+    <div>{{{type.specName.0.value}}}</div>
+  {{/isCref}}
+  {{^isCref}}
+    <div>{{{url}}}</div>
+  {{/isCref}}
+{{/seealso}}
+{{#seealso.0}}
+</div>
+{{/seealso.0}}

+ 3 - 0
docfx/templates/modern/partials/collection.tmpl.partial

@@ -0,0 +1,3 @@
+{{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}}
+
+{{>partials/class}}

+ 10 - 0
docfx/templates/modern/partials/customMREFContent.tmpl.partial

@@ -0,0 +1,10 @@
+{{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}}
+{{!Add your own custom template for the content for ManagedReference here}}
+{{#_splitReference}}
+{{#isCollection}}
+{{>partials/collection}}
+{{/isCollection}}
+{{#isItem}}
+{{>partials/item}}
+{{/isItem}}
+{{/_splitReference}}

+ 19 - 0
docfx/templates/modern/partials/enum.tmpl.partial

@@ -0,0 +1,19 @@
+{{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}}
+
+{{>partials/class.header}}
+
+{{#seealso.0}}
+<h2 id="seealso">{{__global.seealso}}</h2>
+<div class="seealso">
+{{/seealso.0}}
+{{#seealso}}
+  {{#isCref}}
+    <div>{{{type.specName.0.value}}}</div>
+  {{/isCref}}
+  {{^isCref}}
+    <div>{{{url}}}</div>
+  {{/isCref}}
+{{/seealso}}
+{{#seealso.0}}
+</div>
+{{/seealso.0}}

+ 3 - 0
docfx/templates/modern/partials/item.tmpl.partial

@@ -0,0 +1,3 @@
+{{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}}
+
+{{>partials/class.header}}

+ 16 - 0
docfx/templates/modern/partials/namespace.tmpl.partial

@@ -0,0 +1,16 @@
+{{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}}
+
+<h1 id="{{id}}" data-uid="{{uid}}" class="text-break">{{>partials/title}}</h1>
+<div class="markdown level0 summary">{{{summary}}}</div>
+<div class="markdown level0 conceptual">{{{conceptual}}}</div>
+<div class="markdown level0 remarks">{{{remarks}}}</div>
+
+{{#children}}
+  <h3 id="{{id}}">{{>partials/namespaceSubtitle}}</h3>
+  {{#children}}
+  <dl class="jumplist">
+    <dt><xref uid="{{uid}}" altProperty="fullName" displayProperty="name"/></dt>
+    <dd>{{{summary}}}</dd>
+  </dl>
+  {{/children}}
+{{/children}}

BIN
docfx/templates/modern/public/bootstrap-icons-BNVXHMH5.woff


BIN
docfx/templates/modern/public/bootstrap-icons-UDRIHJCM.woff2


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
docfx/templates/modern/public/c4Diagram-817c8e44-SGFOBFRD.min.js


Разница между файлами не показана из-за своего большого размера
+ 3 - 0
docfx/templates/modern/public/c4Diagram-817c8e44-SGFOBFRD.min.js.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
docfx/templates/modern/public/chunk-334IV3XH.min.js


Разница между файлами не показана из-за своего большого размера
+ 3 - 0
docfx/templates/modern/public/chunk-334IV3XH.min.js.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
docfx/templates/modern/public/chunk-3RELVOUY.min.js


Разница между файлами не показана из-за своего большого размера
+ 3 - 0
docfx/templates/modern/public/chunk-3RELVOUY.min.js.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
docfx/templates/modern/public/chunk-CK25GZVZ.min.js


Разница между файлами не показана из-за своего большого размера
+ 3 - 0
docfx/templates/modern/public/chunk-CK25GZVZ.min.js.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
docfx/templates/modern/public/chunk-CXT7N4L6.min.js


Разница между файлами не показана из-за своего большого размера
+ 3 - 0
docfx/templates/modern/public/chunk-CXT7N4L6.min.js.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
docfx/templates/modern/public/chunk-DALFUHAB.min.js


Разница между файлами не показана из-за своего большого размера
+ 2 - 0
docfx/templates/modern/public/chunk-DALFUHAB.min.js.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
docfx/templates/modern/public/chunk-EKFGDCJ4.min.js


Разница между файлами не показана из-за своего большого размера
+ 2 - 0
docfx/templates/modern/public/chunk-EKFGDCJ4.min.js.map


+ 2 - 0
docfx/templates/modern/public/chunk-F7JJDB3C.min.js

@@ -0,0 +1,2 @@
+import{Ha as o,c as l}from"./chunk-YICCS3KT.min.js";import{d as c}from"./chunk-P42HNYSU.min.js";var i=c(l(),1);var x=(s,t)=>{let r=s.append("rect");if(r.attr("x",t.x),r.attr("y",t.y),r.attr("fill",t.fill),r.attr("stroke",t.stroke),r.attr("width",t.width),r.attr("height",t.height),t.rx!==void 0&&r.attr("rx",t.rx),t.ry!==void 0&&r.attr("ry",t.ry),t.attrs!==void 0)for(let e in t.attrs)r.attr(e,t.attrs[e]);return t.class!==void 0&&r.attr("class",t.class),r},h=(s,t)=>{let r={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(s,r).lower()},y=(s,t)=>{let r=t.text.replace(o," "),e=s.append("text");e.attr("x",t.x),e.attr("y",t.y),e.attr("class","legend"),e.style("text-anchor",t.anchor),t.class!==void 0&&e.attr("class",t.class);let n=e.append("tspan");return n.attr("x",t.x+t.textMargin*2),n.text(r),e},p=(s,t,r,e)=>{let n=s.append("image");n.attr("x",t),n.attr("y",r);let a=(0,i.sanitizeUrl)(e);n.attr("xlink:href",a)},g=(s,t,r,e)=>{let n=s.append("use");n.attr("x",t),n.attr("y",r);let a=(0,i.sanitizeUrl)(e);n.attr("xlink:href",`#${a}`)},m=()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),f=()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0});export{x as a,h as b,y as c,p as d,g as e,m as f,f as g};
+//# sourceMappingURL=chunk-F7JJDB3C.min.js.map

Разница между файлами не показана из-за своего большого размера
+ 3 - 0
docfx/templates/modern/public/chunk-F7JJDB3C.min.js.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
docfx/templates/modern/public/chunk-I64Z623A.min.js


Разница между файлами не показана из-за своего большого размера
+ 3 - 0
docfx/templates/modern/public/chunk-I64Z623A.min.js.map


+ 2 - 0
docfx/templates/modern/public/chunk-P42HNYSU.min.js

@@ -0,0 +1,2 @@
+var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),o=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},l=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var p=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a));export{m as a,n as b,o as c,p as d};
+//# sourceMappingURL=chunk-P42HNYSU.min.js.map

+ 7 - 0
docfx/templates/modern/public/chunk-P42HNYSU.min.js.map

@@ -0,0 +1,7 @@
+{
+  "version": 3,
+  "sources": [],
+  "sourcesContent": [],
+  "mappings": "",
+  "names": []
+}

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
docfx/templates/modern/public/chunk-U66T5BMR.min.js


Разница между файлами не показана из-за своего большого размера
+ 3 - 0
docfx/templates/modern/public/chunk-U66T5BMR.min.js.map


Некоторые файлы не были показаны из-за большого количества измененных файлов