forked from microsoft/WPF-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Application Compatibility Flags Howto Sample for .NET Core (microsoft#87
- Loading branch information
1 parent
56aec4c
commit bae3a98
Showing
12 changed files
with
987 additions
and
549 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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.