From 5f6c203633f5b626259e0ca513e7fbae6696b61a Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:11:13 -0700 Subject: [PATCH 1/9] Update .repoman.yml (#1904) --- .repoman.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.repoman.yml b/.repoman.yml index 4f011bb8d0..5d3112f031 100644 --- a/.repoman.yml +++ b/.repoman.yml @@ -153,6 +153,14 @@ projects_v2_item: - labels-add: [":world_map: mapQUEST"] + edited: + + - check: + - type: query + value: "EventPayload.changes.field_value.field_name == 'Priority' || EventPayload.changes.field_value.field_name == 'Size'" + pass: + - labels-add: [":world_map: mapQUEST"] + issue_comment: created: From fc651569f71f9962d895d0a8c2a60ff4f980efca Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Tue, 1 Oct 2024 09:16:42 -0700 Subject: [PATCH 2/9] Update quest-config.json --- quest-config.json | 51 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/quest-config.json b/quest-config.json index c3618df72d..c0f15db068 100644 --- a/quest-config.json +++ b/quest-config.json @@ -9,6 +9,39 @@ "ParentNodes": [ { "Label": "okr-freshness", + "Semester": "Selenium", + "ParentNodeId": 286034 + }, + { + "Label": "okr-curation", + "Semester": "Selenium", + "ParentNodeId": 286038 + }, + { + "Label": "okr-health", + "Semester": "Selenium", + "ParentNodeId": 268038 + }, + { + "Label": "user-feedback", + "Semester": "Selenium", + "ParentNodeId": 286039 + }, + { + "Label": "doc-bug", + "Semester": "Selenium", + "ParentNodeId": 286039 + }, + { + "Semester": "Selenium", + "ParentNodeId": 308200 + }, + + + + { + "Label": "okr-freshness", + "Semester": "Dilithium", "ParentNodeId": 237266 }, { @@ -17,34 +50,40 @@ }, { "Label": "user-feedback", + "Semester": "Dilithium", "ParentNodeId": 233465 }, { "Label": "okr-health", + "Semester": "Dilithium", "ParentNodeId": 237266 }, { "Label": "doc-bug", + "Semester": "Dilithium", "ParentNodeId": 233465 - }, - { - "Label": "dotnet-csharp/svc", - "ParentNodeId": 227484 - }, + } { "Label": "sfi-ropc", + "Semester": "Dilithium", "ParentNodeId": 271716 }, { "Label": "sfi-admin", + "Semester": "Dilithium", "ParentNodeId": 271716 }, { "Label": "sfi-images", + "Semester": "Dilithium", "ParentNodeId": 286370 + }, + { + "Semester": "Dilithium", + "ParentNodeId": 227487 } ], - "DefaultParentNode": 227223, + "DefaultParentNode": 308200, "WorkItemTags": [ { "Label": "okr-curation", From c443426c5ea8be3223dbd5d01674b6763216c878 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:39:54 -0700 Subject: [PATCH 3/9] Update auto-merge.yml --- .github/policies/auto-merge.yml | 50 ++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/.github/policies/auto-merge.yml b/.github/policies/auto-merge.yml index f3af703973..b3d49e0041 100644 --- a/.github/policies/auto-merge.yml +++ b/.github/policies/auto-merge.yml @@ -8,37 +8,41 @@ where: configuration: resourceManagementConfiguration: eventResponderTasks: - - description: Approve and auto-squash-merge PRs to main labeled with 'auto-merge' + - description: Approve and auto-squash-merge bot PRs to main labeled 'auto-merge' triggerOnOwnActions: true if: - - payloadType: Pull_Request - - labelAdded: - label: ':octocat: auto-merge' - - targetsBranch: - branch: main + - payloadType: Pull_Request + - labelAdded: + label: ':octocat: auto-merge' + - targetsBranch: + branch: main + - or: + - isActivitySender: + user: dotnet-policy-service[bot] then: - - enableAutoMerge: - mergeMethod: Squash - - approvePullRequest: - comment: "Approved; this PR will merge when all status checks pass." + - enableAutoMerge: + mergeMethod: Squash + - approvePullRequest: + comment: "Approved; this PR will merge when all status checks pass." - - description: Auto-merge PRs to live labeled with 'auto-merge' + - description: Auto-merge policy service bot PRs to live labeled 'auto-merge' triggerOnOwnActions: true if: - - payloadType: Pull_Request - - labelAdded: - label: ':octocat: auto-merge' - - targetsBranch: - branch: live + - payloadType: Pull_Request + - labelAdded: + label: ':octocat: auto-merge' + - targetsBranch: + branch: live + - isActivitySender: + user: dotnet-policy-service[bot] then: - - enableAutoMerge: - mergeMethod: Merge + - enableAutoMerge: + mergeMethod: Merge - description: Don't auto-merge PRs with 'auto-merge' label removed if: - - payloadType: Pull_Request - - labelRemoved: - label: ':octocat: auto-merge' + - payloadType: Pull_Request + - labelRemoved: + label: ':octocat: auto-merge' then: - - disableAutoMerge - + - disableAutoMerge From 859e952ca6d2f4cdd99d32f76ca073ac9beb36c0 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Tue, 22 Oct 2024 09:41:26 -0700 Subject: [PATCH 4/9] Update quest-config.json --- quest-config.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/quest-config.json b/quest-config.json index c0f15db068..8a3e3a1964 100644 --- a/quest-config.json +++ b/quest-config.json @@ -36,9 +36,6 @@ "Semester": "Selenium", "ParentNodeId": 308200 }, - - - { "Label": "okr-freshness", "Semester": "Dilithium", @@ -62,7 +59,7 @@ "Label": "doc-bug", "Semester": "Dilithium", "ParentNodeId": 233465 - } + }, { "Label": "sfi-ropc", "Semester": "Dilithium", From b410f33391334f682fa16997e38cbeaf07563b76 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Tue, 22 Oct 2024 14:00:27 -0400 Subject: [PATCH 5/9] work item typo (#1910) The parent work item ID was incorrect. --- quest-config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quest-config.json b/quest-config.json index 8a3e3a1964..467a1cc1da 100644 --- a/quest-config.json +++ b/quest-config.json @@ -20,7 +20,7 @@ { "Label": "okr-health", "Semester": "Selenium", - "ParentNodeId": 268038 + "ParentNodeId": 286038 }, { "Label": "user-feedback", From e3fd27806ebabf9b6814a55d58aa07ebf41c8bb4 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Fri, 25 Oct 2024 09:16:49 -0700 Subject: [PATCH 6/9] Update workflows (#1913) * Update check-for-build-warnings.yml * Update live-protection.yml * Update markdownlint.yml * Update profanity-filter.yml * Update quest-bulk.yml * Update snippets5000.yml * Create stale.yml * Update version-sweep.yml --- .../workflows/check-for-build-warnings.yml | 4 +-- .github/workflows/live-protection.yml | 2 +- .github/workflows/markdownlint.yml | 9 ++--- .github/workflows/profanity-filter.yml | 4 +-- .github/workflows/quest-bulk.yml | 2 +- .github/workflows/snippets5000.yml | 4 +-- .github/workflows/stale.yml | 35 +++++++++++++++++++ .github/workflows/version-sweep.yml | 4 +-- 8 files changed, 47 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/check-for-build-warnings.yml b/.github/workflows/check-for-build-warnings.yml index 429c141adc..a4225b341e 100644 --- a/.github/workflows/check-for-build-warnings.yml +++ b/.github/workflows/check-for-build-warnings.yml @@ -13,10 +13,10 @@ jobs: runs-on: ubuntu-latest permissions: statuses: read - pull-requests: read + pull-requests: write steps: - name: Harden Runner - uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0 + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 with: egress-policy: audit diff --git a/.github/workflows/live-protection.yml b/.github/workflows/live-protection.yml index 026123e142..422f2ac3fe 100644 --- a/.github/workflows/live-protection.yml +++ b/.github/workflows/live-protection.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0 + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 with: egress-policy: audit diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml index 8e7ebce546..d3fb42df8c 100644 --- a/.github/workflows/markdownlint.yml +++ b/.github/workflows/markdownlint.yml @@ -10,11 +10,6 @@ on: - ".github/workflows/markdownlint.yml" - ".github/workflows/markdownlint-problem-matcher.json" pull_request: - paths: - - "**/*.md" - - ".markdownlint-cli2.jsonc" - - ".github/workflows/markdownlint.yml" - - ".github/workflows/markdownlint-problem-matcher.json" permissions: contents: read @@ -27,11 +22,11 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0 + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 with: egress-policy: audit - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - uses: DavidAnson/markdownlint-cli2-action@b4c9feab76d8025d1e83c653fa3990936df0e6c8 # v16.0.0 with: config: ".markdownlint-cli2.jsonc" diff --git a/.github/workflows/profanity-filter.yml b/.github/workflows/profanity-filter.yml index 5a9ffca299..a8c68beb33 100644 --- a/.github/workflows/profanity-filter.yml +++ b/.github/workflows/profanity-filter.yml @@ -19,13 +19,13 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0 + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 with: egress-policy: audit - name: Profanity filter if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'github-actions[bot]' }} - uses: IEvangelist/profanity-filter@5248b30a7d2a6c209eb0a7362502fe769856522f # main + uses: IEvangelist/profanity-filter@840020b719c619d953959e59c47185689e831a27 # main id: profanity-filter with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/quest-bulk.yml b/.github/workflows/quest-bulk.yml index d6c51bd133..25f93e137a 100644 --- a/.github/workflows/quest-bulk.yml +++ b/.github/workflows/quest-bulk.yml @@ -26,7 +26,7 @@ jobs: if: ${{ github.repository_owner == 'dotnet' }} steps: - name: Harden Runner - uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0 + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 with: egress-policy: audit diff --git a/.github/workflows/snippets5000.yml b/.github/workflows/snippets5000.yml index 5ace8bf1f2..277f58aca1 100644 --- a/.github/workflows/snippets5000.yml +++ b/.github/workflows/snippets5000.yml @@ -31,12 +31,12 @@ jobs: steps: # Checkout the repository for the PR - name: Harden Runner - uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0 + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 with: egress-policy: audit - name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #@v4.1.1 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 #@v4.2.1 # Get the latest preview SDK (or sdk not installed by the runner) - name: Setup .NET diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000000..5483fcf800 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,35 @@ +name: Close stale issues + +on: + schedule: # Run 5 minutes after midnight daily. + - cron: '5 0 * * *' + +permissions: + contents: read + +jobs: + stale: + + runs-on: ubuntu-latest + permissions: + issues: write + + steps: + - name: Harden Runner + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 + with: + egress-policy: audit + + - uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e + with: + start-date: '2022-03-01T00:00:00Z' # ISO 8601 or RFC 2822 + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-stale: 180 + days-before-close: 14 + stale-issue-label: stale + close-issue-message: > + This issue has been automatically closed due to lack of activity. + If you feel this issue is still important, please reopen it and leave a comment. + exempt-issue-labels: 'breaking-change,Pri0,:watch: Not Triaged,:checkered_flag: Release: .NET 7,:checkered_flag: Release: .NET 8' + operations-per-run: 50 + debug-only: true diff --git a/.github/workflows/version-sweep.yml b/.github/workflows/version-sweep.yml index 19e6ac649f..b6ef163cd7 100644 --- a/.github/workflows/version-sweep.yml +++ b/.github/workflows/version-sweep.yml @@ -34,7 +34,7 @@ jobs: # Start the .NET version updater action # A composite of the .NET Version Sweeper and the .NET Upgrade Assistant - name: Harden Runner - uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0 + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 with: egress-policy: audit @@ -43,4 +43,4 @@ jobs: uses: dotnet/docs-tools/actions/dotnet-version-updater@5e8bcc78465d45a7544bba56509a1a69922b6a5a # main with: support: ${{ github.event.inputs.support }} - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + token: ${{ secrets.GITHUB_TOKEN }} From 670d3b5dfbbd80ae9118c1c5ae0549627324673d Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Mon, 28 Oct 2024 17:44:23 -0700 Subject: [PATCH 7/9] Fix binding validation path (#1916) * Fix binding validation path * missing file * DUHH it's a key, not a name * add missing config --- .../how-to-implement-binding-validation.md | 19 +++++-- .../BindValidation/CSharp/AgeRangeRule.cs | 6 +- .../CSharp/BindingValidation.csproj | 12 +++- .../BindValidation/CSharp/MyDataSource.cs | 25 ++------- .../BindValidation/CSharp/Window1.xaml | 12 ++-- .../BindValidation/CSharp/app.config | 3 + .../VisualBasic/BindValidation_VB.vbproj | 12 +++- .../VisualBasic/MyDataSource.vb | 55 ++++--------------- .../BindValidation/VisualBasic/Window1.xaml | 8 +-- .../BindValidation/VisualBasic/app.config | 25 +++++++++ 10 files changed, 88 insertions(+), 89 deletions(-) create mode 100644 dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/app.config create mode 100644 dotnet-desktop-guide/samples/snippets/visualbasic/VS_Snippets_Wpf/BindValidation/VisualBasic/app.config diff --git a/dotnet-desktop-guide/framework/wpf/data/how-to-implement-binding-validation.md b/dotnet-desktop-guide/framework/wpf/data/how-to-implement-binding-validation.md index dc873823f5..16cb2f04b7 100644 --- a/dotnet-desktop-guide/framework/wpf/data/how-to-implement-binding-validation.md +++ b/dotnet-desktop-guide/framework/wpf/data/how-to-implement-binding-validation.md @@ -19,20 +19,29 @@ This example shows how to use an in the following example is bound to the `Age` property (of type int) of a binding source object named `ods`. The binding is set up to use a validation rule named `AgeRangeRule` so that if the user enters non-numeric characters or a value that is smaller than 21 or greater than 130, a red exclamation mark appears next to the text box and a tool tip with the error message appears when the user moves the mouse over the text box. -[!code-xaml[BindValidation#2](~/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/Window1.xaml#2)] +[!code-xaml[BindValidation#2](../../../samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/Window1.xaml#2)] The following example shows the implementation of `AgeRangeRule`, which inherits from and overrides the method. The `Int32.Parse` method is called on the value to make sure that it does not contain any invalid characters. The method returns a that indicates if the value is valid based on whether an exception is caught during the parsing and whether the age value is outside of the lower and upper bounds. -[!code-csharp[BindValidation#3](~/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/AgeRangeRule.cs#3)] -[!code-vb[BindValidation#3](~/samples/snippets/visualbasic/VS_Snippets_Wpf/BindValidation/VisualBasic/AgeRangeRule.vb#3)] +[!code-csharp[BindValidation#3](../../../samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/AgeRangeRule.cs#3)] +[!code-vb[BindValidation#3](../../../samples/snippets/visualbasic/VS_Snippets_Wpf/BindValidation/VisualBasic/AgeRangeRule.vb#3)] The following example shows the custom `validationTemplate` that creates a red exclamation mark to notify the user of a validation error. Control templates are used to redefine the appearance of a control. -[!code-xaml[BindValidation#4](~/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/Window1.xaml#4)] +[!code-xaml[BindValidation#4](../../../samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/Window1.xaml#4)] As shown in the following example, the that shows the error message is created using the style named `textBoxInError`. If the value of is `true`, the trigger sets the tool tip of the current to its first validation error. The is set to , referring to the current element. -[!code-xaml[BindValidation#5](~/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/Window1.xaml#5)] +[!code-xaml[BindValidation#5](../../../samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/Window1.xaml#5)] + +## Data object + +The following snippet is the data object used in the previous code examples. An instance is created in the XAML as a static resource with the key of `ods`: + +:::code language="csharp" source="../../../samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/MyDataSource.cs" id="DataSource"::: +:::code language="vb" source="../../../samples/snippets/visualbasic/VS_Snippets_Wpf/BindValidation/VisualBasic/MyDataSource.vb" id="DataSource"::: + +## Complete example For the complete example, see [Bind Validation sample](https://github.com/Microsoft/WPF-Samples/tree/master/Data%20Binding/BindValidation). diff --git a/dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/AgeRangeRule.cs b/dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/AgeRangeRule.cs index ae66629ad9..3fe727e80a 100644 --- a/dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/AgeRangeRule.cs +++ b/dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/AgeRangeRule.cs @@ -12,10 +12,6 @@ public class AgeRangeRule : ValidationRule public int Min { get; set; } public int Max { get; set; } - public AgeRangeRule() - { - } - public override ValidationResult Validate(object value, CultureInfo cultureInfo) { int age = 0; @@ -23,7 +19,7 @@ public override ValidationResult Validate(object value, CultureInfo cultureInfo) try { if (((string)value).Length > 0) - age = Int32.Parse((String)value); + age = int.Parse((String)value); } catch (Exception e) { diff --git a/dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/BindingValidation.csproj b/dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/BindingValidation.csproj index 291304e8c0..b75b5d1d31 100644 --- a/dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/BindingValidation.csproj +++ b/dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/BindingValidation.csproj @@ -1,4 +1,4 @@ - + MSBuild @@ -12,9 +12,10 @@ 10.0.20821 2.0 {950D18C5-F942-494B-87F5-DE051442ABF6} - v4.0 + v4.8 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Client + + true @@ -22,12 +23,14 @@ false .\bin\Debug\ DEBUG + false false true .\bin\Release\ TRACE + false @@ -70,4 +73,7 @@ Code + + + \ No newline at end of file diff --git a/dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/MyDataSource.cs b/dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/MyDataSource.cs index 295e00e7c4..71e911b6cd 100644 --- a/dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/MyDataSource.cs +++ b/dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/MyDataSource.cs @@ -2,33 +2,18 @@ namespace SDKSample { + // public class MyDataSource { - private int _age; - private int _age2; - private int _age3; - public MyDataSource() { Age = 0; Age2 = 0; } - public int Age - { - get { return _age; } - set { _age = value; } - } - public int Age2 - { - get { return _age2; } - set { _age2 = value; } - } - - public int Age3 - { - get { return _age3; } - set { _age3 = value; } - } + public int Age { get; set; } + public int Age2 { get; set; } + public int Age3 { get; set; } } + // } diff --git a/dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/Window1.xaml b/dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/Window1.xaml index 84c5cc1a1c..b2bafab5fb 100644 --- a/dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/Window1.xaml +++ b/dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/Window1.xaml @@ -1,7 +1,7 @@ --> - + @@ -25,8 +25,8 @@ + Value="{Binding RelativeSource={x:Static RelativeSource.Self}, + Path=(Validation.Errors)[0].ErrorContent}"/> @@ -65,7 +65,7 @@ - + @@ -81,7 +81,7 @@ - + diff --git a/dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/app.config b/dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/app.config new file mode 100644 index 0000000000..3e0e37cfc8 --- /dev/null +++ b/dotnet-desktop-guide/samples/snippets/csharp/VS_Snippets_Wpf/BindValidation/CSharp/app.config @@ -0,0 +1,3 @@ + + + diff --git a/dotnet-desktop-guide/samples/snippets/visualbasic/VS_Snippets_Wpf/BindValidation/VisualBasic/BindValidation_VB.vbproj b/dotnet-desktop-guide/samples/snippets/visualbasic/VS_Snippets_Wpf/BindValidation/VisualBasic/BindValidation_VB.vbproj index b091d84b55..9f6ed92cb2 100644 --- a/dotnet-desktop-guide/samples/snippets/visualbasic/VS_Snippets_Wpf/BindValidation/VisualBasic/BindValidation_VB.vbproj +++ b/dotnet-desktop-guide/samples/snippets/visualbasic/VS_Snippets_Wpf/BindValidation/VisualBasic/BindValidation_VB.vbproj @@ -1,4 +1,4 @@ - + Debug AnyCPU @@ -21,8 +21,9 @@ true true Publish\ - v4.0 - Client + v4.8 + + 10.0.20821 @@ -34,6 +35,7 @@ bin\ BindValidation_VB.xml 42016,42017,42018,42019,42032,42314 + false false @@ -44,6 +46,7 @@ bin\ BindValidation_VB.xml 42016,42017,42018,42019,42032,42314 + false @@ -110,5 +113,8 @@ + + + \ No newline at end of file diff --git a/dotnet-desktop-guide/samples/snippets/visualbasic/VS_Snippets_Wpf/BindValidation/VisualBasic/MyDataSource.vb b/dotnet-desktop-guide/samples/snippets/visualbasic/VS_Snippets_Wpf/BindValidation/VisualBasic/MyDataSource.vb index 2781bdd86b..a5c5f6383d 100644 --- a/dotnet-desktop-guide/samples/snippets/visualbasic/VS_Snippets_Wpf/BindValidation/VisualBasic/MyDataSource.vb +++ b/dotnet-desktop-guide/samples/snippets/visualbasic/VS_Snippets_Wpf/BindValidation/VisualBasic/MyDataSource.vb @@ -1,43 +1,12 @@ - Public Class MyDataSource - ' Methods - Public Sub New() - Me.Age = 0 - Me.Age2 = 0 - End Sub - - - ' Properties - Public Property Age As Integer - Get - Return Me._age - End Get - Set(ByVal value As Integer) - Me._age = value - End Set - End Property - - Public Property Age2 As Integer - Get - Return Me._age2 - End Get - Set(ByVal value As Integer) - Me._age2 = value - End Set - End Property - - Public Property Age3 As Integer - Get - Return Me._age3 - End Get - Set(ByVal value As Integer) - Me._age3 = value - End Set - End Property - - - ' Fields - Private _age As Integer - Private _age2 As Integer - Private _age3 As Integer - End Class - +' +Public Class MyDataSource + Public Sub New() + Me.Age = 0 + Me.Age2 = 0 + End Sub + + Public Property Age As Integer + Public Property Age2 As Integer + Public Property Age3 As Integer +End Class +' diff --git a/dotnet-desktop-guide/samples/snippets/visualbasic/VS_Snippets_Wpf/BindValidation/VisualBasic/Window1.xaml b/dotnet-desktop-guide/samples/snippets/visualbasic/VS_Snippets_Wpf/BindValidation/VisualBasic/Window1.xaml index 86b067eeca..27bf35f17d 100644 --- a/dotnet-desktop-guide/samples/snippets/visualbasic/VS_Snippets_Wpf/BindValidation/VisualBasic/Window1.xaml +++ b/dotnet-desktop-guide/samples/snippets/visualbasic/VS_Snippets_Wpf/BindValidation/VisualBasic/Window1.xaml @@ -1,14 +1,14 @@  - + @@ -57,7 +57,7 @@ - + @@ -71,7 +71,7 @@ - + diff --git a/dotnet-desktop-guide/samples/snippets/visualbasic/VS_Snippets_Wpf/BindValidation/VisualBasic/app.config b/dotnet-desktop-guide/samples/snippets/visualbasic/VS_Snippets_Wpf/BindValidation/VisualBasic/app.config new file mode 100644 index 0000000000..3000fcc8c9 --- /dev/null +++ b/dotnet-desktop-guide/samples/snippets/visualbasic/VS_Snippets_Wpf/BindValidation/VisualBasic/app.config @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + From 927e1b46d61c203f962afc8199ebc8f24ffd8613 Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Mon, 28 Oct 2024 17:44:39 -0700 Subject: [PATCH 8/9] Rewrite font snippet (#1912) * Rewrite font snippet * Add snippets config * Rename variable --- ...how-to-create-a-private-font-collection.md | 8 +- .../cs/App.config | 6 + .../cs/Form1.Designer.cs | 47 ++++++ .../cs/Form1.cs | 100 +++++++++++++ .../cs/Form1.resx | 120 +++++++++++++++ .../cs/Program.cs | 22 +++ .../cs/Properties/AssemblyInfo.cs | 36 +++++ .../cs/Properties/Resources.Designer.cs | 71 +++++++++ .../cs/Properties/Resources.resx | 117 +++++++++++++++ .../cs/Properties/Settings.Designer.cs | 30 ++++ .../cs/Properties/Settings.settings | 7 + .../cs/fonts.csproj | 83 +++++++++++ .../cs/snippets.5000.json | 3 + .../vb/App.config | 6 + .../vb/Form1.Designer.vb | 31 ++++ .../vb/Form1.vb | 93 ++++++++++++ .../vb/My Project/Application.Designer.vb | 38 +++++ .../vb/My Project/Application.myapp | 11 ++ .../vb/My Project/AssemblyInfo.vb | 35 +++++ .../vb/My Project/Resources.Designer.vb | 62 ++++++++ .../vb/My Project/Resources.resx | 117 +++++++++++++++ .../vb/My Project/Settings.Designer.vb | 73 +++++++++ .../vb/My Project/Settings.settings | 7 + .../vb/fonts.vbproj | 120 +++++++++++++++ .../vb/snippets.5000.json | 3 + .../csharp/CSharpExample.csproj | 2 +- .../vb/VBExample.vbproj | 2 +- .../csharp/CSharpExample.csproj | 2 +- .../vb/MainWindow.xaml | 29 +++- .../vb/VBExample.vbproj | 2 +- .../csharp/CSharpExample.csproj | 2 +- .../vb/VBExample.vbproj | 2 +- .../csharp/ArticleExample.csproj | 2 +- .../vb/ArticleExampleVB.vbproj | 2 +- .../csharp/ArticleExample.csproj | 2 +- .../vb/ArticleExampleVB.vbproj | 2 +- .../snippets/index/csharp/bindings.csproj | 2 +- .../data/snippets/index/vb/bindings.vbproj | 2 +- .../Properties/launchSettings.json | 4 + redirects_generator/definitions.json | 2 +- redirects_generator/definitions.winforms.json | 2 +- redirects_generator/definitions.wpf.json | 138 +++++++++--------- redirects_generator/redirects.cs | 56 ++++--- redirects_generator/redirs.csproj | 3 + 44 files changed, 1392 insertions(+), 112 deletions(-) create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/App.config create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Form1.Designer.cs create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Form1.cs create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Form1.resx create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Program.cs create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Properties/AssemblyInfo.cs create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Properties/Resources.Designer.cs create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Properties/Resources.resx create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Properties/Settings.Designer.cs create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Properties/Settings.settings create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/fonts.csproj create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/snippets.5000.json create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/App.config create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/Form1.Designer.vb create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/Form1.vb create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Application.Designer.vb create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Application.myapp create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/AssemblyInfo.vb create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Resources.Designer.vb create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Resources.resx create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Settings.Designer.vb create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Settings.settings create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/fonts.vbproj create mode 100644 dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/snippets.5000.json diff --git a/dotnet-desktop-guide/framework/winforms/advanced/how-to-create-a-private-font-collection.md b/dotnet-desktop-guide/framework/winforms/advanced/how-to-create-a-private-font-collection.md index d10fc4632c..6bf06319da 100644 --- a/dotnet-desktop-guide/framework/winforms/advanced/how-to-create-a-private-font-collection.md +++ b/dotnet-desktop-guide/framework/winforms/advanced/how-to-create-a-private-font-collection.md @@ -41,10 +41,10 @@ The class inherits from the `e`, which is a parameter of . diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/App.config b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/App.config new file mode 100644 index 0000000000..aee9adf485 --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Form1.Designer.cs b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Form1.Designer.cs new file mode 100644 index 0000000000..c93bbeb8ce --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Form1.Designer.cs @@ -0,0 +1,47 @@ +namespace fonts +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.SuspendLayout(); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Name = "Form1"; + this.Text = "Form1"; + this.ResumeLayout(false); + + } + + #endregion + } +} + diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Form1.cs b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Form1.cs new file mode 100644 index 0000000000..d453b72207 --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Form1.cs @@ -0,0 +1,100 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Drawing.Text; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace fonts +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + } + + // + // Helper function to print text in a font and style + private float DrawFont(Graphics graphicsObj, + FontFamily family, + FontStyle style, + SolidBrush colorBrush, + PointF location, + string styleName) + { + // The string to print, which contains the family name and style + string familyNameAndStyle = $"{family.Name} {styleName}"; + + // Create the font object + using (Font fontObject = new Font(family.Name, 16, style, GraphicsUnit.Pixel)) + { + // Draw the string + graphicsObj.DrawString(familyNameAndStyle, fontObject, colorBrush, location); + + // Return the height of the font + return fontObject.Height; + } + } + + // The OnPaint method of a form, which provides the graphics object + protected override void OnPaint(PaintEventArgs e) + { + PointF location = new PointF(10, 0); + SolidBrush solidBrush = new SolidBrush(Color.Black); + + FontFamily[] fontFamilies; + PrivateFontCollection privateFontCollection = new PrivateFontCollection(); // Dispose later + + // Add three font files to the private collection. + privateFontCollection.AddFontFile(System.Environment.ExpandEnvironmentVariables("%systemroot%\\Fonts\\Arial.ttf")); + privateFontCollection.AddFontFile(System.Environment.ExpandEnvironmentVariables("%systemroot%\\Fonts\\CourBI.ttf")); + privateFontCollection.AddFontFile(System.Environment.ExpandEnvironmentVariables("%systemroot%\\Fonts\\TimesBD.ttf")); + + // Get the array of FontFamily objects. + fontFamilies = privateFontCollection.Families; + + // Process each font in the collection + for (int i = 0; i < fontFamilies.Length; i++) + { + // Draw the font in every style + + // Regular + if (fontFamilies[i].IsStyleAvailable(FontStyle.Regular)) + location.Y += DrawFont(e.Graphics, fontFamilies[i], FontStyle.Regular, solidBrush, location, "Regular"); + + // Bold + if (fontFamilies[i].IsStyleAvailable(FontStyle.Bold)) + location.Y += DrawFont(e.Graphics, fontFamilies[i], FontStyle.Bold, solidBrush, location, "Bold"); + + // Italic + if (fontFamilies[i].IsStyleAvailable(FontStyle.Italic)) + location.Y += DrawFont(e.Graphics, fontFamilies[i], FontStyle.Italic, solidBrush, location, "Italic"); + + // Bold and Italic + if (fontFamilies[i].IsStyleAvailable(FontStyle.Bold) && + fontFamilies[i].IsStyleAvailable(FontStyle.Italic)) + location.Y += DrawFont(e.Graphics, fontFamilies[i], FontStyle.Bold | FontStyle.Italic, solidBrush, location, "BoldItalic"); + + // Underline + if (fontFamilies[i].IsStyleAvailable(FontStyle.Underline)) + location.Y += DrawFont(e.Graphics, fontFamilies[i], FontStyle.Underline, solidBrush, location, "Underline"); + + // Strikeout + if (fontFamilies[i].IsStyleAvailable(FontStyle.Strikeout)) + location.Y += DrawFont(e.Graphics, fontFamilies[i], FontStyle.Strikeout, solidBrush, location, "Strikeout"); + + // Extra space between font families + location.Y += 10; + } + + privateFontCollection.Dispose(); + } + // + } +} diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Form1.resx b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Form1.resx new file mode 100644 index 0000000000..1af7de150c --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Program.cs b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Program.cs new file mode 100644 index 0000000000..6f5641f165 --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace fonts +{ + internal static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Properties/AssemblyInfo.cs b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..18c372143f --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 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. +[assembly: AssemblyTitle("fonts")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("fonts")] +[assembly: AssemblyCopyright("Copyright © 2024")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("fb917916-71e9-4e2a-94c2-d9a3036995cb")] + +// 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")] diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Properties/Resources.Designer.cs b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Properties/Resources.Designer.cs new file mode 100644 index 0000000000..99535c83dc --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace fonts.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("fonts.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Properties/Resources.resx b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Properties/Resources.resx new file mode 100644 index 0000000000..af7dbebbac --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Properties/Settings.Designer.cs b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Properties/Settings.Designer.cs new file mode 100644 index 0000000000..289983e82d --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace fonts.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Properties/Settings.settings b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Properties/Settings.settings new file mode 100644 index 0000000000..39645652af --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/fonts.csproj b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/fonts.csproj new file mode 100644 index 0000000000..07a5de815a --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/fonts.csproj @@ -0,0 +1,83 @@ + + + + + Debug + AnyCPU + {FB917916-71E9-4E2A-94C2-D9A3036995CB} + WinExe + fonts + fonts + v4.8.1 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/snippets.5000.json b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/snippets.5000.json new file mode 100644 index 0000000000..da9ebf8da2 --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/cs/snippets.5000.json @@ -0,0 +1,3 @@ +{ + "host": "visualstudio" +} diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/App.config b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/App.config new file mode 100644 index 0000000000..23631cd6e0 --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/Form1.Designer.vb b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/Form1.Designer.vb new file mode 100644 index 0000000000..a418df0ea8 --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/Form1.Designer.vb @@ -0,0 +1,31 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + components = New System.ComponentModel.Container() + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(800, 450) + Me.Text = "Form1" + End Sub + +End Class diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/Form1.vb b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/Form1.vb new file mode 100644 index 0000000000..01d1ebce86 --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/Form1.vb @@ -0,0 +1,93 @@ +Imports System.Drawing.Text + +Public Class Form1 + + ' + ' Helper function to print text in a font and style + Private Function DrawFont(graphicsObj As Graphics, + family As FontFamily, + style As FontStyle, + colorBrush As SolidBrush, + location As PointF, + styleName As String) As Single + + ' The string to print, which contains the family name and style + Dim familyNameAndStyle As String = $"{family.Name} {styleName}" + + ' Create the font object + Using fontObject As New Font(family.Name, 16, style, GraphicsUnit.Pixel) + + ' Draw the string + graphicsObj.DrawString(familyNameAndStyle, fontObject, colorBrush, location) + + ' Return the height of the font + Return fontObject.Height + + End Using + + End Function + + ' The OnPaint method of a form, which provides the graphics object + Protected Overrides Sub OnPaint(e As PaintEventArgs) + + Dim location As New PointF(10, 0) + Dim solidBrush As New SolidBrush(Color.Black) + + Dim fontFamilies() As FontFamily + Dim privateFontCollection As New PrivateFontCollection() ' Dispose later + + ' Add three font files to the private collection. + privateFontCollection.AddFontFile(System.Environment.ExpandEnvironmentVariables("%systemroot%\Fonts\Arial.ttf")) + privateFontCollection.AddFontFile(System.Environment.ExpandEnvironmentVariables("%systemroot%\Fonts\CourBI.ttf")) + privateFontCollection.AddFontFile(System.Environment.ExpandEnvironmentVariables("%systemroot%\Fonts\TimesBD.ttf")) + + ' Get the array of FontFamily objects. + fontFamilies = privateFontCollection.Families + + ' Process each font in the collection + For i = 0 To fontFamilies.Length - 1 + + ' Draw the font in every style + + ' Regular + If fontFamilies(i).IsStyleAvailable(FontStyle.Regular) Then + location.Y += DrawFont(e.Graphics, fontFamilies(i), FontStyle.Regular, solidBrush, location, "Regular") + End If + + ' Bold + If fontFamilies(i).IsStyleAvailable(FontStyle.Bold) Then + location.Y += DrawFont(e.Graphics, fontFamilies(i), FontStyle.Bold, solidBrush, location, "Bold") + End If + + ' Italic + If fontFamilies(i).IsStyleAvailable(FontStyle.Italic) Then + location.Y += DrawFont(e.Graphics, fontFamilies(i), FontStyle.Italic, solidBrush, location, "Italic") + End If + + ' Bold and Italic + If fontFamilies(i).IsStyleAvailable(FontStyle.Italic) And + fontFamilies(i).IsStyleAvailable(FontStyle.Italic) Then + location.Y += DrawFont(e.Graphics, fontFamilies(i), FontStyle.Bold Or FontStyle.Italic, solidBrush, location, "BoldItalic") + End If + + ' Underline + If fontFamilies(i).IsStyleAvailable(FontStyle.Underline) Then + location.Y += DrawFont(e.Graphics, fontFamilies(i), FontStyle.Underline, solidBrush, location, "Underline") + End If + + ' Strikeout + If fontFamilies(i).IsStyleAvailable(FontStyle.Strikeout) Then + location.Y += DrawFont(e.Graphics, fontFamilies(i), FontStyle.Strikeout, solidBrush, location, "Strikeout") + End If + + ' Extra space between font families + location.Y += 10 + + Next + + privateFontCollection.Dispose() + + End Sub + ' + +End Class diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Application.Designer.vb b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Application.Designer.vb new file mode 100644 index 0000000000..1041d2d0e3 --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global.fonts.Form1 + End Sub + End Class +End Namespace diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Application.myapp b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Application.myapp new file mode 100644 index 0000000000..1243847fd9 --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/AssemblyInfo.vb b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/AssemblyInfo.vb new file mode 100644 index 0000000000..d91b714b83 --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 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 + + + + + + + + + + +'The following GUID is for the ID of the typelib if this project is exposed to COM + + +' 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: +' + + + diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Resources.Designer.vb b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Resources.Designer.vb new file mode 100644 index 0000000000..6a4863d4f9 --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("fonts.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Resources.resx b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Resources.resx new file mode 100644 index 0000000000..af7dbebbac --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Settings.Designer.vb b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Settings.Designer.vb new file mode 100644 index 0000000000..ae4a8c24bd --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.fonts.My.MySettings + Get + Return Global.fonts.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Settings.settings b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Settings.settings new file mode 100644 index 0000000000..85b890b3c6 --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/fonts.vbproj b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/fonts.vbproj new file mode 100644 index 0000000000..7c2414d084 --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/fonts.vbproj @@ -0,0 +1,120 @@ + + + + + Debug + AnyCPU + {0E2E64AB-9F0A-4684-A672-373411E7F05D} + WinExe + fonts.My.MyApplication + fonts + fonts + 512 + WindowsForms + v4.8.1 + true + true + + + AnyCPU + true + full + true + true + bin\Debug\ + fonts.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + AnyCPU + pdbonly + false + true + true + bin\Release\ + fonts.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + \ No newline at end of file diff --git a/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/snippets.5000.json b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/snippets.5000.json new file mode 100644 index 0000000000..da9ebf8da2 --- /dev/null +++ b/dotnet-desktop-guide/framework/winforms/advanced/snippets/how-to-create-a-private-font-collection/vb/snippets.5000.json @@ -0,0 +1,3 @@ +{ + "host": "visualstudio" +} diff --git a/dotnet-desktop-guide/net/wpf/controls/snippets/how-to-create-apply-style/csharp/CSharpExample.csproj b/dotnet-desktop-guide/net/wpf/controls/snippets/how-to-create-apply-style/csharp/CSharpExample.csproj index 6b287e73fe..7888c4458e 100644 --- a/dotnet-desktop-guide/net/wpf/controls/snippets/how-to-create-apply-style/csharp/CSharpExample.csproj +++ b/dotnet-desktop-guide/net/wpf/controls/snippets/how-to-create-apply-style/csharp/CSharpExample.csproj @@ -2,7 +2,7 @@ WinExe - net7.0-windows + net8.0-windows IntroToStylingAndTemplating true IntroToStylingAndTemplating diff --git a/dotnet-desktop-guide/net/wpf/controls/snippets/how-to-create-apply-style/vb/VBExample.vbproj b/dotnet-desktop-guide/net/wpf/controls/snippets/how-to-create-apply-style/vb/VBExample.vbproj index 374b97825b..e2f131759e 100644 --- a/dotnet-desktop-guide/net/wpf/controls/snippets/how-to-create-apply-style/vb/VBExample.vbproj +++ b/dotnet-desktop-guide/net/wpf/controls/snippets/how-to-create-apply-style/vb/VBExample.vbproj @@ -2,7 +2,7 @@ WinExe - net7.0-windows + net8.0-windows IntroToStylingAndTemplating true IntroToStylingAndTemplating diff --git a/dotnet-desktop-guide/net/wpf/controls/snippets/how-to-create-apply-template/csharp/CSharpExample.csproj b/dotnet-desktop-guide/net/wpf/controls/snippets/how-to-create-apply-template/csharp/CSharpExample.csproj index 374b97825b..e2f131759e 100644 --- a/dotnet-desktop-guide/net/wpf/controls/snippets/how-to-create-apply-template/csharp/CSharpExample.csproj +++ b/dotnet-desktop-guide/net/wpf/controls/snippets/how-to-create-apply-template/csharp/CSharpExample.csproj @@ -2,7 +2,7 @@ WinExe - net7.0-windows + net8.0-windows IntroToStylingAndTemplating true IntroToStylingAndTemplating diff --git a/dotnet-desktop-guide/net/wpf/controls/snippets/how-to-create-apply-template/vb/MainWindow.xaml b/dotnet-desktop-guide/net/wpf/controls/snippets/how-to-create-apply-template/vb/MainWindow.xaml index f62477d1ba..85697e17d1 100644 --- a/dotnet-desktop-guide/net/wpf/controls/snippets/how-to-create-apply-template/vb/MainWindow.xaml +++ b/dotnet-desktop-guide/net/wpf/controls/snippets/how-to-create-apply-template/vb/MainWindow.xaml @@ -7,12 +7,37 @@ mc:Ignorable="d" Title="Template Intro Sample" Loaded="WindowLoaded" SizeToContent="WidthAndHeight" MinWidth="250"> - + + + + + + + + + + + + + + + + + + + + - + diff --git a/dotnet-desktop-guide/net/wpf/controls/snippets/how-to-create-apply-template/vb/VBExample.vbproj b/dotnet-desktop-guide/net/wpf/controls/snippets/how-to-create-apply-template/vb/VBExample.vbproj index 374b97825b..e2f131759e 100644 --- a/dotnet-desktop-guide/net/wpf/controls/snippets/how-to-create-apply-template/vb/VBExample.vbproj +++ b/dotnet-desktop-guide/net/wpf/controls/snippets/how-to-create-apply-template/vb/VBExample.vbproj @@ -2,7 +2,7 @@ WinExe - net7.0-windows + net8.0-windows IntroToStylingAndTemplating true IntroToStylingAndTemplating diff --git a/dotnet-desktop-guide/net/wpf/controls/snippets/styles-templates-overview/csharp/CSharpExample.csproj b/dotnet-desktop-guide/net/wpf/controls/snippets/styles-templates-overview/csharp/CSharpExample.csproj index 6b287e73fe..7888c4458e 100644 --- a/dotnet-desktop-guide/net/wpf/controls/snippets/styles-templates-overview/csharp/CSharpExample.csproj +++ b/dotnet-desktop-guide/net/wpf/controls/snippets/styles-templates-overview/csharp/CSharpExample.csproj @@ -2,7 +2,7 @@ WinExe - net7.0-windows + net8.0-windows IntroToStylingAndTemplating true IntroToStylingAndTemplating diff --git a/dotnet-desktop-guide/net/wpf/controls/snippets/styles-templates-overview/vb/VBExample.vbproj b/dotnet-desktop-guide/net/wpf/controls/snippets/styles-templates-overview/vb/VBExample.vbproj index 374b97825b..e2f131759e 100644 --- a/dotnet-desktop-guide/net/wpf/controls/snippets/styles-templates-overview/vb/VBExample.vbproj +++ b/dotnet-desktop-guide/net/wpf/controls/snippets/styles-templates-overview/vb/VBExample.vbproj @@ -2,7 +2,7 @@ WinExe - net7.0-windows + net8.0-windows IntroToStylingAndTemplating true IntroToStylingAndTemplating diff --git a/dotnet-desktop-guide/net/wpf/data/snippets/binding-declarations-overview/csharp/ArticleExample.csproj b/dotnet-desktop-guide/net/wpf/data/snippets/binding-declarations-overview/csharp/ArticleExample.csproj index 0db208d36e..80b35f9f30 100644 --- a/dotnet-desktop-guide/net/wpf/data/snippets/binding-declarations-overview/csharp/ArticleExample.csproj +++ b/dotnet-desktop-guide/net/wpf/data/snippets/binding-declarations-overview/csharp/ArticleExample.csproj @@ -2,7 +2,7 @@ WinExe - net7.0-windows + net8.0-windows true diff --git a/dotnet-desktop-guide/net/wpf/data/snippets/binding-declarations-overview/vb/ArticleExampleVB.vbproj b/dotnet-desktop-guide/net/wpf/data/snippets/binding-declarations-overview/vb/ArticleExampleVB.vbproj index a7a3e24698..d7601ae1ee 100644 --- a/dotnet-desktop-guide/net/wpf/data/snippets/binding-declarations-overview/vb/ArticleExampleVB.vbproj +++ b/dotnet-desktop-guide/net/wpf/data/snippets/binding-declarations-overview/vb/ArticleExampleVB.vbproj @@ -2,7 +2,7 @@ WinExe - net7.0-windows + net8.0-windows ArticleExampleVB true diff --git a/dotnet-desktop-guide/net/wpf/data/snippets/how-to-bind-to-an-enumeration/csharp/ArticleExample.csproj b/dotnet-desktop-guide/net/wpf/data/snippets/how-to-bind-to-an-enumeration/csharp/ArticleExample.csproj index 0db208d36e..80b35f9f30 100644 --- a/dotnet-desktop-guide/net/wpf/data/snippets/how-to-bind-to-an-enumeration/csharp/ArticleExample.csproj +++ b/dotnet-desktop-guide/net/wpf/data/snippets/how-to-bind-to-an-enumeration/csharp/ArticleExample.csproj @@ -2,7 +2,7 @@ WinExe - net7.0-windows + net8.0-windows true diff --git a/dotnet-desktop-guide/net/wpf/data/snippets/how-to-bind-to-an-enumeration/vb/ArticleExampleVB.vbproj b/dotnet-desktop-guide/net/wpf/data/snippets/how-to-bind-to-an-enumeration/vb/ArticleExampleVB.vbproj index a7a3e24698..d7601ae1ee 100644 --- a/dotnet-desktop-guide/net/wpf/data/snippets/how-to-bind-to-an-enumeration/vb/ArticleExampleVB.vbproj +++ b/dotnet-desktop-guide/net/wpf/data/snippets/how-to-bind-to-an-enumeration/vb/ArticleExampleVB.vbproj @@ -2,7 +2,7 @@ WinExe - net7.0-windows + net8.0-windows ArticleExampleVB true diff --git a/dotnet-desktop-guide/net/wpf/data/snippets/index/csharp/bindings.csproj b/dotnet-desktop-guide/net/wpf/data/snippets/index/csharp/bindings.csproj index 9150f2e904..696bb13c22 100644 --- a/dotnet-desktop-guide/net/wpf/data/snippets/index/csharp/bindings.csproj +++ b/dotnet-desktop-guide/net/wpf/data/snippets/index/csharp/bindings.csproj @@ -2,7 +2,7 @@ WinExe - net7.0-windows + net8.0-windows true diff --git a/dotnet-desktop-guide/net/wpf/data/snippets/index/vb/bindings.vbproj b/dotnet-desktop-guide/net/wpf/data/snippets/index/vb/bindings.vbproj index e9e19b50e4..35dbade0a4 100644 --- a/dotnet-desktop-guide/net/wpf/data/snippets/index/vb/bindings.vbproj +++ b/dotnet-desktop-guide/net/wpf/data/snippets/index/vb/bindings.vbproj @@ -2,7 +2,7 @@ WinExe - net7.0-windows + net8.0-windows bindings true diff --git a/redirects_generator/Properties/launchSettings.json b/redirects_generator/Properties/launchSettings.json index 56b4c04488..dbc5e6eaac 100644 --- a/redirects_generator/Properties/launchSettings.json +++ b/redirects_generator/Properties/launchSettings.json @@ -10,6 +10,10 @@ "Specialized-WinForms": { "commandName": "Project", "commandLineArgs": "\"C:\\Code\\Work\\dotnet\\docs-desktop\\.openpublishing.redirection.winforms.json\"" + }, + "Specialized-WPF": { + "commandName": "Project", + "commandLineArgs": "\"C:\\Code\\Work\\dotnet\\docs-desktop\\.openpublishing.redirection.wpf.json\"" } } } diff --git a/redirects_generator/definitions.json b/redirects_generator/definitions.json index 8120478157..a86fdfd27e 100644 --- a/redirects_generator/definitions.json +++ b/redirects_generator/definitions.json @@ -1,7 +1,7 @@ { "Moniker1": "netframeworkdesktop-4.8", "RepoPath1": "dotnet-desktop-guide/framework/", - "Moniker2": "netdesktop-7.0", + "Moniker2": "netdesktop-8.0", "RepoPath2": "dotnet-desktop-guide/net/", "PublishRoot": "/dotnet/desktop/", "Entries": [] diff --git a/redirects_generator/definitions.winforms.json b/redirects_generator/definitions.winforms.json index 32aa8fab0b..0109b70c94 100644 --- a/redirects_generator/definitions.winforms.json +++ b/redirects_generator/definitions.winforms.json @@ -1,7 +1,7 @@ { "Moniker1": "netframeworkdesktop-4.8", "RepoPath1": "dotnet-desktop-guide/framework/", - "Moniker2": "netdesktop-7.0", + "Moniker2": "netdesktop-8.0", "RepoPath2": "dotnet-desktop-guide/net/", "PublishRoot": "/dotnet/desktop/", "Entries": [ diff --git a/redirects_generator/definitions.wpf.json b/redirects_generator/definitions.wpf.json index 41ddfb0811..d0171ba58c 100644 --- a/redirects_generator/definitions.wpf.json +++ b/redirects_generator/definitions.wpf.json @@ -1,7 +1,7 @@ { "Moniker1": "netframeworkdesktop-4.8", "RepoPath1": "dotnet-desktop-guide/framework/", - "Moniker2": "netdesktop-7.0", + "Moniker2": "netdesktop-8.0", "RepoPath2": "dotnet-desktop-guide/net/", "PublishRoot": "/dotnet/desktop/", "Entries": [ @@ -10,267 +10,267 @@ { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/introduction-to-wpf?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/overview/?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/overview/?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/getting-started/walkthrough-my-first-wpf-desktop-application?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/get-started/create-app-visual-studio?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/get-started/create-app-visual-studio?view=netdesktop-8.0" }, // Windows { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/app-development/wpf-windows-overview?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/windows/index?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/windows/index?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/app-development/dialog-boxes-overview?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/windows/dialog-boxes-overview?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/windows/dialog-boxes-overview?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/app-development/how-to-open-a-window?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/windows/how-to-open-window-dialog-box?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/windows/how-to-open-window-dialog-box?view=netdesktop-8.0" }, { "Redirect": "OneWay", "SourceUrl": "/dotnet/desktop/wpf/app-development/how-to-open-a-dialog-box?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/windows/how-to-open-window-dialog-box?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/windows/how-to-open-window-dialog-box?view=netdesktop-8.0" }, { "Redirect": "OneWay", "SourceUrl": "/dotnet/desktop/wpf/how-to-return-a-dialog-box-result?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/windows/how-to-open-window-dialog-box?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/windows/how-to-open-window-dialog-box?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/app-development/how-to-open-a-message-box?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/windows/how-to-open-message-box?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/windows/how-to-open-message-box?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/app-development/how-to-get-and-set-the-main-application-window?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/windows/how-to-get-set-main-application-window?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/windows/how-to-get-set-main-application-window?view=netdesktop-8.0" }, // Data { "Redirect": "OneWay", "SourceUrl": "/dotnet/desktop/wpf/data/data-binding-overview?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/data/index?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/data/index?view=netdesktop-8.0" }, { "Redirect": "OneWay", "SourceUrl": "/dotnet/desktop/wpf/data/how-to-specify-the-direction-of-the-binding?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/data/binding-declarations-overview?view=netdesktop-7.0#binding-direction" + "TargetUrl": "/dotnet/desktop/wpf/data/binding-declarations-overview?view=netdesktop-8.0#binding-direction" }, // Documents/Printing { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/printing-overview?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/documents/printing-overview?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/documents/printing-overview?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/how-to-invoke-a-print-dialog?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/documents/how-to-display-print-dialog?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/documents/how-to-display-print-dialog?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/how-to-programmatically-print-xps-files?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/documents/how-to-print-xps-files?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/documents/how-to-print-xps-files?view=netdesktop-8.0" }, // Systems - Events { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/how-to-add-an-event-handler-using-code?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/events/how-to-add-an-event-handler-using-code?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/events/how-to-add-an-event-handler-using-code?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/how-to-create-a-custom-routed-event?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/events/how-to-create-a-custom-routed-event?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/events/how-to-create-a-custom-routed-event?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/visual-basic-and-wpf-event-handling?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/events/visual-basic-and-wpf-event-handling?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/events/visual-basic-and-wpf-event-handling?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/preview-events?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/events/preview-events?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/events/preview-events?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/marking-routed-events-as-handled-and-class-handling?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/events/marking-routed-events-as-handled-and-class-handling?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/events/marking-routed-events-as-handled-and-class-handling?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/object-lifetime-events?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/events/object-lifetime-events?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/events/object-lifetime-events?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/weak-event-patterns?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/events/weak-event-patterns?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/events/weak-event-patterns?view=netdesktop-8.0" }, { "SourceUrl": "/dotnet/desktop/wpf/advanced/property-change-events?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/events/property-change-events?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/events/property-change-events?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/attached-events-overview?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/events/attached-events-overview?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/events/attached-events-overview?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/routed-events-overview?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/events/routed-events-overview?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/events/routed-events-overview?view=netdesktop-8.0" }, // Systems - Properties { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/dependency-properties-overview?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/properties/dependency-properties-overview?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/properties/dependency-properties-overview?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/dependency-property-value-precedence?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/properties/dependency-property-value-precedence?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/properties/dependency-property-value-precedence?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/attached-properties-overview?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/properties/attached-properties-overview?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/properties/attached-properties-overview?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/collection-type-dependency-properties?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/properties/collection-type-dependency-properties?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/properties/collection-type-dependency-properties?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/how-to-register-an-attached-property?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/properties/how-to-register-an-attached-property?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/properties/how-to-register-an-attached-property?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/how-to-implement-a-dependency-property?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/properties/how-to-implement-a-dependency-property?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/properties/how-to-implement-a-dependency-property?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/custom-dependency-properties?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/properties/custom-dependency-properties?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/properties/custom-dependency-properties?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/dependency-property-metadata?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/properties/dependency-property-metadata?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/properties/dependency-property-metadata?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/how-to-override-metadata-for-a-dependency-property?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/properties/how-to-override-metadata-for-a-dependency-property?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/properties/how-to-override-metadata-for-a-dependency-property?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/dependency-property-callbacks-and-validation?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/properties/dependency-property-callbacks-and-validation?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/properties/dependency-property-callbacks-and-validation?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/read-only-dependency-properties?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/properties/read-only-dependency-properties?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/properties/read-only-dependency-properties?view=netdesktop-8.0" }, { "SourceUrl": "/dotnet/desktop/wpf/advanced/framework-property-metadata?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/properties/framework-property-metadata?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/properties/framework-property-metadata?view=netdesktop-8.0" }, { "SourceUrl": "/dotnet/desktop/wpf/advanced/dependency-property-security?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/properties/dependency-property-security?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/properties/dependency-property-security?view=netdesktop-8.0" }, { "SourceUrl": "/dotnet/desktop/wpf/advanced/safe-constructor-patterns-for-dependencyobjects?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/properties/safe-constructor-patterns-for-dependencyobjects?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/properties/safe-constructor-patterns-for-dependencyobjects?view=netdesktop-8.0" }, { "SourceUrl": "/dotnet/desktop/wpf/advanced/property-value-inheritance?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/properties/property-value-inheritance?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/properties/property-value-inheritance?view=netdesktop-8.0" }, { "SourceUrl": "/dotnet/desktop/wpf/advanced/xaml-loading-and-dependency-properties?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/properties/xaml-loading-and-dependency-properties?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/properties/xaml-loading-and-dependency-properties?view=netdesktop-8.0" }, // Systems - XAML { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/xaml-resources-define?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/systems/xaml-resources-overview?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/systems/xaml-resources-overview?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/resources-and-code?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/systems/xaml-resources-and-code?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/systems/xaml-resources-and-code?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/merged-resource-dictionaries?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/systems/xaml-resources-merged-dictionaries?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/systems/xaml-resources-merged-dictionaries?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/how-to-define-and-reference-a-resource?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/systems/xaml-resources-how-to-define-and-reference?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/systems/xaml-resources-how-to-define-and-reference?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/how-to-use-application-resources?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/systems/xaml-resources-how-to-use-application?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/systems/xaml-resources-how-to-use-application?view=netdesktop-8.0" }, { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/how-to-use-systemfonts?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/systems/xaml-resources-how-to-use-system?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/systems/xaml-resources-how-to-use-system?view=netdesktop-8.0" }, { "Redirect": "OneWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/how-to-use-system-fonts-keys?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/systems/xaml-resources-how-to-use-system?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/systems/xaml-resources-how-to-use-system?view=netdesktop-8.0" }, { "Redirect": "OneWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/how-to-use-systemparameters?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/systems/xaml-resources-how-to-use-system?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/systems/xaml-resources-how-to-use-system?view=netdesktop-8.0" }, { "Redirect": "OneWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/how-to-use-system-parameters-keys?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/systems/xaml-resources-how-to-use-system?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/systems/xaml-resources-how-to-use-system?view=netdesktop-8.0" }, // XAML { "Redirect": "TwoWay", "SourceUrl": "/dotnet/desktop/wpf/advanced/xaml-in-wpf?view=netframeworkdesktop-4.8", - "TargetUrl": "/dotnet/desktop/wpf/xaml/index?view=netdesktop-7.0" + "TargetUrl": "/dotnet/desktop/wpf/xaml/index?view=netdesktop-8.0" }, // section? //{ // "Redirect": "TwoWay", // "SourceUrl": "/dotnet/desktop/wpf/aaaaaa?view=netframeworkdesktop-4.8", - // "TargetUrl": "/dotnet/desktop/wpf/aaaaaa?view=netdesktop-7.0" + // "TargetUrl": "/dotnet/desktop/wpf/aaaaaa?view=netdesktop-8.0" //}, // ======== @@ -278,42 +278,38 @@ // ======== { "Redirect": "OneWay", - "SourceUrl": "/dotnet/desktop/wpf/fundamentals/xaml?view=netdesktop-7.0", - "TargetUrl": "/dotnet/desktop/wpf/xaml/index?view=netdesktop-7.0" + "SourceUrl": "/dotnet/desktop/wpf/fundamentals/xaml?view=netdesktop-8.0", + "TargetUrl": "/dotnet/desktop/wpf/xaml/index?view=netdesktop-8.0" }, { "Redirect": "OneWay", - "SourceUrl": "/dotnet/desktop/wpf/fundamentals/xaml-resources-define?view=netdesktop-7.0", - "TargetUrl": "/dotnet/desktop/wpf/systems/xaml-resources-overview?view=netdesktop-7.0" + "SourceUrl": "/dotnet/desktop/wpf/fundamentals/xaml-resources-define?view=netdesktop-8.0", + "TargetUrl": "/dotnet/desktop/wpf/systems/xaml-resources-overview?view=netdesktop-8.0" }, { "Redirect": "OneWay", - "SourceUrl": "/dotnet/desktop/wpf/fundamentals/styles-templates-overview?view=netdesktop-7.0", - "TargetUrl": "/dotnet/desktop/wpf/controls/styles-templates-overview?view=netdesktop-7.0" + "SourceUrl": "/dotnet/desktop/wpf/fundamentals/styles-templates-overview?view=netdesktop-8.0", + "TargetUrl": "/dotnet/desktop/wpf/controls/styles-templates-overview?view=netdesktop-8.0" }, { "Redirect": "OneWay", - "SourceUrl": "/dotnet/desktop/wpf/fundamentals/styles-templates-create-apply-style?view=netdesktop-7.0", - "TargetUrl": "/dotnet/desktop/wpf/controls/how-to-create-apply-style?view=netdesktop-7.0" + "SourceUrl": "/dotnet/desktop/wpf/fundamentals/styles-templates-create-apply-style?view=netdesktop-8.0", + "TargetUrl": "/dotnet/desktop/wpf/controls/how-to-create-apply-style?view=netdesktop-8.0" }, { "Redirect": "OneWay", - "SourceUrl": "/dotnet/desktop/wpf/themes/how-to-create-apply-template?view=netdesktop-7.0", - "TargetUrl": "/dotnet/desktop/wpf/controls/how-to-create-apply-template?view=netdesktop-7.0" + "SourceUrl": "/dotnet/desktop/wpf/themes/how-to-create-apply-template?view=netdesktop-8.0", + "TargetUrl": "/dotnet/desktop/wpf/controls/how-to-create-apply-template?view=netdesktop-8.0" }, { "Redirect": "NormalDocId", - "SourceUrl": "/dotnet/desktop/wpf/data/data-binding-overview?view=netdesktop-7.0", - "TargetUrl": "/dotnet/desktop/wpf/data/index?view=netdesktop-7.0" - }, + "SourceUrl": "/dotnet/desktop/wpf/data/data-binding-overview?view=netdesktop-8.0", + "TargetUrl": "/dotnet/desktop/wpf/data/index?view=netdesktop-8.0" + } // ======== - // WPF Index mappings + // WPF Index mappings ... none // ======== - { - "Redirect": "Normal", - "SourceUrl": "/dotnet/desktop/wpf/whats-new/index?view=netdesktop-7.0", - "TargetUrl": "/dotnet/desktop/wpf/whats-new/net70?view=netdesktop-7.0" - } + ] } diff --git a/redirects_generator/redirects.cs b/redirects_generator/redirects.cs index 27d94b2644..a2d602e058 100644 --- a/redirects_generator/redirects.cs +++ b/redirects_generator/redirects.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; +using System.Linq; using System.Text.Json; using System.Text.Json.Serialization; @@ -65,7 +65,7 @@ } Console.WriteLine($"Loading definitions from '{definitionsFilePath}'"); -Document document = JsonSerializer.Deserialize(System.IO.File.ReadAllText(definitionsFilePath), options); +Document definitionsDocument = JsonSerializer.Deserialize(System.IO.File.ReadAllText(definitionsFilePath), options); // Load the source redirects file RedirectsFile redirects; @@ -77,15 +77,18 @@ Counters.LoadedRedirects = redirects.redirections.Length; +// Create a copy of the existing redirects. Any left over in this collection weren't declared by the definition. +List redirectsLeftOver = new(redirects.redirections); + // Make sure there are entries -if (document.Entries.Length == 0) +if (definitionsDocument.Entries.Length == 0) { Console.WriteLine("No entries found in definition file"); Environment.Exit(0); } Console.WriteLine("Reading all entries"); -foreach (Entry item in document.Entries) +foreach (Entry item in definitionsDocument.Entries) { if (item.Redirect == RedirectType.Normal) { @@ -103,8 +106,8 @@ else { - string sourceMoniker = item.SourceUrl.Contains(document.Moniker1, StringComparison.OrdinalIgnoreCase) ? document.Moniker1 : document.Moniker2; - string targetMoniker = sourceMoniker == document.Moniker1 ? document.Moniker2 : document.Moniker1; + string sourceMoniker = item.SourceUrl.Contains(definitionsDocument.Moniker1, StringComparison.OrdinalIgnoreCase) ? definitionsDocument.Moniker1 : definitionsDocument.Moniker2; + string targetMoniker = sourceMoniker == definitionsDocument.Moniker1 ? definitionsDocument.Moniker2 : definitionsDocument.Moniker1; if (item.Redirect == RedirectType.TwoWay) { @@ -118,7 +121,23 @@ } } -Console.WriteLine($"Redirects file has {Counters.LoadedRedirects} existing entries."); +var matchedRedirects = from r in redirects.redirections + from s in definitionsDocument.Entries + where r.redirect_url == s.TargetUrl || r.redirect_url == s.SourceUrl + select r; +var unmatchedRedirects = redirects.redirections.Where(r => !matchedRedirects.Contains(r)); + +Counters.RedirectsNotDefined = unmatchedRedirects.Count(); + +Console.WriteLine($"Existing entries: {Counters.LoadedRedirects}"); +Console.WriteLine($"New entries: {Counters.NewRedirects}"); +Console.WriteLine($"Updated entries: {Counters.ModifiedRedirects}"); +Console.WriteLine($"Not-defined entries: {Counters.RedirectsNotDefined}"); + +foreach (RedirectEntry entry in unmatchedRedirects) + Console.WriteLine($" {entry.source_path}"); + +Console.WriteLine(); // After creating or updating all of the redirection entries, check to see if there were any changes if (Counters.ModifiedRedirects == 0 && Counters.NewRedirects == 0) @@ -127,15 +146,9 @@ Environment.Exit(0); } -Console.WriteLine(); -Console.WriteLine($"New entries: {Counters.NewRedirects}"); -Console.WriteLine($"Updated entries: {Counters.ModifiedRedirects}"); -Console.WriteLine(); - - // There were changes, save them. Console.WriteLine($"Erasing '{srcRedirectFilePath}'"); -System.IO.File.Delete(srcRedirectFilePath); +//System.IO.File.Delete(srcRedirectFilePath); Console.WriteLine($"Writing '{srcRedirectFilePath}'"); @@ -146,7 +159,7 @@ formattedJson += "\r\n"; // add newline at end. // Save new content to source path. -File.WriteAllText(srcRedirectFilePath, formattedJson); +//File.WriteAllText(srcRedirectFilePath, formattedJson); @@ -157,17 +170,17 @@ void CreateEntry(string sourceMoniker, string sourceUrl, string targetUrl) { // Opposite repo paths are used here according to moniker - string sourceFile = NormalizeMarkdownIndex(document.MonikerToMarkdown(sourceUrl, sourceMoniker, document.Moniker1 == sourceMoniker ? document.RepoPath2 : document.RepoPath1)); + string sourceFile = NormalizeMarkdownIndex(definitionsDocument.MonikerToMarkdown(sourceUrl, sourceMoniker, definitionsDocument.Moniker1 == sourceMoniker ? definitionsDocument.RepoPath2 : definitionsDocument.RepoPath1)); redirects.AddRedirect(sourceFile, targetUrl, false); } void CreateNormalEntry(string sourceUrl, string targetUrl, bool redirectDocId) { - if (sourceUrl.Contains(document.Moniker1, StringComparison.OrdinalIgnoreCase)) - sourceUrl = document.MonikerToMarkdown(sourceUrl, document.Moniker1, document.RepoPath1); + if (sourceUrl.Contains(definitionsDocument.Moniker1, StringComparison.OrdinalIgnoreCase)) + sourceUrl = definitionsDocument.MonikerToMarkdown(sourceUrl, definitionsDocument.Moniker1, definitionsDocument.RepoPath1); - else if (sourceUrl.Contains(document.Moniker2, StringComparison.OrdinalIgnoreCase)) - sourceUrl = document.MonikerToMarkdown(sourceUrl, document.Moniker2, document.RepoPath2); + else if (sourceUrl.Contains(definitionsDocument.Moniker2, StringComparison.OrdinalIgnoreCase)) + sourceUrl = definitionsDocument.MonikerToMarkdown(sourceUrl, definitionsDocument.Moniker2, definitionsDocument.RepoPath2); redirects.AddRedirect(sourceUrl, targetUrl, redirectDocId); } @@ -206,6 +219,7 @@ static class Counters public static int LoadedRedirects = 0; public static int NewRedirects = 0; public static int ModifiedRedirects = 0; + public static int RedirectsNotDefined = 0; } class Entry @@ -229,7 +243,7 @@ public void AddRedirect(string source, string targetUrl, bool redirectDocId) foreach (RedirectEntry item in _redirects) { - // Exisint redirect found in publishing redirection file, update it + // Existing redirect found in publishing redirection file, update it if (string.Equals(item.source_path, source, StringComparison.OrdinalIgnoreCase)) { // Entry exists and doesn't need to be modified diff --git a/redirects_generator/redirs.csproj b/redirects_generator/redirs.csproj index 99db57ebb8..a6bde46e26 100644 --- a/redirects_generator/redirs.csproj +++ b/redirects_generator/redirs.csproj @@ -9,6 +9,9 @@ Always + + Always + Always From c9033779861fc55b7d3a10b35b65aebde8b1bfab Mon Sep 17 00:00:00 2001 From: "Andy (Steve) De George" <67293991+adegeo@users.noreply.github.com> Date: Mon, 28 Oct 2024 17:45:01 -0700 Subject: [PATCH 9/9] WPF Freshness pass - .NET (#1911) * WPF-Update dates; fix description lengths * WPF-Alter what's new style * Remove invalid redirect --- .openpublishing.redirection.wpf.json | 4 --- .../wpf/controls/how-to-create-apply-style.md | 7 +++-- .../controls/how-to-create-apply-template.md | 8 ++++-- .../wpf/controls/styles-templates-overview.md | 6 +++-- .../wpf/data/binding-declarations-overview.md | 5 ++-- .../net/wpf/data/binding-sources-overview.md | 13 ++++----- .../wpf/data/how-to-bind-to-an-enumeration.md | 3 ++- .../data/how-to-create-a-simple-binding.md | 4 +-- dotnet-desktop-guide/net/wpf/data/index.md | 5 ++-- .../documents/how-to-display-print-dialog.md | 3 ++- .../wpf/documents/how-to-print-xps-files.md | 3 ++- .../net/wpf/documents/printing-overview.md | 3 ++- .../wpf/events/attached-events-overview.md | 3 ++- .../how-to-add-an-event-handler-using-code.md | 3 ++- .../how-to-create-a-custom-routed-event.md | 3 ++- ...ed-events-as-handled-and-class-handling.md | 3 ++- .../net/wpf/events/object-lifetime-events.md | 3 ++- .../net/wpf/events/preview-events.md | 5 ++-- .../net/wpf/events/property-change-events.md | 3 ++- .../net/wpf/events/routed-events-overview.md | 7 ++--- .../visual-basic-and-wpf-event-handling.md | 3 ++- .../net/wpf/events/weak-event-patterns.md | 3 ++- .../get-started/create-app-visual-studio.md | 3 ++- .../net/wpf/overview/index.md | 3 ++- .../attached-properties-overview.md | 3 ++- .../collection-type-dependency-properties.md | 3 ++- .../custom-dependency-properties.md | 3 ++- .../dependency-properties-overview.md | 3 ++- ...dency-property-callbacks-and-validation.md | 3 ++- .../dependency-property-metadata.md | 3 ++- .../dependency-property-security.md | 3 ++- .../dependency-property-value-precedence.md | 3 ++- .../properties/framework-property-metadata.md | 3 ++- .../how-to-implement-a-dependency-property.md | 3 ++- ...ride-metadata-for-a-dependency-property.md | 3 ++- .../how-to-register-an-attached-property.md | 3 ++- .../properties/property-value-inheritance.md | 3 ++- .../read-only-dependency-properties.md | 3 ++- ...structor-patterns-for-dependencyobjects.md | 3 ++- .../xaml-loading-and-dependency-properties.md | 3 ++- .../wpf/systems/xaml-resources-and-code.md | 5 ++-- ...l-resources-how-to-define-and-reference.md | 3 ++- .../xaml-resources-how-to-use-application.md | 3 ++- .../xaml-resources-how-to-use-system.md | 3 ++- .../xaml-resources-merged-dictionaries.md | 5 ++-- .../wpf/systems/xaml-resources-overview.md | 5 ++-- dotnet-desktop-guide/net/wpf/toc.yml | 2 ++ .../net/wpf/whats-new/index.md | 27 +++++++++++++++++++ .../net/wpf/whats-new/net70.md | 4 +-- .../net/wpf/whats-new/net80.md | 4 +-- .../net/wpf/windows/dialog-boxes-overview.md | 5 ++-- .../windows/how-to-close-window-dialog-box.md | 5 ++-- .../how-to-get-set-main-application-window.md | 5 ++-- .../how-to-open-common-system-dialog-box.md | 5 ++-- .../wpf/windows/how-to-open-message-box.md | 5 ++-- .../windows/how-to-open-window-dialog-box.md | 5 ++-- dotnet-desktop-guide/net/wpf/windows/index.md | 5 ++-- dotnet-desktop-guide/net/wpf/xaml/index.md | 5 ++-- 58 files changed, 169 insertions(+), 86 deletions(-) create mode 100644 dotnet-desktop-guide/net/wpf/whats-new/index.md diff --git a/.openpublishing.redirection.wpf.json b/.openpublishing.redirection.wpf.json index e08fbaad96..d44ea6da5e 100644 --- a/.openpublishing.redirection.wpf.json +++ b/.openpublishing.redirection.wpf.json @@ -396,10 +396,6 @@ { "source_path": "dotnet-desktop-guide/framework/wpf/events/routed-events-overview.md", "redirect_url": "/dotnet/desktop/wpf/advanced/routed-events-overview?view=netframeworkdesktop-4.8" - }, - { - "source_path": "dotnet-desktop-guide/net/wpf/whats-new/index.md", - "redirect_url": "/dotnet/desktop/wpf/whats-new/net70?view=netdesktop-7.0" } ] } diff --git a/dotnet-desktop-guide/net/wpf/controls/how-to-create-apply-style.md b/dotnet-desktop-guide/net/wpf/controls/how-to-create-apply-style.md index f7fd6d3eb2..86020f65e3 100644 --- a/dotnet-desktop-guide/net/wpf/controls/how-to-create-apply-style.md +++ b/dotnet-desktop-guide/net/wpf/controls/how-to-create-apply-style.md @@ -1,10 +1,11 @@ --- title: How to create a style for a control -description: Learn how to create and reference a control style in Windows Presentation Foundation and .NET. +description: Learn how to create and reference a control style in Windows Presentation Foundation and .NET. Control styles can be implemented through resource dictionaries. author: adegeo ms.author: adegeo -ms.date: 04/15/2021 +ms.date: 10/22/2024 ms.topic: conceptual +ms.custom: update-template dev_langs: - "csharp" - "vb" @@ -80,6 +81,8 @@ Perhaps you want your two elements to s :::code language="xaml" source="./snippets/how-to-create-apply-style/csharp/Window2.xaml" id="SnippetDefaultTextBlockStyleBasedOn"::: +Then, apply the style to a `TextBlock`. + :::code language="xaml" source="./snippets/how-to-create-apply-style/csharp/Window2.xaml" id="SnippetTextBlocksExplicit"::: This `TextBlock` style is now centered, uses a `Comic Sans MS` font with a size of `26`, and the foreground color set to the shown in the example. Notice that it overrides the value of the base style. If there's more than one pointing to the same property in a , the `Setter` that is declared last takes precedence. diff --git a/dotnet-desktop-guide/net/wpf/controls/how-to-create-apply-template.md b/dotnet-desktop-guide/net/wpf/controls/how-to-create-apply-template.md index e2a925ffb6..fe7574b3ab 100644 --- a/dotnet-desktop-guide/net/wpf/controls/how-to-create-apply-template.md +++ b/dotnet-desktop-guide/net/wpf/controls/how-to-create-apply-template.md @@ -1,11 +1,12 @@ --- title: How to create a template -description: Learn how to create and reference a control template in Windows Presentation Foundation and .NET. +description: Learn how to create and reference a control template in Windows Presentation Foundation and .NET. Templates can be implemented in a resource dictionary. author: adegeo ms.author: adegeo -ms.date: 02/15/2023 +ms.date: 10/22/2024 no-loc: ["", "", "", "", "", "", "", "", "", "", "", "", "SizeToContent", "MinWidth", "TargetType", "Title"] ms.topic: how-to +ms.custom: update-template helpviewer_keywords: - "control contract [WPF]" - "controls [WPF], visual structure changes" @@ -13,6 +14,9 @@ helpviewer_keywords: - "skinning controls [WPF]" - "controls [WPF], appearance specified by state" - "templates [WPF], custom for existing controls" + +#customer intent: As a developer I want to create a template to a control. + --- # How to create a template for a control (WPF.NET) diff --git a/dotnet-desktop-guide/net/wpf/controls/styles-templates-overview.md b/dotnet-desktop-guide/net/wpf/controls/styles-templates-overview.md index 9bbffc3c4e..e9a26e0829 100644 --- a/dotnet-desktop-guide/net/wpf/controls/styles-templates-overview.md +++ b/dotnet-desktop-guide/net/wpf/controls/styles-templates-overview.md @@ -3,14 +3,16 @@ title: Styles and templates description: Learn about XAML resources in Windows Presentation Foundation (WPF) for .NET. Understand the types of XAML resources related to styles and themes. author: adegeo ms.author: adegeo -ms.date: 04/15/2021 +ms.date: 10/22/2024 ms.topic: overview +ms.custom: update-template dev_langs: - "csharp" - "vb" +#customer intent: As a developer I need to know about how styles and templates work. --- -# Styles and templates (WPF .NET) +# What are styles and templates? (WPF .NET) Windows Presentation Foundation (WPF) styling and templating refer to a suite of features that let developers and designers create visually compelling effects and a consistent appearance for their product. When customizing the appearance of an app, you want a strong styling and templating model that enables maintenance and sharing of appearance within and among apps. WPF provides that model. diff --git a/dotnet-desktop-guide/net/wpf/data/binding-declarations-overview.md b/dotnet-desktop-guide/net/wpf/data/binding-declarations-overview.md index 5d16435ff7..a6621d56e5 100644 --- a/dotnet-desktop-guide/net/wpf/data/binding-declarations-overview.md +++ b/dotnet-desktop-guide/net/wpf/data/binding-declarations-overview.md @@ -1,9 +1,10 @@ --- title: Binding declarations overview description: Learn how to declare a data binding in XAML or code for your application development in Windows Presentation Foundation (WPF). -ms.date: 04/27/2021 +ms.date: 10/22/2024 author: adegeo ms.author: adegeo +ms.custom: update-template dev_langs: - "csharp" - "vb" @@ -16,7 +17,7 @@ helpviewer_keywords: - "binding declarations [WPF]" --- -# Binding declarations overview (WPF .NET) +# What are binding declarations? (WPF .NET) Typically, developers declare the bindings directly in the XAML markup of the UI elements they want to bind data to. However, you can also declare bindings in code. This article describes how to declare bindings in both XAML and in code. diff --git a/dotnet-desktop-guide/net/wpf/data/binding-sources-overview.md b/dotnet-desktop-guide/net/wpf/data/binding-sources-overview.md index 592c59b75e..4a868475f2 100644 --- a/dotnet-desktop-guide/net/wpf/data/binding-sources-overview.md +++ b/dotnet-desktop-guide/net/wpf/data/binding-sources-overview.md @@ -1,16 +1,17 @@ --- title: Binding sources overview description: Discover the types of objects you can use as the binding source for your applications in Windows Presentation Foundation (WPF). -ms.date: 02/15/2023 +ms.date: 10/22/2024 author: adegeo ms.author: adegeo +ms.custom: update-template helpviewer_keywords: - "binding data [WPF], binding sources" - "data binding [WPF], binding source" - "binding sources [WPF]" --- -# Binding sources overview (WPF .NET) +# What are Binding sources? (WPF .NET) In data binding, the binding source object refers to the object you obtain data from. This article discusses the types of objects you can use as the binding source, like .NET CLR objects, XML, and objects. @@ -52,13 +53,13 @@ If you're using either or interface. +- Implement the interface. - This is the recommended mechanism for notifications. The supplies the event, which the binding system respects. By raising this event, and providing the name of the property that changed, you'll notify a binding target of the change. + This is the recommended mechanism for notifications. The supplies the event, which the binding system respects. By raising this event, and providing the name of the property that changed, you'll notify a binding target of the change. -01. Implement the `PropertyChanged` pattern. +- Implement the `PropertyChanged` pattern. - Each property that needs to notify a binding target that it's changed, has a corresponding `PropertyNameChanged` event, where `PropertyName` is the name of the property. You raise the event every time the property changes. + Each property that needs to notify a binding target that it's changed, has a corresponding `PropertyNameChanged` event, where `PropertyName` is the name of the property. You raise the event every time the property changes. If your binding source implements one of these notification mechanisms, target updates happen automatically. If for any reason your binding source doesn't provide the proper property changed notifications, you can use the method to update the target property explicitly. diff --git a/dotnet-desktop-guide/net/wpf/data/how-to-bind-to-an-enumeration.md b/dotnet-desktop-guide/net/wpf/data/how-to-bind-to-an-enumeration.md index c60287d58f..2a716669b9 100644 --- a/dotnet-desktop-guide/net/wpf/data/how-to-bind-to-an-enumeration.md +++ b/dotnet-desktop-guide/net/wpf/data/how-to-bind-to-an-enumeration.md @@ -3,7 +3,8 @@ title: How to bind to an enumeration description: Learn how to use data binding to bind an enumeration to a collection object in XAML and in code for Windows Presentation Foundation. author: adegeo ms.author: adegeo -ms.date: 04/30/2021 +ms.date: 10/22/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/data/how-to-create-a-simple-binding.md b/dotnet-desktop-guide/net/wpf/data/how-to-create-a-simple-binding.md index 70aa8e1ca5..1f970dd9d3 100644 --- a/dotnet-desktop-guide/net/wpf/data/how-to-create-a-simple-binding.md +++ b/dotnet-desktop-guide/net/wpf/data/how-to-create-a-simple-binding.md @@ -1,7 +1,7 @@ --- title: "How to create a data binding" description: Create a simple binding for your applications through this how-to example in Windows Presentation Foundation (WPF). -ms.date: 07/24/2024 +ms.date: 10/22/2024 dev_langs: - "csharp" - "vb" @@ -9,7 +9,7 @@ helpviewer_keywords: - "simple binding [WPF], creating" - "data binding [WPF], creating simple bindings" - "binding data [WPF], creating" -#customer intent: As a devleoper, I want to create a binding so that I can present information in a UI +#customer intent: As a developer, I want to create a binding so that I can present information in a UI --- # How to create a data binding (WPF .NET) diff --git a/dotnet-desktop-guide/net/wpf/data/index.md b/dotnet-desktop-guide/net/wpf/data/index.md index f7583bb513..c7a20f8a29 100644 --- a/dotnet-desktop-guide/net/wpf/data/index.md +++ b/dotnet-desktop-guide/net/wpf/data/index.md @@ -1,9 +1,10 @@ --- title: Data binding overview -description: Learn about the different data sources you can add to your project in Windows Presentation Foundation for .NET. Data sources can be bound to XAML elements to create dynamic apps. +description: Learn about data binding in Windows Presentation Foundation for .NET. You can bind data to UI elements to create dynamic apps. author: adegeo -ms.date: 04/22/2021 +ms.date: 10/22/2024 ms.author: adegeo +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/documents/how-to-display-print-dialog.md b/dotnet-desktop-guide/net/wpf/documents/how-to-display-print-dialog.md index 06fc5fb62e..f74fe4f2fb 100644 --- a/dotnet-desktop-guide/net/wpf/documents/how-to-display-print-dialog.md +++ b/dotnet-desktop-guide/net/wpf/documents/how-to-display-print-dialog.md @@ -1,7 +1,8 @@ --- title: How to display a print dialog description: Learn how to print from your application by using the System.Windows.Controls.PrintDialog class to open a standard Microsoft Windows print dialog box. -ms.date: 08/20/2021 +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/documents/how-to-print-xps-files.md b/dotnet-desktop-guide/net/wpf/documents/how-to-print-xps-files.md index 845ed2e9b3..2f0bf162d2 100644 --- a/dotnet-desktop-guide/net/wpf/documents/how-to-print-xps-files.md +++ b/dotnet-desktop-guide/net/wpf/documents/how-to-print-xps-files.md @@ -1,7 +1,8 @@ --- title: How to print an XML Paper Specification (XPS) file description: Learn how to print an XPS file from your application by using the System.Printing.PrintQueue.AddJob method. -ms.date: 09/16/2021 +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/documents/printing-overview.md b/dotnet-desktop-guide/net/wpf/documents/printing-overview.md index d151032a68..cf48c37f9b 100644 --- a/dotnet-desktop-guide/net/wpf/documents/printing-overview.md +++ b/dotnet-desktop-guide/net/wpf/documents/printing-overview.md @@ -1,8 +1,9 @@ --- title: Printing documents overview description: Learn about the printing and print system management APIs available with Windows Presentation Foundation (WPF). -ms.date: 09/22/2021 +ms.date: 10/24/2024 ms.topic: overview +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/events/attached-events-overview.md b/dotnet-desktop-guide/net/wpf/events/attached-events-overview.md index d48f08427a..9b6c3e5843 100644 --- a/dotnet-desktop-guide/net/wpf/events/attached-events-overview.md +++ b/dotnet-desktop-guide/net/wpf/events/attached-events-overview.md @@ -1,8 +1,9 @@ --- title: "Attached events overview" description: Learn about attached events in Windows Presentation Foundation (WPF) and how to add a handler to an arbitrary element. -ms.date: "04/19/2022" +ms.date: 10/24/2024 ms.topic: overview +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/events/how-to-add-an-event-handler-using-code.md b/dotnet-desktop-guide/net/wpf/events/how-to-add-an-event-handler-using-code.md index 93d79f5b74..c8fea5aa4b 100644 --- a/dotnet-desktop-guide/net/wpf/events/how-to-add-an-event-handler-using-code.md +++ b/dotnet-desktop-guide/net/wpf/events/how-to-add-an-event-handler-using-code.md @@ -1,7 +1,8 @@ --- title: "How to add an event handler using code" description: Learn how to add an event handler in code-behind for an element in Windows Presentation Foundation (WPF). -ms.date: "02/01/2021" +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/events/how-to-create-a-custom-routed-event.md b/dotnet-desktop-guide/net/wpf/events/how-to-create-a-custom-routed-event.md index 094c86a9c0..5db234c667 100644 --- a/dotnet-desktop-guide/net/wpf/events/how-to-create-a-custom-routed-event.md +++ b/dotnet-desktop-guide/net/wpf/events/how-to-create-a-custom-routed-event.md @@ -1,7 +1,8 @@ --- title: "How to create a custom routed event" description: Learn how to implement a custom routed event for an element in Windows Presentation Foundation (WPF). -ms.date: "02/02/2022" +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/events/marking-routed-events-as-handled-and-class-handling.md b/dotnet-desktop-guide/net/wpf/events/marking-routed-events-as-handled-and-class-handling.md index ede181240d..0ce355d34b 100644 --- a/dotnet-desktop-guide/net/wpf/events/marking-routed-events-as-handled-and-class-handling.md +++ b/dotnet-desktop-guide/net/wpf/events/marking-routed-events-as-handled-and-class-handling.md @@ -1,7 +1,8 @@ --- title: "Marking routed events as handled, and class handling" description: Learn about class handling of routed events in Windows Presentation Foundation (WPF) and when to mark a routed event as handled. -ms.date: "03/21/2022" +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/events/object-lifetime-events.md b/dotnet-desktop-guide/net/wpf/events/object-lifetime-events.md index 0145952e7a..c57e97a12b 100644 --- a/dotnet-desktop-guide/net/wpf/events/object-lifetime-events.md +++ b/dotnet-desktop-guide/net/wpf/events/object-lifetime-events.md @@ -1,7 +1,8 @@ --- title: "Object lifetime events" description: Learn about the object lifetime events for framework-level elements in Windows Presentation Foundation (WPF). -ms.date: "03/31/2022" +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/events/preview-events.md b/dotnet-desktop-guide/net/wpf/events/preview-events.md index 3526088f32..ec0620fed9 100644 --- a/dotnet-desktop-guide/net/wpf/events/preview-events.md +++ b/dotnet-desktop-guide/net/wpf/events/preview-events.md @@ -1,7 +1,8 @@ --- -title: "Preview events" +title: "Preview events for composite controls" description: Learn about preview events in Windows Presentation Foundation (WPF) and how to use preview events for composite control event handling. -ms.date: "03/09/2022" +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/events/property-change-events.md b/dotnet-desktop-guide/net/wpf/events/property-change-events.md index 7691b5e053..59c54dfab8 100644 --- a/dotnet-desktop-guide/net/wpf/events/property-change-events.md +++ b/dotnet-desktop-guide/net/wpf/events/property-change-events.md @@ -1,7 +1,8 @@ --- title: "Property change events" description: Learn about the property changed events and property triggers in Windows Presentation Foundation (WPF). -ms.date: "04/07/2022" +ms.date: 10/24/2024 +ms.custom: update-template helpviewer_keywords: - "dependency properties [WPF], change events" - "property value changes [WPF]" diff --git a/dotnet-desktop-guide/net/wpf/events/routed-events-overview.md b/dotnet-desktop-guide/net/wpf/events/routed-events-overview.md index 7663c49806..0d81389db2 100644 --- a/dotnet-desktop-guide/net/wpf/events/routed-events-overview.md +++ b/dotnet-desktop-guide/net/wpf/events/routed-events-overview.md @@ -1,8 +1,9 @@ --- title: "Routed events overview" description: Learn about routed events in Windows Presentation Foundation (WPF), including how they're routed through an element tree and how to create custom routed events. -ms.date: "04/29/2022" +ms.date: 10/24/2024 ms.topic: overview +ms.custom: update-template dev_langs: - "csharp" - "vb" @@ -47,7 +48,7 @@ Consider the following partial element tree: The element tree renders as shown: -:::image type="content" source="./media/routed-events-overview/yes-no-cancel.png" border="true" alt-text="Yes, No, and Cancel buttons."::: +:::image type="content" source="./media/routed-events-overview/yes-no-cancel.png" border="true" alt-text="A XAML element tree with three buttons: Yes, No, and Cancel."::: Each of the three buttons is a potential event source. When one of the buttons is clicked, it raises the `Click` event that bubbles up from the button to the root element. The and elements don't have event handlers attached, but the does. Possibly other elements higher up in the tree that aren't shown also have `Click` event handlers attached. When the `Click` event reaches the `StackPanel` element, the WPF event system invokes the `YesNoCancelButton_Click` handler that's attached to it. The event route for the `Click` event in the example is: `Button` -> `StackPanel` -> `Border` -> successive parent elements. @@ -205,7 +206,7 @@ A preview input event that's marked as handled won't invoke any normally registe To illustrate how input event processing works, consider the following input event example. In the following tree illustration, `leaf element #2` is the source of both the `PreviewMouseDown` and `MouseDown` paired events: -:::image type="content" source="./media/routed-events-overview/input-event-routing.png" border="true" alt-text="Event routing diagram."::: +:::image type="content" source="./media/routed-events-overview/input-event-routing.png" border="true" alt-text="A diagram that shows how the event routing flows from a root element to other elements."::: The order of event processing following a mouse-down action on leaf element #2 is: diff --git a/dotnet-desktop-guide/net/wpf/events/visual-basic-and-wpf-event-handling.md b/dotnet-desktop-guide/net/wpf/events/visual-basic-and-wpf-event-handling.md index c1d2517c16..0f69c18ded 100644 --- a/dotnet-desktop-guide/net/wpf/events/visual-basic-and-wpf-event-handling.md +++ b/dotnet-desktop-guide/net/wpf/events/visual-basic-and-wpf-event-handling.md @@ -1,7 +1,8 @@ --- title: Visual Basic and WPF event handling description: Learn how to attach handlers to Windows Presentation Foundation (WPF) routed events in Visual Basic. -ms.date: "02/25/2022" +ms.date: 10/24/2024 +ms.custom: update-template helpviewer_keywords: - "Visual Basic [WPF], event handlers" - "event handlers [WPF], Visual Basic" diff --git a/dotnet-desktop-guide/net/wpf/events/weak-event-patterns.md b/dotnet-desktop-guide/net/wpf/events/weak-event-patterns.md index b8b760429b..8696d0325a 100644 --- a/dotnet-desktop-guide/net/wpf/events/weak-event-patterns.md +++ b/dotnet-desktop-guide/net/wpf/events/weak-event-patterns.md @@ -1,7 +1,8 @@ --- title: "Weak event patterns" description: Learn how to use the weak event pattern in Windows Presentation Foundation (WPF) to avoid memory leaks. -ms.date: "04/11/2022" +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/get-started/create-app-visual-studio.md b/dotnet-desktop-guide/net/wpf/get-started/create-app-visual-studio.md index ca7571b6bd..90fab089e8 100644 --- a/dotnet-desktop-guide/net/wpf/get-started/create-app-visual-studio.md +++ b/dotnet-desktop-guide/net/wpf/get-started/create-app-visual-studio.md @@ -1,8 +1,9 @@ --- title: "Create a new app with Visual Studio tutorial" -description: Follow this tutorial to learn how to create a new WPF app for .NET with Visual Studio 2019. +description: Follow this tutorial to learn how to create a new WPF app for .NET with Visual Studio 2022. WPF apps run on Windows. ms.date: 02/07/2023 ms.topic: tutorial +ms.custom: update-template, updateeachrelease dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/overview/index.md b/dotnet-desktop-guide/net/wpf/overview/index.md index 8905b99b32..ca9232ed83 100644 --- a/dotnet-desktop-guide/net/wpf/overview/index.md +++ b/dotnet-desktop-guide/net/wpf/overview/index.md @@ -1,8 +1,9 @@ --- title: What is Windows Presentation Foundation -description: This article gives an overview of WPF with .NET. +description: This article gives an overview of Windows Presentation Foundation (WPF) with .NET. WPF is a Windows-only user interface (UI) framework. ms.date: 02/15/2023 ms.topic: overview +ms.custom: update-template, updateeachrelease dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/properties/attached-properties-overview.md b/dotnet-desktop-guide/net/wpf/properties/attached-properties-overview.md index c776c4b54a..1416832c75 100644 --- a/dotnet-desktop-guide/net/wpf/properties/attached-properties-overview.md +++ b/dotnet-desktop-guide/net/wpf/properties/attached-properties-overview.md @@ -1,8 +1,9 @@ --- title: "Attached properties overview" description: "Learn about the WPF property system and the capabilities of an attached property, which are global properties settable on any object." -ms.date: "10/14/2021" +ms.date: 10/24/2024 ms.topic: overview +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/properties/collection-type-dependency-properties.md b/dotnet-desktop-guide/net/wpf/properties/collection-type-dependency-properties.md index c15fb58392..dfad5a8777 100644 --- a/dotnet-desktop-guide/net/wpf/properties/collection-type-dependency-properties.md +++ b/dotnet-desktop-guide/net/wpf/properties/collection-type-dependency-properties.md @@ -1,7 +1,8 @@ --- title: "Collection-type dependency properties" description: "Learn how to implement a dependency property that's a collection type and how to assign a default collection value." -ms.date: "10/06/2021" +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/properties/custom-dependency-properties.md b/dotnet-desktop-guide/net/wpf/properties/custom-dependency-properties.md index d78ee9f5ec..543f8c07b2 100644 --- a/dotnet-desktop-guide/net/wpf/properties/custom-dependency-properties.md +++ b/dotnet-desktop-guide/net/wpf/properties/custom-dependency-properties.md @@ -1,8 +1,9 @@ --- title: "Custom dependency properties" description: Learn how to implement a dependency property in Windows Presentation Foundation (WPF), and how to improve its performance, usability, or versatility. -ms.date: "10/20/2021" +ms.date: 10/24/2024 ms.topic: overview +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/properties/dependency-properties-overview.md b/dotnet-desktop-guide/net/wpf/properties/dependency-properties-overview.md index 3922a4b3de..258e1d1a1c 100644 --- a/dotnet-desktop-guide/net/wpf/properties/dependency-properties-overview.md +++ b/dotnet-desktop-guide/net/wpf/properties/dependency-properties-overview.md @@ -1,8 +1,9 @@ --- title: "Dependency properties overview" description: Learn about the WPF property system and the capabilities of a dependency property, which is a property that's backed by the WPF property system. -ms.date: "09/23/2021" +ms.date: 10/24/2024 ms.topic: overview +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/properties/dependency-property-callbacks-and-validation.md b/dotnet-desktop-guide/net/wpf/properties/dependency-property-callbacks-and-validation.md index 75d0977a16..4876a9dc5e 100644 --- a/dotnet-desktop-guide/net/wpf/properties/dependency-property-callbacks-and-validation.md +++ b/dotnet-desktop-guide/net/wpf/properties/dependency-property-callbacks-and-validation.md @@ -1,7 +1,8 @@ --- title: "Dependency property callbacks and validation" description: Learn how to implement dependency property callbacks and validation in Windows Presentation Foundation (WPF). -ms.date: "11/11/2021" +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/properties/dependency-property-metadata.md b/dotnet-desktop-guide/net/wpf/properties/dependency-property-metadata.md index 93ccca4bef..6eb9166a98 100644 --- a/dotnet-desktop-guide/net/wpf/properties/dependency-property-metadata.md +++ b/dotnet-desktop-guide/net/wpf/properties/dependency-property-metadata.md @@ -1,7 +1,8 @@ --- title: "Dependency property metadata" description: Learn about dependency property metadata in Windows Presentation Foundation (WPF) and how to create, assign, and override metadata. -ms.date: "11/02/2021" +ms.date: 10/24/2024 +ms.custom: update-template helpviewer_keywords: - "APIs [WPF], metadata" - "dependency properties [WPF], metadata" diff --git a/dotnet-desktop-guide/net/wpf/properties/dependency-property-security.md b/dotnet-desktop-guide/net/wpf/properties/dependency-property-security.md index fc049e833b..1a961eca80 100644 --- a/dotnet-desktop-guide/net/wpf/properties/dependency-property-security.md +++ b/dotnet-desktop-guide/net/wpf/properties/dependency-property-security.md @@ -1,7 +1,8 @@ --- title: "Dependency property security" description: Learn about the dependency property accessibility and security in Windows Presentation Foundation (WPF). -ms.date: "12/03/2021" +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/properties/dependency-property-value-precedence.md b/dotnet-desktop-guide/net/wpf/properties/dependency-property-value-precedence.md index 73e0dd3b30..cad57efe9b 100644 --- a/dotnet-desktop-guide/net/wpf/properties/dependency-property-value-precedence.md +++ b/dotnet-desktop-guide/net/wpf/properties/dependency-property-value-precedence.md @@ -1,7 +1,8 @@ --- title: "Dependency property value precedence" description: Learn how the precedence of different property-based inputs within the WPF property system determines the effective value of a dependency property. -ms.date: "09/30/2021" +ms.date: 10/24/2024 +ms.custom: update-template helpviewer_keywords: - "dependency properties [WPF], classes as owners" - "dependency properties [WPF], metadata" diff --git a/dotnet-desktop-guide/net/wpf/properties/framework-property-metadata.md b/dotnet-desktop-guide/net/wpf/properties/framework-property-metadata.md index 2e26ca5b0f..45de97f87a 100644 --- a/dotnet-desktop-guide/net/wpf/properties/framework-property-metadata.md +++ b/dotnet-desktop-guide/net/wpf/properties/framework-property-metadata.md @@ -1,7 +1,8 @@ --- title: "Framework property metadata" description: Learn how to set framework property metadata for a dependency property in Windows Presentation Foundation (WPF). -ms.date: "11/20/2021" +ms.date: 10/24/2024 +ms.custom: update-template helpviewer_keywords: - "metadata [WPF], framework properties" - "framework property metadata [WPF]" diff --git a/dotnet-desktop-guide/net/wpf/properties/how-to-implement-a-dependency-property.md b/dotnet-desktop-guide/net/wpf/properties/how-to-implement-a-dependency-property.md index c48e65e5e7..a085eec153 100644 --- a/dotnet-desktop-guide/net/wpf/properties/how-to-implement-a-dependency-property.md +++ b/dotnet-desktop-guide/net/wpf/properties/how-to-implement-a-dependency-property.md @@ -1,7 +1,8 @@ --- title: "How to implement a dependency property" description: "Define a dependency property in Windows Presentation Foundation (WPF), by backing a common language runtime property with a DependencyProperty field." -ms.date: "10/15/2021" +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/properties/how-to-override-metadata-for-a-dependency-property.md b/dotnet-desktop-guide/net/wpf/properties/how-to-override-metadata-for-a-dependency-property.md index 6bbb81dd88..f1bfa43588 100644 --- a/dotnet-desktop-guide/net/wpf/properties/how-to-override-metadata-for-a-dependency-property.md +++ b/dotnet-desktop-guide/net/wpf/properties/how-to-override-metadata-for-a-dependency-property.md @@ -1,7 +1,8 @@ --- title: "How to override metadata for a dependency property" description: "Learn how to override a dependency property in Windows Presentation Foundation (WPF) by calling the OverrideMetadata method." -ms.date: "11/04/2021" +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/properties/how-to-register-an-attached-property.md b/dotnet-desktop-guide/net/wpf/properties/how-to-register-an-attached-property.md index 1f5f485c9d..b9363d3231 100644 --- a/dotnet-desktop-guide/net/wpf/properties/how-to-register-an-attached-property.md +++ b/dotnet-desktop-guide/net/wpf/properties/how-to-register-an-attached-property.md @@ -1,7 +1,8 @@ --- title: "How to register an attached property" description: "Learn about the Windows Presentation Foundation (WPF) property system and how to register an attached property and provide public accessors." -ms.date: "10/15/2021" +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/properties/property-value-inheritance.md b/dotnet-desktop-guide/net/wpf/properties/property-value-inheritance.md index 0921da4c63..7c106b63c9 100644 --- a/dotnet-desktop-guide/net/wpf/properties/property-value-inheritance.md +++ b/dotnet-desktop-guide/net/wpf/properties/property-value-inheritance.md @@ -1,7 +1,8 @@ --- title: "Dependency property value inheritance" description: "Learn how dependency property value inheritance can be used to propagate property values in Windows Presentation Foundation (WPF)." -ms.date: "12/29/2021" +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/properties/read-only-dependency-properties.md b/dotnet-desktop-guide/net/wpf/properties/read-only-dependency-properties.md index f9b005ff6a..816d533c82 100644 --- a/dotnet-desktop-guide/net/wpf/properties/read-only-dependency-properties.md +++ b/dotnet-desktop-guide/net/wpf/properties/read-only-dependency-properties.md @@ -1,7 +1,8 @@ --- title: "Read-only dependency properties" description: Learn about dependency properties in Windows Presentation Foundation (WPF) and how to create a read-only dependency property. -ms.date: "11/29/2021" +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/properties/safe-constructor-patterns-for-dependencyobjects.md b/dotnet-desktop-guide/net/wpf/properties/safe-constructor-patterns-for-dependencyobjects.md index 50135e027a..559ae8feef 100644 --- a/dotnet-desktop-guide/net/wpf/properties/safe-constructor-patterns-for-dependencyobjects.md +++ b/dotnet-desktop-guide/net/wpf/properties/safe-constructor-patterns-for-dependencyobjects.md @@ -1,7 +1,8 @@ --- title: "Safe Constructor Patterns for DependencyObjects" description: "Learn about safe constructor patterns for DependencyObjects in Windows Presentation Foundation (WPF)." -ms.date: "12/15/2021" +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/properties/xaml-loading-and-dependency-properties.md b/dotnet-desktop-guide/net/wpf/properties/xaml-loading-and-dependency-properties.md index 29ec32975e..3e13f8ff8a 100644 --- a/dotnet-desktop-guide/net/wpf/properties/xaml-loading-and-dependency-properties.md +++ b/dotnet-desktop-guide/net/wpf/properties/xaml-loading-and-dependency-properties.md @@ -1,7 +1,8 @@ --- title: "XAML loading and dependency properties" description: "Learn about Extensible Application Markup Language (XAML) loading of dependency property in Windows Presentation Foundation (WPF)." -ms.date: "12/22/2021" +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/systems/xaml-resources-and-code.md b/dotnet-desktop-guide/net/wpf/systems/xaml-resources-and-code.md index a0746a2aed..be3a5e4803 100644 --- a/dotnet-desktop-guide/net/wpf/systems/xaml-resources-and-code.md +++ b/dotnet-desktop-guide/net/wpf/systems/xaml-resources-and-code.md @@ -1,10 +1,11 @@ --- title: WPF resources in code -description: Learn about how Windows Presentation Foundation (WPF) resources, typically defined and used in XAML, can be used in code. Resources can be accessed, created, and managed in code. +description: Learn about how Windows Presentation Foundation (WPF) resources, typically defined and used in XAML, can be used in code. author: adegeo ms.author: adegeo -ms.date: 04/01/2021 +ms.date: 10/24/2024 ms.topic: overview +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/systems/xaml-resources-how-to-define-and-reference.md b/dotnet-desktop-guide/net/wpf/systems/xaml-resources-how-to-define-and-reference.md index c1bba98d62..0102de01c7 100644 --- a/dotnet-desktop-guide/net/wpf/systems/xaml-resources-how-to-define-and-reference.md +++ b/dotnet-desktop-guide/net/wpf/systems/xaml-resources-how-to-define-and-reference.md @@ -3,7 +3,8 @@ title: "How to define and reference a resource" description: Learn how to define and reference Windows Presentation Foundation (WPF) resources through XAML and code. author: adegeo ms.author: adegeo -ms.date: 04/02/2021 +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/systems/xaml-resources-how-to-use-application.md b/dotnet-desktop-guide/net/wpf/systems/xaml-resources-how-to-use-application.md index 92590f389d..e8107746db 100644 --- a/dotnet-desktop-guide/net/wpf/systems/xaml-resources-how-to-use-application.md +++ b/dotnet-desktop-guide/net/wpf/systems/xaml-resources-how-to-use-application.md @@ -3,7 +3,8 @@ title: "How to use application resources" description: Learn how to define and reference Windows Presentation Foundation (WPF) application-scoped resources in XAML. author: adegeo ms.author: adegeo -ms.date: 04/08/2021 +ms.date: 10/24/2024 +ms.custom: update-template helpviewer_keywords: - "application resources [WPF]" - "resources [WPF], application resources" diff --git a/dotnet-desktop-guide/net/wpf/systems/xaml-resources-how-to-use-system.md b/dotnet-desktop-guide/net/wpf/systems/xaml-resources-how-to-use-system.md index 6fde91ce77..f4d739be98 100644 --- a/dotnet-desktop-guide/net/wpf/systems/xaml-resources-how-to-use-system.md +++ b/dotnet-desktop-guide/net/wpf/systems/xaml-resources-how-to-use-system.md @@ -3,7 +3,8 @@ title: "How to use system resources" description: Learn how to define and reference Windows Presentation Foundation (WPF) Windows Operating System resources in XAML. author: adegeo ms.author: adegeo -ms.date: 04/09/2021 +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/systems/xaml-resources-merged-dictionaries.md b/dotnet-desktop-guide/net/wpf/systems/xaml-resources-merged-dictionaries.md index 1bb1beaed8..96bff4594d 100644 --- a/dotnet-desktop-guide/net/wpf/systems/xaml-resources-merged-dictionaries.md +++ b/dotnet-desktop-guide/net/wpf/systems/xaml-resources-merged-dictionaries.md @@ -1,10 +1,11 @@ --- title: Merged resource dictionaries -description: Learn about Windows Presentation Foundation (WPF) for .NET merged resource dictionaries. Define and reference XAML resources outside of a compiled WPF application. +description: Learn about Windows Presentation Foundation (WPF) for .NET merged resource dictionaries. Define and reference XAML resources outside of a WPF application. author: adegeo ms.author: adegeo -ms.date: 03/30/2021 +ms.date: 10/24/2024 ms.topic: conceptual +ms.custom: update-template helpviewer_keywords: - "merged resource dictionaries [WPF]" - "dictionaries [WPF], merged resources" diff --git a/dotnet-desktop-guide/net/wpf/systems/xaml-resources-overview.md b/dotnet-desktop-guide/net/wpf/systems/xaml-resources-overview.md index 860dc94ca0..2de8a31ad7 100644 --- a/dotnet-desktop-guide/net/wpf/systems/xaml-resources-overview.md +++ b/dotnet-desktop-guide/net/wpf/systems/xaml-resources-overview.md @@ -1,10 +1,11 @@ --- title: XAML resources overview -description: Learn what a Windows Presentation Foundation (WPF) resource is. WPF provides a resource system, both in XAML and in code, that allows to you create, reference, and reuse resources. +description: Learn what a Windows Presentation Foundation (WPF) resource is. WPF provides a system that allows to you create, reference, and reuse resources. author: adegeo ms.author: adegeo -ms.date: 03/31/2021 +ms.date: 10/24/2024 ms.topic: overview +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/toc.yml b/dotnet-desktop-guide/net/wpf/toc.yml index 69c2652184..98f774baa9 100644 --- a/dotnet-desktop-guide/net/wpf/toc.yml +++ b/dotnet-desktop-guide/net/wpf/toc.yml @@ -10,6 +10,8 @@ items: href: get-started/create-app-visual-studio.md - name: What's new items: + - name: Overview + href: whats-new/index.md - name: What's new in .NET 8 href: whats-new/net80.md - name: What's new in .NET 7 diff --git a/dotnet-desktop-guide/net/wpf/whats-new/index.md b/dotnet-desktop-guide/net/wpf/whats-new/index.md new file mode 100644 index 0000000000..35335b7ad8 --- /dev/null +++ b/dotnet-desktop-guide/net/wpf/whats-new/index.md @@ -0,0 +1,27 @@ +--- +title: What's new in Windows Presentation Foundation +description: Learn about what's new in Windows Presentation Foundation (WPF). This article covers changes to WPF since .NET 7 was released. +ms.date: 10/24/2024 +ms.topic: conceptual +--- + +# What's new in Windows Presentation Foundation + +Each .NET release introduces a new version of Windows Presentation Foundation (WPF). This article teaches you what's new in each release. + +## .NET 8 + +WPF added hardware acceleration for remote desktop apps, and a new control for browsing and selecting folders in .NET 8. + +- [Overview of WPF on .NET 8](net80.md). +- [Hardware acceleration on RDP applications](net80.md#hardware-acceleration) +- [OpenFolderDialog](net80.md#openfolderdialog) + +## .NET 7 + +WPF added some key performance improvements in .NET 7. + +- [Overview of WPF on .NET 7](net70.md). +- [Performance improvements](net70.md#performance-improvements) +- [Accessibility improvements and fixes](net70.md#accessibility-improvements-and-fixes) +- [Bug fixes](net70.md#bug-fixes) diff --git a/dotnet-desktop-guide/net/wpf/whats-new/net70.md b/dotnet-desktop-guide/net/wpf/whats-new/net70.md index ddf528214b..3be9ff18ac 100644 --- a/dotnet-desktop-guide/net/wpf/whats-new/net70.md +++ b/dotnet-desktop-guide/net/wpf/whats-new/net70.md @@ -1,7 +1,7 @@ --- title: What's new in WPF for .NET 7 -description: Learn about what's new in Windows Presentation Foundation (WPF) for .NET 7. -ms.date: 02/08/2023 +description: Learn about what's new in Windows Presentation Foundation (WPF) for .NET 7. .NET 7 was released November 2022. +ms.date: 10/24/2024 ms.topic: conceptual --- diff --git a/dotnet-desktop-guide/net/wpf/whats-new/net80.md b/dotnet-desktop-guide/net/wpf/whats-new/net80.md index 9d68fa60f1..27bccfe1ad 100644 --- a/dotnet-desktop-guide/net/wpf/whats-new/net80.md +++ b/dotnet-desktop-guide/net/wpf/whats-new/net80.md @@ -1,7 +1,7 @@ --- title: What's new in WPF for .NET 8 -description: Learn about what's new in Windows Presentation Foundation (WPF) for .NET 8. -ms.date: 02/07/2024 +description: Learn about what's new in Windows Presentation Foundation (WPF) for .NET 8. .NET 8 was released November 2023. +ms.date: 10/24/2024 ms.topic: conceptual --- diff --git a/dotnet-desktop-guide/net/wpf/windows/dialog-boxes-overview.md b/dotnet-desktop-guide/net/wpf/windows/dialog-boxes-overview.md index e54f69d6bd..58a70e2431 100644 --- a/dotnet-desktop-guide/net/wpf/windows/dialog-boxes-overview.md +++ b/dotnet-desktop-guide/net/wpf/windows/dialog-boxes-overview.md @@ -1,7 +1,8 @@ --- title: Dialog Boxes Overview description: Learn about the varieties of dialog boxes in Windows Foundation Presentation (WPF). With a dialog box, you gather and display information to a user. -ms.date: "03/12/2021" +ms.date: 10/24/2024 +ms.custom: update-template helpviewer_keywords: - "modeless dialog boxes [WPF]" - "modal dialog boxes [WPF]" @@ -45,7 +46,7 @@ Since these dialog boxes are provided by the operating system, they're shared am WPF encapsulates the open file, save file, open folder, and print common dialog boxes and exposes them as managed classes for you to use. -:::image type="content" source="media/dialog-boxes-overview/open-file-dialog-box.png" alt-text="Open file dialog box called from WPF."::: +:::image type="content" source="media/dialog-boxes-overview/open-file-dialog-box.png" alt-text="A 'Open File' dialog box called from WPF."::: To learn more about common dialog boxes, see the following articles: diff --git a/dotnet-desktop-guide/net/wpf/windows/how-to-close-window-dialog-box.md b/dotnet-desktop-guide/net/wpf/windows/how-to-close-window-dialog-box.md index 52120fcd09..f25b991c1c 100644 --- a/dotnet-desktop-guide/net/wpf/windows/how-to-close-window-dialog-box.md +++ b/dotnet-desktop-guide/net/wpf/windows/how-to-close-window-dialog-box.md @@ -1,7 +1,8 @@ --- title: How to close a window -description: Learn about how to close a window or dialog box in Windows Foundation Presentation (WPF). You'll also learn how to return a result from the window or dialog box. -ms.date: "03/24/2021" +description: Learn about how to close a window or dialog box, and optionally return a value, in Windows Foundation Presentation (WPF). +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/windows/how-to-get-set-main-application-window.md b/dotnet-desktop-guide/net/wpf/windows/how-to-get-set-main-application-window.md index 13e0147adf..8636761572 100644 --- a/dotnet-desktop-guide/net/wpf/windows/how-to-get-set-main-application-window.md +++ b/dotnet-desktop-guide/net/wpf/windows/how-to-get-set-main-application-window.md @@ -1,7 +1,8 @@ --- title: How to get or set main app window -description: Learn about how to get and set the main application window for a Windows Presentation Foundation (WPF) application. The main window of an application is typically the startup window. This is sometimes specified by the StartupUri property. -ms.date: "03/24/2021" +description: Learn about how to get and set the main application window for a Windows Presentation Foundation (WPF) application. +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/windows/how-to-open-common-system-dialog-box.md b/dotnet-desktop-guide/net/wpf/windows/how-to-open-common-system-dialog-box.md index d63331745b..ede07cea89 100644 --- a/dotnet-desktop-guide/net/wpf/windows/how-to-open-common-system-dialog-box.md +++ b/dotnet-desktop-guide/net/wpf/windows/how-to-open-common-system-dialog-box.md @@ -1,7 +1,8 @@ --- title: How to open a common dialog box -description: Learn about how to show a system dialog box in Windows Foundation Presentation (WPF). System dialog boxes prompt users for information, choosing a file to load or save, or displaying the printer window. -ms.date: 03/15/2021 +description: Learn about how to show a system dialog box in Windows Foundation Presentation (WPF). System dialog boxes prompt users for information. +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/windows/how-to-open-message-box.md b/dotnet-desktop-guide/net/wpf/windows/how-to-open-message-box.md index 6d1492a504..d8e109c8a3 100644 --- a/dotnet-desktop-guide/net/wpf/windows/how-to-open-message-box.md +++ b/dotnet-desktop-guide/net/wpf/windows/how-to-open-message-box.md @@ -1,7 +1,8 @@ --- title: How to display a message box -description: Learn about how to show a message box in Windows Foundation Presentation (WPF). Message boxes prompt users for a response, allowing the calling window to process that response. -ms.date: 03/15/2021 +description: Learn about how to show a message box in Windows Foundation Presentation (WPF). Message boxes prompt users for a response. +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/windows/how-to-open-window-dialog-box.md b/dotnet-desktop-guide/net/wpf/windows/how-to-open-window-dialog-box.md index bbd9c7cda9..6e95b98b3f 100644 --- a/dotnet-desktop-guide/net/wpf/windows/how-to-open-window-dialog-box.md +++ b/dotnet-desktop-guide/net/wpf/windows/how-to-open-window-dialog-box.md @@ -1,7 +1,8 @@ --- title: How to open a window -description: Learn about how to show a window or dialog box in Windows Foundation Presentation (WPF). You'll also learn how to handle common scenarios around managing a window or dialog box. -ms.date: "03/12/2021" +description: Learn about how to show a window or dialog box in Windows Foundation Presentation (WPF). Windows can be shown as dialog boxes. +ms.date: 10/24/2024 +ms.custom: update-template dev_langs: - "csharp" - "vb" diff --git a/dotnet-desktop-guide/net/wpf/windows/index.md b/dotnet-desktop-guide/net/wpf/windows/index.md index b7d99a4db9..d9a4cf07d5 100644 --- a/dotnet-desktop-guide/net/wpf/windows/index.md +++ b/dotnet-desktop-guide/net/wpf/windows/index.md @@ -1,8 +1,9 @@ --- title: Windows in WPF overview description: Learn about the basics of how Window objects work in WPF. Learn how to create and manage a window for a Windows Presentation Foundation (WPF) app. -ms.date: "03/11/2021" +ms.date: 10/24/2024 ms.topic: overview +ms.custom: update-template dev_langs: - "csharp" - "vb" @@ -212,7 +213,7 @@ When a window is instantiated, a reference to it's automatically added to a [lis The window is finally opened by calling the method as shown in the following image: -:::image type="content" source="./media/index/window-with-button.png" alt-text="WPF Window with a single button inside."::: +:::image type="content" source="./media/index/window-with-button.png" alt-text="WPF Window with a single button inside with the text 'Click me'."::: A window that is opened by calling is a _modeless_ window, and the application doesn't prevent users from interacting with other windows in the application. Opening a window with opens a window as _modal_ and restricts user interaction to the specific window. For more information, see [Dialog Boxes Overview](dialog-boxes-overview.md). diff --git a/dotnet-desktop-guide/net/wpf/xaml/index.md b/dotnet-desktop-guide/net/wpf/xaml/index.md index ae17b8afee..1ee81b81a4 100644 --- a/dotnet-desktop-guide/net/wpf/xaml/index.md +++ b/dotnet-desktop-guide/net/wpf/xaml/index.md @@ -1,10 +1,11 @@ --- -title: XAML overview +title: XAML language overview description: Learn how the XAML language is structured and implemented by Windows Presentation Foundation (WPF) for .NET. author: adegeo -ms.date: 02/15/2023 +ms.date: 10/24/2024 ms.author: adegeo ms.topic: overview +ms.custom: update-template dev_langs: - "csharp" - "vb"