This repository was archived by the owner on Feb 25, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Added support for limiting max tokens in TokenizingTextBox #4163
Merged
Merged
Changes from 3 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
fafbf5b
Added support for TokenSelectionMode in TokenizingTextBox
shweaver-MSFT fbeb2c4
Added TokenItemRemoved events
shweaver-MSFT 93ca18a
Replaced TokenSelectionMode with MaxTokens property on TokenizingTextBox
shweaver-MSFT 9ee8b96
Removed TokenSelectionMode enum
shweaver-MSFT b4fecf3
Accounting for negative MaxToken value
shweaver-MSFT 358ada4
Added MaxTokens test
shweaver-MSFT f0d8b2a
Made MaxTokens non-nullable and added checks for DP.UnsetValue
shweaver-MSFT 1309ca1
Update Microsoft.Toolkit.Uwp.UI.Controls.Input/TokenizingTextBox/Toke…
shweaver-MSFT c7b55c6
Updated OnMaxTokensChanged method and improved MaxTokens test
shweaver-MSFT 07f19d5
Bug fixes
shweaver-MSFT 01c413b
bugfix bug fixes
shweaver-MSFT a7bb51b
Added binding to MaxTokens value in sample
shweaver-MSFT c3903ab
Updated TokenizingTextBox.MaxTokens test
shweaver-MSFT 86cd4d6
Updated Max to Maximum and added token counter
shweaver-MSFT 2d118e8
Updated GetValue to ReadLocalValue
shweaver-MSFT ccefe38
Removing Math reference
shweaver-MSFT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
Microsoft.Toolkit.Uwp.UI.Controls.Input/TokenizingTextBox/TokenSelectionMode.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
| // See the LICENSE file in the project root for more information. | ||
|
|
||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace Microsoft.Toolkit.Uwp.UI.Controls | ||
| { | ||
| /// <summary> | ||
| /// Indicates how tokens are selected in the <see cref="TokenizingTextBox"/>. | ||
| /// </summary> | ||
| public enum TokenSelectionMode | ||
| { | ||
| /// <summary> | ||
| /// Only one token can be selected at a time. A new token should replace the active selection. | ||
| /// </summary> | ||
| Single, | ||
|
|
||
| /// <summary> | ||
| /// Multiple tokens can be selected at a time. | ||
| /// </summary> | ||
| Multiple, | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.