├── .gitattributes ├── .gitignore ├── .upgrade-assistant ├── AirspaceFixer.sln ├── AirspaceFixer ├── AirspaceFixer.csproj ├── AirspacePanel.cs ├── LICENSE.txt ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── Readme.md └── Themes │ ├── AirspacePanel.xaml │ └── Generic.xaml ├── AirspaceFixerSample ├── AirspaceFixerSample.csproj ├── App.config ├── App.xaml ├── App.xaml.cs ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── app.manifest └── packages.config ├── AirspaceFixerSampleNet6 ├── AirspaceFixerSampleNet6.csproj ├── App.xaml ├── App.xaml.cs ├── AssemblyInfo.cs ├── MainWindow.xaml └── MainWindow.xaml.cs ├── AnalysisReport.sarif ├── LICENSE ├── Readme.md └── upgrade-assistant.clef /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | build/ 21 | bld/ 22 | [Bb]in/ 23 | [Oo]bj/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opensdf 80 | *.sdf 81 | *.cachefile 82 | 83 | # Visual Studio profiler 84 | *.psess 85 | *.vsp 86 | *.vspx 87 | *.sap 88 | 89 | # TFS 2012 Local Workspace 90 | $tf/ 91 | 92 | # Guidance Automation Toolkit 93 | *.gpState 94 | 95 | # ReSharper is a .NET coding add-in 96 | _ReSharper*/ 97 | *.[Rr]e[Ss]harper 98 | *.DotSettings.user 99 | 100 | # JustCode is a .NET coding add-in 101 | .JustCode 102 | 103 | # TeamCity is a build add-in 104 | _TeamCity* 105 | 106 | # DotCover is a Code Coverage Tool 107 | *.dotCover 108 | 109 | # NCrunch 110 | _NCrunch_* 111 | .*crunch*.local.xml 112 | nCrunchTemp_* 113 | 114 | # MightyMoose 115 | *.mm.* 116 | AutoTest.Net/ 117 | 118 | # Web workbench (sass) 119 | .sass-cache/ 120 | 121 | # Installshield output folder 122 | [Ee]xpress/ 123 | 124 | # DocProject is a documentation generator add-in 125 | DocProject/buildhelp/ 126 | DocProject/Help/*.HxT 127 | DocProject/Help/*.HxC 128 | DocProject/Help/*.hhc 129 | DocProject/Help/*.hhk 130 | DocProject/Help/*.hhp 131 | DocProject/Help/Html2 132 | DocProject/Help/html 133 | 134 | # Click-Once directory 135 | publish/ 136 | 137 | # Publish Web Output 138 | *.[Pp]ublish.xml 139 | *.azurePubxml 140 | # TODO: Comment the next line if you want to checkin your web deploy settings 141 | # but database connection strings (with potential passwords) will be unencrypted 142 | *.pubxml 143 | *.publishproj 144 | 145 | # NuGet Packages 146 | *.nupkg 147 | # The packages folder can be ignored because of Package Restore 148 | **/packages/* 149 | # except build/, which is used as an MSBuild target. 150 | !**/packages/build/ 151 | # Uncomment if necessary however generally it will be regenerated when needed 152 | #!**/packages/repositories.config 153 | 154 | # Windows Azure Build Output 155 | csx/ 156 | *.build.csdef 157 | 158 | # Windows Azure Emulator 159 | efc/ 160 | rfc/ 161 | 162 | # Windows Store app package directory 163 | AppPackages/ 164 | 165 | # Visual Studio cache files 166 | # files ending in .cache can be ignored 167 | *.[Cc]ache 168 | # but keep track of directories ending in .cache 169 | !*.[Cc]ache/ 170 | 171 | # Others 172 | ClientBin/ 173 | [Ss]tyle[Cc]op.* 174 | ~$* 175 | *~ 176 | *.dbmdl 177 | *.dbproj.schemaview 178 | *.pfx 179 | *.publishsettings 180 | node_modules/ 181 | orleans.codegen.cs 182 | 183 | # RIA/Silverlight projects 184 | Generated_Code/ 185 | 186 | # Backup & report files from converting an old project file 187 | # to a newer Visual Studio version. Backup files are not needed, 188 | # because we have git ;-) 189 | _UpgradeReport_Files/ 190 | Backup*/ 191 | UpgradeLog*.XML 192 | UpgradeLog*.htm 193 | 194 | # SQL Server files 195 | *.mdf 196 | *.ldf 197 | 198 | # Business Intelligence projects 199 | *.rdl.data 200 | *.bim.layout 201 | *.bim_*.settings 202 | 203 | # Microsoft Fakes 204 | FakesAssemblies/ 205 | 206 | # GhostDoc plugin setting file 207 | *.GhostDoc.xml 208 | 209 | # Node.js Tools for Visual Studio 210 | .ntvs_analysis.dat 211 | 212 | # Visual Studio 6 build log 213 | *.plg 214 | 215 | # Visual Studio 6 workspace options file 216 | *.opt 217 | 218 | # Visual Studio LightSwitch build output 219 | **/*.HTMLClient/GeneratedArtifacts 220 | **/*.DesktopClient/GeneratedArtifacts 221 | **/*.DesktopClient/ModelManifest.xml 222 | **/*.Server/GeneratedArtifacts 223 | **/*.Server/ModelManifest.xml 224 | _Pvt_Extensions 225 | 226 | # Paket dependency manager 227 | .paket/paket.exe 228 | 229 | # FAKE - F# Make 230 | .fake/ 231 | 232 | # ========================= 233 | # Operating System Files 234 | # ========================= 235 | 236 | # OSX 237 | # ========================= 238 | 239 | .DS_Store 240 | .AppleDouble 241 | .LSOverride 242 | 243 | # Thumbnails 244 | ._* 245 | 246 | # Files that might appear in the root of a volume 247 | .DocumentRevisions-V100 248 | .fseventsd 249 | .Spotlight-V100 250 | .TemporaryItems 251 | .Trashes 252 | .VolumeIcon.icns 253 | 254 | # Directories potentially created on remote AFP share 255 | .AppleDB 256 | .AppleDesktop 257 | Network Trash Folder 258 | Temporary Items 259 | .apdisk 260 | 261 | # Windows 262 | # ========================= 263 | 264 | # Windows image file caches 265 | Thumbs.db 266 | ehthumbs.db 267 | 268 | # Folder config file 269 | Desktop.ini 270 | 271 | # Recycle Bin used on file shares 272 | $RECYCLE.BIN/ 273 | 274 | # Windows Installer files 275 | *.cab 276 | *.msi 277 | *.msm 278 | *.msp 279 | 280 | # Windows shortcuts 281 | *.lnk 282 | -------------------------------------------------------------------------------- /.upgrade-assistant: -------------------------------------------------------------------------------- 1 | {"Build":"0.3.326103\u002B3dfe0925b5198e8bb4cae20f02bfd968e95eb1e8","CurrentProject":"AirspaceFixer.csproj","EntryPoints":["AirspaceFixer.csproj"],"Properties":{}} -------------------------------------------------------------------------------- /AirspaceFixer.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.32126.317 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AirspaceFixer", "AirspaceFixer\AirspaceFixer.csproj", "{9B83BCF9-6835-490D-91BE-2334BC1A548C}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AirspaceFixerSample", "AirspaceFixerSample\AirspaceFixerSample.csproj", "{FEFA7E80-EDE6-492B-B18D-0BFD04EBF846}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AirspaceFixerSampleNet6", "AirspaceFixerSampleNet6\AirspaceFixerSampleNet6.csproj", "{51E0427B-066F-4055-ABAA-B11B2672C42F}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {9B83BCF9-6835-490D-91BE-2334BC1A548C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {9B83BCF9-6835-490D-91BE-2334BC1A548C}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {9B83BCF9-6835-490D-91BE-2334BC1A548C}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {9B83BCF9-6835-490D-91BE-2334BC1A548C}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {FEFA7E80-EDE6-492B-B18D-0BFD04EBF846}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {FEFA7E80-EDE6-492B-B18D-0BFD04EBF846}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {FEFA7E80-EDE6-492B-B18D-0BFD04EBF846}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {FEFA7E80-EDE6-492B-B18D-0BFD04EBF846}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {51E0427B-066F-4055-ABAA-B11B2672C42F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {51E0427B-066F-4055-ABAA-B11B2672C42F}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {51E0427B-066F-4055-ABAA-B11B2672C42F}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {51E0427B-066F-4055-ABAA-B11B2672C42F}.Release|Any CPU.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {011E0719-2EB0-42C4-8D2E-9E483E577B22} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /AirspaceFixer/AirspaceFixer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net6.0-windows;net452 4 | Library 5 | false 6 | true 7 | true 8 | true 9 | True 10 | 1.1.0 11 | ChrisBJohnsonDev 12 | ChrisBJohnsonDev 13 | AirspacePanel fixes all Airspace issues with WPF-hosted Winforms. 14 | https://github.com/chris84948/AirspaceFixer 15 | https://github.com/chris84948/AirspaceFixer 16 | git 17 | Removing unnecessary code 18 | LICENSE.txt 19 | Readme.md 20 | True 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | all 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /AirspaceFixer/AirspacePanel.cs: -------------------------------------------------------------------------------- 1 | using System.Drawing.Imaging; 2 | using System.IO; 3 | using System.Windows; 4 | using System.Windows.Controls; 5 | using System.Windows.Media; 6 | using System.Windows.Media.Imaging; 7 | 8 | namespace AirspaceFixer 9 | { 10 | public class AirspacePanel : ContentControl 11 | { 12 | public static readonly DependencyProperty FixAirspaceProperty = 13 | DependencyProperty.Register("FixAirspace", 14 | typeof(bool), 15 | typeof(AirspacePanel), 16 | new FrameworkPropertyMetadata(false, new PropertyChangedCallback(OnFixAirspaceChanged))); 17 | public bool FixAirspace 18 | { 19 | get { return (bool)GetValue(FixAirspaceProperty); } 20 | set { SetValue(FixAirspaceProperty, value); } 21 | } 22 | 23 | private Image airspaceScreenshot; 24 | private ContentControl airspaceContent; 25 | 26 | static AirspacePanel() 27 | { 28 | DefaultStyleKeyProperty.OverrideMetadata(typeof(AirspacePanel), new FrameworkPropertyMetadata(typeof(AirspacePanel))); 29 | } 30 | 31 | public override void OnApplyTemplate() 32 | { 33 | base.OnApplyTemplate(); 34 | 35 | airspaceContent = GetTemplateChild("PART_AirspaceContent") as ContentControl; 36 | airspaceScreenshot = GetTemplateChild("PART_AirspaceScreenshot") as Image; 37 | } 38 | 39 | private void AirspacePanel_SizeChanged(object sender, SizeChangedEventArgs e) 40 | { 41 | // On resize, make sure to update the image 42 | if (FixAirspace) 43 | FixAirspaceShared(true); 44 | } 45 | 46 | private static void OnFixAirspaceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 47 | { 48 | if (d is AirspacePanel panel) 49 | panel.FixAirspaceShared((bool)e.NewValue); 50 | } 51 | 52 | private void FixAirspaceShared(bool fix) 53 | { 54 | if (ActualWidth == 0 || ActualHeight == 0 || PresentationSource.FromVisual(this) == null) 55 | return; 56 | 57 | if (fix) 58 | { 59 | CreateScreenshotFromContent(); 60 | airspaceContent.Visibility = Visibility.Hidden; 61 | airspaceScreenshot.Visibility = Visibility.Visible; 62 | } 63 | else 64 | { 65 | airspaceContent.Visibility = Visibility.Visible; 66 | airspaceScreenshot.Visibility = Visibility.Hidden; 67 | airspaceScreenshot.Source = null; 68 | } 69 | } 70 | 71 | private void CreateScreenshotFromContent() 72 | { 73 | // https://stackoverflow.com/questions/1918877/how-can-i-get-the-dpi-in-wpf 74 | double scalingFactor = PresentationSource.FromVisual(this)?.CompositionTarget?.TransformToDevice.M11 ?? 1.0; 75 | 76 | Point upperLeftPoint = airspaceContent.PointToScreen(new Point(0, 0)); 77 | var bounds = new System.Drawing.Rectangle((int)(upperLeftPoint.X * scalingFactor), 78 | (int)(upperLeftPoint.Y * scalingFactor), 79 | (int)(airspaceContent.RenderSize.Width * scalingFactor), 80 | (int)(airspaceContent.RenderSize.Height * scalingFactor)); 81 | 82 | if (bounds.Width == 0 || bounds.Height == 0) 83 | return; 84 | 85 | using (var bitmap = new System.Drawing.Bitmap((int)bounds.Width, (int)bounds.Height)) 86 | { 87 | using (var g = System.Drawing.Graphics.FromImage(bitmap)) 88 | { 89 | g.CopyFromScreen(new System.Drawing.Point(bounds.Left, bounds.Top), 90 | System.Drawing.Point.Empty, 91 | new System.Drawing.Size((int)bounds.Width, (int)bounds.Height)); 92 | } 93 | 94 | airspaceScreenshot.Source = GetImageSourceFromBitmap(bitmap); 95 | } 96 | } 97 | 98 | public ImageSource GetImageSourceFromBitmap(System.Drawing.Bitmap bitmap) 99 | { 100 | using (var memory = new MemoryStream()) 101 | { 102 | bitmap.Save(memory, ImageFormat.Png); 103 | memory.Position = 0; 104 | BitmapImage bitmapImage = new BitmapImage(); 105 | bitmapImage.BeginInit(); 106 | bitmapImage.StreamSource = memory; 107 | bitmapImage.CacheOption = BitmapCacheOption.OnLoad; 108 | bitmapImage.EndInit(); 109 | return bitmapImage; 110 | } 111 | } 112 | } 113 | } -------------------------------------------------------------------------------- /AirspaceFixer/LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 chris84948 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /AirspaceFixer/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("AirspaceFixer")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("AirspaceFixer")] 15 | [assembly: AssemblyCopyright("Copyright © 2022")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly:ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.1.0")] 55 | [assembly: AssemblyFileVersion("1.1.0")] 56 | 57 | #if NET6_0_OR_GREATER 58 | [assembly: System.Runtime.Versioning.TargetPlatform("Windows7.0")] 59 | [assembly: System.Runtime.Versioning.SupportedOSPlatform("Windows7.0")] 60 | #endif -------------------------------------------------------------------------------- /AirspaceFixer/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace AirspaceFixer.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AirspaceFixer.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /AirspaceFixer/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /AirspaceFixer/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace AirspaceFixer.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /AirspaceFixer/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /AirspaceFixer/Readme.md: -------------------------------------------------------------------------------- 1 | ## Airspace Fixer 2 | 3 | AirspaceFixer is a small lightweight project that only contains a single control - `AirspacePanel`. 4 | 5 | If you've ever had to host any WinForms forms inside a WPF project, you might know about the dreaded Airspace problem. Basically, the WinForms control **must** always be on top. Even if you try to put a modal dialog on top of the WinForms control, this Airspace issue forces the WinForms control on top. 6 | 7 | Now, you may be thinking, WinForms, gross, I'll never do that, well, me too, but I had to use the `WebBrowser` control recently, and since it's a legacy control (made in WinForms), the same Airspace problem applies. 8 | 9 | `AirspacePanel` aims to fix this problem by allowing you to host any content you like inside of it, and swapping out the content for a screenshot of the content when you need to place a modal dialog on top of it. This swap is done by using the dependency property `FixAirspace`. Here's an example - 10 | 11 | xmlns:asf="clr-namespace:AirspaceFixer;assembly=AirspaceFixer" 12 | 13 | 14 | 15 | 16 | 17 | See the sample app for more info on how to use it. 18 | 19 | AirspaceFixer is also available in Nuget to include as a package. -------------------------------------------------------------------------------- /AirspaceFixer/Themes/AirspacePanel.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 23 | 24 | -------------------------------------------------------------------------------- /AirspaceFixer/Themes/Generic.xaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /AirspaceFixerSample/AirspaceFixerSample.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {FEFA7E80-EDE6-492B-B18D-0BFD04EBF846} 8 | WinExe 9 | Properties 10 | AirspaceFixerSample 11 | AirspaceFixerSample 12 | v4.8 13 | 512 14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 15 | 4 16 | true 17 | publish\ 18 | true 19 | Disk 20 | false 21 | Foreground 22 | 7 23 | Days 24 | false 25 | false 26 | true 27 | 0 28 | 1.0.0.%2a 29 | false 30 | false 31 | true 32 | 33 | 34 | 35 | AnyCPU 36 | true 37 | full 38 | false 39 | bin\Debug\ 40 | DEBUG;TRACE 41 | prompt 42 | 4 43 | 44 | 45 | AnyCPU 46 | pdbonly 47 | true 48 | bin\Release\ 49 | TRACE 50 | prompt 51 | 4 52 | 53 | 54 | 55 | app.manifest 56 | 57 | 58 | 59 | ..\packages\JustMVVM.1.0.1\lib\JustMVVM.dll 60 | True 61 | 62 | 63 | ..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll 64 | True 65 | 66 | 67 | 68 | 69 | 70 | ..\packages\MahApps.Metro.1.5.0\lib\net45\System.Windows.Interactivity.dll 71 | True 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 4.0 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | MSBuild:Compile 89 | Designer 90 | 91 | 92 | MSBuild:Compile 93 | Designer 94 | 95 | 96 | App.xaml 97 | Code 98 | 99 | 100 | MainWindow.xaml 101 | Code 102 | 103 | 104 | 105 | 106 | Code 107 | 108 | 109 | True 110 | True 111 | Resources.resx 112 | 113 | 114 | True 115 | Settings.settings 116 | True 117 | 118 | 119 | ResXFileCodeGenerator 120 | Resources.Designer.cs 121 | 122 | 123 | 124 | 125 | SettingsSingleFileGenerator 126 | Settings.Designer.cs 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | {9b83bcf9-6835-490d-91be-2334bc1a548c} 136 | AirspaceFixer 137 | 138 | 139 | 140 | 141 | False 142 | Microsoft .NET Framework 4.5.2 %28x86 and x64%29 143 | true 144 | 145 | 146 | False 147 | .NET Framework 3.5 SP1 148 | false 149 | 150 | 151 | 152 | 159 | -------------------------------------------------------------------------------- /AirspaceFixerSample/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /AirspaceFixerSample/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | -------------------------------------------------------------------------------- /AirspaceFixerSample/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace AirspaceFixerSample 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /AirspaceFixerSample/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |