-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Application Compatibility Flags Howto Sample for .NET Core #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
fac3f28
Add AppCompat-Quirks project
vatsan-madhavan a454d82
Merge branch 'master' into users/vatsan/appcompat-quirks
vatsan-madhavan 0a73dc2
Add TFM to AppCompat-Quirks proj
vatsan-madhavan 006f25c
Rename app manifest
vatsan-madhavan 05627e5
Addressing feedback
vatsan-madhavan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<!-- | ||
Licensed to the .NET Foundation under one or more agreements. | ||
The .NET Foundation licenses this file to you under the MIT license. | ||
See the LICENSE file in the project root for more information. | ||
--> | ||
|
||
<!-- | ||
This file *must* be named App.config, and not App1.config etc. | ||
--> | ||
<!-- | ||
This is the list of application compatibility switches in WPF that are set via App.Config. | ||
The values shown below are the defaults for the respective switch. | ||
--> | ||
<configuration> | ||
<appSettings> | ||
<!-- Defined in System.Windows.CoreCompatibilityPreferences --> | ||
|
||
<!--https://docs.microsoft.com/en-us/dotnet/api/system.windows.corecompatibilitypreferences.isaltkeyrequiredinaccesskeydefaultscope?view=netcore-3.0--> | ||
<!--<add key="IsAltKeyRequiredInAccessKeyDefaultScope" value="false"/>--> | ||
|
||
<!--https://docs.microsoft.com/en-us/dotnet/api/system.windows.corecompatibilitypreferences.enablemultimonitordisplayclipping?view=netcore-3.0#System_Windows_CoreCompatibilityPreferences_EnableMultiMonitorDisplayClipping--> | ||
<!--<add key="EnableMultiMonitorDisplayClipping" value="null"/>--> | ||
|
||
<!--GlyphRun.ComputeInkBoundingBox is supposed to return a box that contains | ||
all the ink in the GlyphRun, but in some circumstances it computes a | ||
box that is too small. This was "fixed" in 4.5 by inflating the box | ||
slightly. Apps that depend on the old non-inflated result can opt out | ||
of the fix by setting this to 'false'--> | ||
<!--<add key="IncludeAllInkInBoundingBox" value="true"/>--> | ||
|
||
|
||
|
||
<!-- Defined in System.Windows.BaseCompatibilityPreferences --> | ||
|
||
<!--https://docs.microsoft.com/en-us/dotnet/api/system.windows.basecompatibilitypreferences.reusedispatchersynchronizationcontextinstance?view=netframework-4.8#System_Windows_BaseCompatibilityPreferences_ReuseDispatcherSynchronizationContextInstance--> | ||
<!--<add key="ReuseDispatcherSynchronizationContextInstance" value="false"/>--> | ||
|
||
<!--https://docs.microsoft.com/en-us/dotnet/api/system.windows.basecompatibilitypreferences.flowdispatchersynchronizationcontextpriority?view=netframework-4.8#System_Windows_BaseCompatibilityPreferences_FlowDispatcherSynchronizationContextPriority--> | ||
<!--<add key="FlowDispatcherSynchronizationContextPriority" value="true"/>--> | ||
|
||
<!--https://docs.microsoft.com/en-us/dotnet/api/system.windows.basecompatibilitypreferences.inlinedispatchersynchronizationcontextsend?view=netframework-4.8#System_Windows_BaseCompatibilityPreferences_InlineDispatcherSynchronizationContextSend--> | ||
<!--<add key="InlineDispatcherSynchronizationContextSend" value="true"/>--> | ||
|
||
<!--https://docs.microsoft.com/en-us/dotnet/api/system.windows.basecompatibilitypreferences.handledispatcherrequestprocessingfailure?view=netframework-4.8#System_Windows_BaseCompatibilityPreferences_HandleDispatcherRequestProcessingFailure--> | ||
<!--<add key="HandleDispatcherRequestProcessingFailure" value="Continue"/>--> | ||
|
||
<!--Instructs WPF to not attempt to set an equivalent XML package signature method for a given digest hash algorithm. | ||
This affects the signing and digest methods used in the packaging APIs. With this set to false, signature methods | ||
will always be SHA1.--> | ||
<!--<add key="MatchPackageSignatureMethodToPackagePartDigestMethod" value="true"/>--> | ||
|
||
|
||
<!-- Defined in System.Windows.FrameworkCompatibilityPreferenes --> | ||
|
||
<!--https://docs.microsoft.com/en-us/dotnet/api/system.windows.frameworkcompatibilitypreferences.areinactiveselectionhighlightbrushkeyssupported?view=netframework-4.8#System_Windows_FrameworkCompatibilityPreferences_AreInactiveSelectionHighlightBrushKeysSupported--> | ||
<!--<add key="AreInactiveSelectionHighlightBrushKeysSupported" value="true"/>--> | ||
|
||
<!--https://docs.microsoft.com/en-us/dotnet/api/system.windows.frameworkcompatibilitypreferences.keeptextboxdisplaysynchronizedwithtextproperty?view=netframework-4.8#System_Windows_FrameworkCompatibilityPreferences_KeepTextBoxDisplaySynchronizedWithTextProperty--> | ||
<!--<add key="KeepTextBoxDisplaySynchronizedWithTextProperty" value="true"/>--> | ||
|
||
<!--https://docs.microsoft.com/en-us/dotnet/api/system.windows.frameworkcompatibilitypreferences.shouldthrowoncopyorcutfailure?view=netframework-4.8#System_Windows_FrameworkCompatibilityPreferences_ShouldThrowOnCopyOrCutFailure--> | ||
<!--<add key="ShouldThrowOnCopyOrCutFailure" value="false"/>--> | ||
|
||
<!-- | ||
Possible values are: | ||
- Throw (.NET 4.0 behavior) | ||
- Allow (default .NET 4.5+, .NET core behavior) | ||
- Disallow | ||
--> | ||
<!--<add key="HandleTwoWayBindingToPropertyWithNonPublicSetter" value="Allow"/>--> | ||
|
||
<!--There is a bug in the Windows desktop window manager which can cause | ||
incorrect z-order for windows when several conditions are all met: | ||
(a) windows are parented/owned across different threads or processes | ||
(b) a parent/owner window is also owner of a topmost window (which needn't be visible) | ||
(c) the child window on a different thread/process tries to show an owned topmost window | ||
(like a popup or tooltip) using ShowWindow(). | ||
To avoid this window manager bug, this option causes SetWindowPos() to be used instead of | ||
ShowWindow() for topmost windows, avoiding condition (c). Ideally the window manager bug | ||
will be fixed, but the risk of making a change there is considered too great at this time.--> | ||
<!--<add key="UseSetWindowPosForTopmostWindows" value="false"/>--> | ||
|
||
<!--VirtualizingStackPanel added support for virtualization-when-grouping in .NET 4.5, | ||
generalizing and subsuming the support for virtualizing a TreeView that existed in .NET 4.0. | ||
The 4.5 algorithm had many flaws, leading to infinite loops, scrolling | ||
to the wrong place, and other bad symptoms. DDCC is worried that fixing | ||
these issues may introduce new compat problems, and asked for a way to opt out | ||
of the fixes. To opt out, set this flag to 'true' in App.Config--> | ||
<!--<add key="VSP45Compat" value="false"/>--> | ||
|
||
</appSettings> | ||
</configuration> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!-- | ||
Licensed to the .NET Foundation under one or more agreements. | ||
The .NET Foundation licenses this file to you under the MIT license. | ||
See the LICENSE file in the project root for more information. | ||
--> | ||
<Application x:Class="Wpf_AppCompat_Quirks.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:Wpf_AppCompat_Quirks" | ||
StartupUri="MainWindow.xaml"> | ||
<Application.Resources> | ||
|
||
</Application.Resources> | ||
</Application> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Configuration; | ||
using System.Data; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
|
||
namespace Wpf_AppCompat_Quirks | ||
{ | ||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> | ||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.0</TargetFramework> | ||
<OutputType>WinExe</OutputType> | ||
<RootNamespace>AppCompat_Quirks</RootNamespace> | ||
<UseWPF>true</UseWPF> | ||
<ApplicationManifest>app.manifest</ApplicationManifest> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
namespace Wpf_AppCompat_Quirks | ||
{ | ||
public class CompatSwitchInformation | ||
{ | ||
public string Class { get; set; } | ||
public string SwitchName { get; set; } | ||
public string DefaultValue { get; set; } | ||
public string SettingsSource { get; set; } | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!-- | ||
Licensed to the .NET Foundation under one or more agreements. | ||
The .NET Foundation licenses this file to you under the MIT license. | ||
See the LICENSE file in the project root for more information. | ||
--> | ||
<Window x:Class="Wpf_AppCompat_Quirks.MainWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:local="clr-namespace:Wpf_AppCompat_Quirks" | ||
mc:Ignorable="d" | ||
Loaded="Window_Loaded" | ||
Title="Application Compatibility Switches HOWTO Sample" Height="800" Width="900"> | ||
<ScrollViewer> | ||
<StackPanel> | ||
<Label> | ||
<TextBlock TextWrapping="Wrap"> | ||
See <Run FontWeight="Bold">runtimeconfig.template.json</Run> and <Run FontWeight="Bold">App.config</Run> for a list of supported application compatibility switches, alongwith the respective default values on .NET Core. | ||
</TextBlock> | ||
</Label> | ||
<DataGrid ItemsSource="{Binding AppContextSwitches}" /> | ||
<DataGrid ItemsSource="{Binding CompatibilityPreferences}" /> | ||
</StackPanel> | ||
</ScrollViewer> | ||
|
||
</Window> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.