-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1864 from dotnet/main
Merge main into live
- Loading branch information
Showing
84 changed files
with
2,188 additions
and
304 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
39 changes: 21 additions & 18 deletions
39
...esktop-guide/framework/wpf/advanced/how-to-detect-when-the-enter-key-pressed.md
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
8 changes: 8 additions & 0 deletions
8
.../framework/wpf/advanced/snippets/how-to-detect-when-the-enter-key-pressed/csharp/App.xaml
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,8 @@ | ||
<Application x:Class="SDKSamples.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
StartupUri="MainWindow.xaml"> | ||
<Application.Resources> | ||
|
||
</Application.Resources> | ||
</Application> |
14 changes: 14 additions & 0 deletions
14
...amework/wpf/advanced/snippets/how-to-detect-when-the-enter-key-pressed/csharp/App.xaml.cs
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 @@ | ||
using System.Configuration; | ||
using System.Data; | ||
using System.Windows; | ||
|
||
namespace SDKSamples | ||
{ | ||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
...ork/wpf/advanced/snippets/how-to-detect-when-the-enter-key-pressed/csharp/AssemblyInfo.cs
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 @@ | ||
using System.Windows; | ||
|
||
[assembly:ThemeInfo( | ||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located | ||
//(used if a resource is not found in the page, | ||
// or application resource dictionaries) | ||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located | ||
//(used if a resource is not found in the page, | ||
// app, or any theme specific resource dictionaries) | ||
)] |
14 changes: 14 additions & 0 deletions
14
...ork/wpf/advanced/snippets/how-to-detect-when-the-enter-key-pressed/csharp/MainWindow.xaml
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 @@ | ||
<Window x:Class="SDKSamples.MainWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
Title="Example" Width="360" Height="180" SizeToContent="Height" ResizeMode="NoResize" Loaded="Window_Loaded"> | ||
<Grid> | ||
<!--<example>--> | ||
<StackPanel> | ||
<TextBlock Width="300" Height="20" Text="Type some text into the TextBox and press the Enter key." /> | ||
<TextBox Width="300" Height="30" Name="textBox1" KeyDown="textBox1_KeyDown" /> | ||
<TextBlock Width="300" Height="100" Name="textBlock1" /> | ||
</StackPanel> | ||
<!--</example>--> | ||
</Grid> | ||
</Window> |
30 changes: 30 additions & 0 deletions
30
.../wpf/advanced/snippets/how-to-detect-when-the-enter-key-pressed/csharp/MainWindow.xaml.cs
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,30 @@ | ||
//<full> | ||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Input; | ||
|
||
namespace SDKSamples | ||
{ | ||
public partial class MainWindow : Window | ||
{ | ||
public MainWindow() => | ||
InitializeComponent(); | ||
|
||
private void Window_Loaded(object sender, RoutedEventArgs e) | ||
{ | ||
} | ||
|
||
//<handler> | ||
private void textBox1_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) | ||
{ | ||
if (e.Key == Key.Enter) | ||
{ | ||
textBlock1.Text = $"You Entered: {textBox1.Text}"; | ||
} | ||
} | ||
//</handler> | ||
} | ||
} | ||
//</full> |
11 changes: 11 additions & 0 deletions
11
...rk/wpf/advanced/snippets/how-to-detect-when-the-enter-key-pressed/csharp/ProjectCS.csproj
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,11 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>net481</TargetFramework> | ||
<UseWPF>true</UseWPF> | ||
<RootNamespace>SDKSamples</RootNamespace> | ||
<ApplicationManifest>app.manifest</ApplicationManifest> | ||
</PropertyGroup> | ||
|
||
</Project> |
77 changes: 77 additions & 0 deletions
77
...mework/wpf/advanced/snippets/how-to-detect-when-the-enter-key-pressed/csharp/app.manifest
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,77 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/> | ||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> | ||
<security> | ||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> | ||
<!-- UAC Manifest Options | ||
If you want to change the Windows User Account Control level replace the | ||
requestedExecutionLevel node with one of the following. | ||
<requestedExecutionLevel level="asInvoker" uiAccess="false" /> | ||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> | ||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" /> | ||
Specifying requestedExecutionLevel element will disable file and registry virtualization. | ||
Remove this element if your application requires this virtualization for backwards | ||
compatibility. | ||
--> | ||
<requestedExecutionLevel level="asInvoker" uiAccess="false" /> | ||
</requestedPrivileges> | ||
</security> | ||
</trustInfo> | ||
|
||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> | ||
<application> | ||
<!-- A list of the Windows versions that this application has been tested on | ||
and is designed to work with. Uncomment the appropriate elements | ||
and Windows will automatically select the most compatible environment. --> | ||
|
||
<!-- Windows Vista --> | ||
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />--> | ||
|
||
<!-- Windows 7 --> | ||
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />--> | ||
|
||
<!-- Windows 8 --> | ||
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />--> | ||
|
||
<!-- Windows 8.1 --> | ||
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />--> | ||
|
||
<!-- Windows 10 --> | ||
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />--> | ||
|
||
</application> | ||
</compatibility> | ||
|
||
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher | ||
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need | ||
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should | ||
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. | ||
Makes the application long-path aware. See https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation --> | ||
<!-- | ||
<application xmlns="urn:schemas-microsoft-com:asm.v3"> | ||
<windowsSettings> | ||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware> | ||
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware> | ||
</windowsSettings> | ||
</application> | ||
--> | ||
|
||
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) --> | ||
<dependency> | ||
<dependentAssembly> | ||
<assemblyIdentity | ||
type="win32" | ||
name="Microsoft.Windows.Common-Controls" | ||
version="6.0.0.0" | ||
processorArchitecture="*" | ||
publicKeyToken="6595b64144ccf1df" | ||
language="*" | ||
/> | ||
</dependentAssembly> | ||
</dependency> | ||
|
||
</assembly> |
6 changes: 6 additions & 0 deletions
6
...de/framework/wpf/advanced/snippets/how-to-detect-when-the-enter-key-pressed/vb/App.config
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,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8.1" /> | ||
</startup> | ||
</configuration> |
8 changes: 8 additions & 0 deletions
8
...mework/wpf/advanced/snippets/how-to-detect-when-the-enter-key-pressed/vb/Application.xaml
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,8 @@ | ||
<Application x:Class="Application" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
StartupUri="MainWindow.xaml"> | ||
<Application.Resources> | ||
|
||
</Application.Resources> | ||
</Application> |
6 changes: 6 additions & 0 deletions
6
...ork/wpf/advanced/snippets/how-to-detect-when-the-enter-key-pressed/vb/Application.xaml.vb
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,6 @@ | ||
Class Application | ||
|
||
' Application-level events, such as Startup, Exit, and DispatcherUnhandledException | ||
' can be handled in this file. | ||
|
||
End Class |
11 changes: 11 additions & 0 deletions
11
...amework/wpf/advanced/snippets/how-to-detect-when-the-enter-key-pressed/vb/AssemblyInfo.vb
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,11 @@ | ||
Imports System.Windows | ||
|
||
'The ThemeInfo attribute describes where any theme specific and generic resource dictionaries can be found. | ||
'1st parameter: where theme specific resource dictionaries are located | ||
'(used if a resource is not found in the page, | ||
' or application resource dictionaries) | ||
|
||
'2nd parameter: where the generic resource dictionary is located | ||
'(used if a resource is not found in the page, | ||
'app, and any theme specific resource dictionaries) | ||
<Assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)> |
14 changes: 14 additions & 0 deletions
14
...amework/wpf/advanced/snippets/how-to-detect-when-the-enter-key-pressed/vb/MainWindow.xaml
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 @@ | ||
<Window x:Class="MainWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
Title="Example" Width="360" Height="180" SizeToContent="Height" ResizeMode="NoResize" Loaded="Window_Loaded"> | ||
<Grid> | ||
<!--<example>--> | ||
<StackPanel> | ||
<TextBlock Width="300" Height="20" Text="Type some text into the TextBox and press the Enter key." /> | ||
<TextBox Width="300" Height="30" Name="textBox1" KeyDown="textBox1_KeyDown" /> | ||
<TextBlock Width="300" Height="100" Name="textBlock1" /> | ||
</StackPanel> | ||
<!--</example>--> | ||
</Grid> | ||
</Window> |
18 changes: 18 additions & 0 deletions
18
...work/wpf/advanced/snippets/how-to-detect-when-the-enter-key-pressed/vb/MainWindow.xaml.vb
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,18 @@ | ||
'<full> | ||
Imports System.Threading | ||
|
||
Public Class MainWindow | ||
Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs) | ||
End Sub | ||
|
||
'<handler> | ||
Private Sub textBox1_KeyDown(sender As Object, e As System.Windows.Input.KeyEventArgs) | ||
|
||
If e.Key = Key.Return Then | ||
textBlock1.Text = "You Entered: " + textBox1.Text | ||
End If | ||
|
||
End Sub | ||
'</handler> | ||
End Class | ||
'</full> |
59 changes: 59 additions & 0 deletions
59
.../advanced/snippets/how-to-detect-when-the-enter-key-pressed/vb/My Project/AssemblyInfo.vb
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,59 @@ | ||
Imports System | ||
Imports System.Globalization | ||
Imports System.Reflection | ||
Imports System.Resources | ||
Imports System.Runtime.InteropServices | ||
Imports System.Windows | ||
|
||
' General Information about an assembly is controlled through the following | ||
' set of attributes. Change these attribute values to modify the information | ||
' associated with an assembly. | ||
|
||
' Review the values of the assembly attributes | ||
|
||
<Assembly: AssemblyTitle("SDKSamples")> | ||
<Assembly: AssemblyDescription("")> | ||
<Assembly: AssemblyCompany("")> | ||
<Assembly: AssemblyProduct("SDKSamples")> | ||
<Assembly: AssemblyCopyright("Copyright © 2023")> | ||
<Assembly: AssemblyTrademark("")> | ||
<Assembly: ComVisible(false)> | ||
|
||
'In order to begin building localizable applications, set | ||
'<UICulture>CultureYouAreCodingWith</UICulture> in your .vbproj file | ||
'inside a <PropertyGroup>. For example, if you are using US english | ||
'in your source files, set the <UICulture> to "en-US". Then uncomment the | ||
'NeutralResourceLanguage attribute below. Update the "en-US" in the line | ||
'below to match the UICulture setting in the project file. | ||
|
||
'<Assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)> | ||
|
||
|
||
'The ThemeInfo attribute describes where any theme specific and generic resource dictionaries can be found. | ||
'1st parameter: where theme specific resource dictionaries are located | ||
'(used if a resource is not found in the page, | ||
' or application resource dictionaries) | ||
|
||
'2nd parameter: where the generic resource dictionary is located | ||
'(used if a resource is not found in the page, | ||
'app, and any theme specific resource dictionaries) | ||
<Assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)> | ||
|
||
|
||
|
||
'The following GUID is for the ID of the typelib if this project is exposed to COM | ||
<Assembly: Guid("28ffbf70-7284-4e8e-9904-e70933dc2b00")> | ||
|
||
' Version information for an assembly consists of the following four values: | ||
' | ||
' Major Version | ||
' Minor Version | ||
' Build Number | ||
' Revision | ||
' | ||
' You can specify all the values or you can default the Build and Revision Numbers | ||
' by using the '*' as shown below: | ||
' <Assembly: AssemblyVersion("1.0.*")> | ||
|
||
<Assembly: AssemblyVersion("1.0.0.0")> | ||
<Assembly: AssemblyFileVersion("1.0.0.0")> |
Oops, something went wrong.