Commit Graph
2284 Commits
Author SHA1 Message Date
Sergio Pedri e9bb11841d Improved Messenger tests, fixed early GC collections
Should prevent #4017 from happening again
2021-05-10 22:49:28 +02:00
Sergio Pedri 203bd00bf7 Added missing ConfigureAwait(false) in AsyncCollectionRequestMessage<T> 2021-05-10 22:49:00 +02:00
msftbot[bot] ab4ba75f1d Fix [ReadOnly]Span2D<T>.TryGetSpan on legacy frameworks (#3948)
## Fixes #3947
<!-- Add the relevant issue number after the "#" mentioned above (for ex: Fixes #1234) which will automatically close the issue once the PR is merged. -->

<!-- Add a brief overview here of the feature/bug & fix. -->

## PR Type
What kind of change does this PR introduce?
<!-- Please uncomment one or more that apply to this PR. -->

- Bugfix
<!-- - Feature -->
<!-- - Code style update (formatting) -->
<!-- - Refactoring (no functional changes, no api changes) -->
<!-- - Build or CI related changes -->
<!-- - Documentation content changes -->
<!-- - Sample app changes -->
<!-- - Other... Please describe: -->


## What is the current behavior?
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
`[ReadOnly]Span2D<T>.TryGetSpan` throws an exception when wrapping a `T[]` instance on legacy frameworks.

## What is the new behavior?
<!-- Describe how was this issue resolved or changed? -->
`[ReadOnly]Span2D<T>.TryGetSpan` works correctly on legacy frameworks.

## PR Checklist

Please check if your PR fulfills the following requirements:

- [X] Tested code with current [supported SDKs](../readme.md#supported)
- [ ] ~~Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link -->~~
- [ ] ~~Sample in sample app has been added / updated (for bug fixes / features)~~
    - [ ] ~~Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/windows-toolkit/WindowsCommunityToolkit-design-assets)~~
- [X] New major technical changes in the toolkit have or will be added to the [Wiki](https://github.com/windows-toolkit/WindowsCommunityToolkit/wiki) e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
- [X] Tests for the changes have been added (for bug fixes / features) (if applicable)
- [X] Header has been added to all new source files (run *build/UpdateHeaders.bat*)
- [X] Contains **NO** breaking changes
2021-04-24 12:45:57 +00:00
Sergio Pedri c239aa9a35 Fixed unit tests to account for merged bugfix
This adjusts the tests following https://github.com/windows-toolkit/WindowsCommunityToolkit/pull/3951
2021-04-24 13:45:48 +02:00
Sergio Pedri 0d2a25f95b Fixed [ReadOnly]Span2D<T>.TryGetSpan when no runtime support
Closes https://github.com/windows-toolkit/WindowsCommunityToolkit/issues/3947
2021-04-24 13:40:22 +02:00
Sergio Pedri 29110ac6fb Added missing tests for Span2D<T>.TryGetSpan 2021-04-24 13:40:22 +02:00
msftbot[bot] 13ef1d7ec8 Fixed ReadOnlySpan2D<T>.Slice parameters order (#3951)
## Fixup for #3353 
<!-- Add the relevant issue number after the "#" mentioned above (for ex: Fixes #1234) which will automatically close the issue once the PR is merged. -->

<!-- Add a brief overview here of the feature/bug & fix. -->

## PR Type
What kind of change does this PR introduce?
<!-- Please uncomment one or more that apply to this PR. -->

- Bugfix
<!-- - Feature -->
<!-- - Code style update (formatting) -->
<!-- - Refactoring (no functional changes, no api changes) -->
<!-- - Build or CI related changes -->
<!-- - Documentation content changes -->
<!-- - Sample app changes -->
<!-- - Other... Please describe: -->


## Overview
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
`ReadOnlySpan2D<T>.Slice` has the incorrect ordering for the `height` and `width` parameters, which is inverted with respect to those in `Span2D<T>.Slice`. This is an oversight from a refactor in the original PR, and as a result it also causes the `ReadOnlySpan2D<T>.this[Range, Range]` indexer to fail for `ReadOnlySpan2D<T>`. This PR fixes both issues and adds a new series of tests for the two indexers as well. We probably didn't notice this before since those indexers are not available on UWP 🤔

> **NOTE:** this PR technically introduces a breaking change (swapped parameters in the `.Slice` method, but as that's an issue and not intended, and also because they're in the right order in `Span2D<T>`, it's more of a fix than an actual breaking change.

## PR Checklist

Please check if your PR fulfills the following requirements:

- [X] Tested code with current [supported SDKs](../readme.md#supported)
- [ ] ~~Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link -->~~
- [ ] ~~Sample in sample app has been added / updated (for bug fixes / features)~~
    - [ ] ~~Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/windows-toolkit/WindowsCommunityToolkit-design-assets)~~
- [X] New major technical changes in the toolkit have or will be added to the [Wiki](https://github.com/windows-toolkit/WindowsCommunityToolkit/wiki) e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
- [X] Tests for the changes have been added (for bug fixes / features) (if applicable)
- [X] Header has been added to all new source files (run *build/UpdateHeaders.bat*)
- [ ] Contains **NO** breaking changes
2021-04-22 22:34:32 +00:00
Sergio Pedri f0a3d1a8d3 Added new unit tests for [ReadOnly]Span2D<T> indexers 2021-04-22 23:22:06 +02:00
Sergio Pedri 371b74b1bc Fixed inconsistency with ReadOnlySpan2D<T>.Slice parameters 2021-04-22 23:22:06 +02:00
msftbot[bot] 3b6b3de3b9 Enabled correct WeakReferenceMessenger path on .NET 5 (#3932)
## Follow up for #3424 
<!-- Add the relevant issue number after the "#" mentioned above (for ex: Fixes #1234) which will automatically close the issue once the PR is merged. -->

<!-- Add a brief overview here of the feature/bug & fix. -->

## PR Type
What kind of change does this PR introduce?
<!-- Please uncomment one or more that apply to this PR. -->

- Bugfix-ish
<!-- - Feature -->
<!-- - Code style update (formatting) -->
<!-- - Refactoring (no functional changes, no api changes) -->
<!-- - Build or CI related changes -->
<!-- - Documentation content changes -->
<!-- - Sample app changes -->
<!-- - Other... Please describe: -->


## Overview
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
The .NET 5 target currently uses the .NET Standard 2.0 code path within `WeakReferenceMessenger`.
Not technically a bug since the implementation does work, but it can be greatly simplified like on .NET Standard 2.1.
This should also make the code add slightly less GC pressure over time due to less additional data structures in use.

## PR Checklist

Please check if your PR fulfills the following requirements:

- [X] Tested code with current [supported SDKs](../readme.md#supported)
- [ ] ~~Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link -->~~
- [ ] ~~Sample in sample app has been added / updated (for bug fixes / features)~~
    - [ ] ~~Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/windows-toolkit/WindowsCommunityToolkit-design-assets)~~
- [X] New major technical changes in the toolkit have or will be added to the [Wiki](https://github.com/windows-toolkit/WindowsCommunityToolkit/wiki) e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
- [X] Tests for the changes have been added (for bug fixes / features) (if applicable)
- [X] Header has been added to all new source files (run *build/UpdateHeaders.bat*)
- [X] Contains **NO** breaking changes
2021-04-16 12:50:42 +00:00
Sergio Pedri e50b6e407b Enabled correct WeakReferenceMessenger path on .NET 5 2021-04-16 13:49:57 +02:00
Sergio Pedri 58465216a5 Merge pull request #3939 from Sergio0694/bugfix/task-completed-result
Fixed TaskExtensions.GetResultOrDefault() for Task.CompletedTask
2021-04-15 19:13:29 +02:00
Sergio Pedri c7b84aee44 Fixed TaskExtensions.GetResultOrDefault() for Task.CompletedTask 2021-04-15 12:23:04 +02:00
msftbot[bot] e99e7cfd89 Fix few typos in comments (#3923)
## Fixes
Fix few typos in the code base. Note that only comments are impacted by this change.

## PR Type
What kind of change does this PR introduce?
- Documentation content changes

## What is the current behavior?
N/A

## What is the new behavior?
N/A

## PR Checklist

Please check if your PR fulfills the following requirements:

- [x] Tested code with current [supported SDKs](../readme.md#supported)
- [ ] Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link -->
- [ ] Sample in sample app has been added / updated (for bug fixes / features)
    - [ ] Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/windows-toolkit/WindowsCommunityToolkit-design-assets)
- [ ] New major technical changes in the toolkit have or will be added to the [Wiki](https://github.com/windows-toolkit/WindowsCommunityToolkit/wiki) e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
- [ ] Tests for the changes have been added (for bug fixes / features) (if applicable)
- [ ] Header has been added to all new source files (run *build/UpdateHeaders.bat*)
- [x] Contains **NO** breaking changes

## Other information
2021-04-05 14:20:49 +00:00
Julien Brianceau 8cd0b847f4 Fix typos in the code base
Note that only comments are impacted by this change.
2021-04-04 15:24:40 +02:00
Michael Hawker MSFT (XAML Llama) 75787186e7 Merge pull request #3901 from Sergio0694/bugfix/span2d-copyto-exception-info
Fixed exception message and docs for Span2D<T>.CopyTo(Span2D<T>)
2021-03-29 14:00:23 -07:00
Sergio Pedri 6b51a41b52 Fixed exception message and docs for Span2D<T>.CopyTo(Span2D<T>)
Reported in https://github.com/MicrosoftDocs/WindowsCommunityToolkitDocs/issues/491
2021-03-29 19:22:05 +02:00
Michael Hawker MSFT (XAML Llama) 6fa2a1f7ea Merge pull request #3880 from windows-toolkit/dev/7.0.1
Merge Dev/7.0.1 into main
2021-03-23 11:02:42 -07:00
Michael Hawker MSFT (XAML Llama) 02353416ac Merge pull request #3863 from RosarioPulella/fix/package-tags
Fix Package tags to better SEO on Nuget
2021-03-23 09:32:31 -07:00
Rosario Pulella 9f73c60db4 Given that spaces seperate tags, remove duplicate tags 2021-03-22 17:39:23 -04:00
Rosario PulellaandMichael Hawker MSFT 1a9bb5b4d0 Update Microsoft.Toolkit.Mvvm/Microsoft.Toolkit.Mvvm.csproj
Co-authored-by: Michael Hawker MSFT (XAML Llama) <24302614+michael-hawker@users.noreply.github.com>
2021-03-19 14:33:29 -04:00
Rosario Pulella b9a166a721 Remove repated Toolkit and Windows tags 2021-03-19 14:33:28 -04:00
Rosario Pulella d505f7c150 Add WCT tags to packages. 2021-03-19 14:33:28 -04:00
Rosario Pulella 0d54949481 Sperate Tags by semicolons 2021-03-19 14:33:17 -04:00
Michael Hawker MSFT (XAML Llama) ac84071a4c Merge pull request #3813 from yoshiask/fix/tabbedcommandbar_SCTRB
#3779 Fix TabbedCommandBar MinVersion
2021-03-08 09:22:44 -08:00
Yoshi Askharoun 725d991b05 Update master (7.0 Preview 5)
Update master
2021-03-05 18:09:03 -06:00
msftbot[bot] 94b6098b1a Add NullableHelper (#3389)
cc @Sergio0694 

Introduce a `NullableHelper` type with `GetValueOrDefaultRef` which returns a `ref T` which points to a value that is equivalent to `GetValueOrDefault`

TODO add tests
2021-03-04 09:57:21 +00:00
Michael Hawker MSFT (XAML Llama) 7360c533da Merge branch 'master' into master 2021-03-04 00:47:19 -08:00
Michael Hawker MSFT (XAML Llama) 6b82a287dc Merge pull request #3798 from Sergio0694/deprecate/string-format
Deprecated StringExtensions.AsFormat extension
2021-03-03 14:25:47 -08:00
Sergio Pedri 0a0249a331 Added internal notes with link to the WinUI issue 2021-03-03 19:51:08 +01:00
Sergio Pedri e3d9540503 Added NullableExtensions tests 2021-03-03 19:34:02 +01:00
Sergio Pedri bf12e68c0a Refactored the nullable extension 2021-03-03 19:34:02 +01:00
John e1dc77a324 Use more appropriate type in remap type 2021-03-03 19:34:02 +01:00
John 1d3acd183e Add NullableHelper 2021-03-03 19:34:02 +01:00
Sergio Pedri 57e6072e3a Deprecated StringExtensions.AsFormat extension 2021-03-03 16:54:49 +01:00
msftbot[bot] 2e99c2b445 Refactor namespaces for extension types (#3743)
## Related to #3422 
<!-- Add the relevant issue number after the "#" mentioned above (for ex: Fixes #1234) which will automatically close the issue once the PR is merged. -->

<!-- Add a brief overview here of the feature/bug & fix. -->

## PR Type
What kind of change does this PR introduce?
<!-- Please uncomment one or more that apply to this PR. -->

<!-- - Bugfix -->
<!-- - Feature -->
<!-- - Code style update (formatting) -->
- Refactoring
<!-- - Build or CI related changes -->
<!-- - Documentation content changes -->
<!-- - Sample app changes -->
<!-- - Other... Please describe: -->


## What is the current behavior?
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
Quoting from https://github.com/windows-toolkit/WindowsCommunityToolkit/issues/3422#issuecomment-774484219, we have the current situation with respect to extension methods in the Toolkit:

> On a related note - lately I've been thinking a bit about the various extensions in the toolkit in particular.
@mrlacey already pointed this out in the first post in this issue, and I agree that that inconsistency is a bit weird, especially now that newer packages have started to just place them in their respective root namespaces. Basically we have the following situation:
>
> - `Microsoft.Toolkit.Extensions` (from `Microsoft.Toolkit`)❌
> - `Microsoft.Toolkit.Extensions` (from `Microsoft.Toolkit.Diagnostics`*) ❌
> - `Microsoft.Toolkit.HighPerformance.Extensions` ❌
> - `Microsoft.Toolkit.Mvvm.Messaging` ✅
> - `Microsoft.Toolkit.Uwp.Extensions` ❌
> - `Microsoft.Toolkit.Uwp.UI.Extensions` ❌
> - `Microsoft.Toolkit.Uwp.UI.Animations` ✅
> - `Microsoft.Toolkit.Uwp.UI.Media`** ✅

## What is the new behavior?
<!-- Describe how was this issue resolved or changed? -->
This PR moves all the extensions (including XAML markup extensions) to the root namespace of each package.
It also fixes some related issues like inconsistent naming, incorrect method locations, etc.

## Open questions
Some extension types now have a number of properties that are only relevant when grouped together, as they refer a specific feature. For instance, all the SurfaceDial properties in `TextBoxExtensions`, or the ones related to Regex. @michael-hawker mentioned the "option" pattern that the Graph Controls have been using, which would look something like this:

```xml
<TextBox>
  <ui:TextBoxExtentions.SurfaceDial>
    <ui:SurfaceDialOptions MinValue="0" MaxValue="10" EnableHapticFeedback="True" ... />
  </ui:TextBoxExtensions.SurfaceDial>
</TextBox>
```

Do we want to make this change as well while we're at it? Thoughts? 🙂

## Additional details

Haven't fully tested all the samples in the sample app just yet, have just focused on ensuring everything built fine for now.
Also, this PR is based on top of #3685, which needs to be merged before this one.

## PR Checklist

Please check if your PR fulfills the following requirements:

- [X] Tested code with current [supported SDKs](../readme.md#supported)
- [ ] ~~Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link -->~~
- [ ] ~~Sample in sample app has been added / updated (for bug fixes / features)~~
    - [ ] ~~Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/windows-toolkit/WindowsCommunityToolkit-design-assets)~~
- [X] New major technical changes in the toolkit have or will be added to the [Wiki](https://github.com/windows-toolkit/WindowsCommunityToolkit/wiki) e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
- [X] Tests for the changes have been added (for bug fixes / features) (if applicable)
- [X] Header has been added to all new source files (run *build/UpdateHeaders.bat*)
- [ ] Contains **NO** breaking changes
2021-02-24 09:55:37 +00:00
Sergio Pedri f0f17ecae0 Fixed some build errors in the smoke tests 2021-02-24 01:37:09 +01:00
Sergio Pedri c8f845fd42 Fixed some inconsistent internal namespaces 2021-02-24 01:37:09 +01:00
Sergio Pedri 157199f19a Fixed a unit test failure due to incorrect extension matching 2021-02-24 01:37:09 +01:00
Sergio Pedri c62679079c Fixed some build errors in the HighPerformance tests 2021-02-24 01:37:09 +01:00
Sergio Pedri 362de51de3 Fixed more leftover .Extensions references 2021-02-24 01:37:09 +01:00
Sergio Pedri 328d254eaa Changed extensions namespaces in .NET packages 2021-02-24 01:37:07 +01:00
msftbot[bot] df6dba5da0 Bug fixes to ObservableValidator (#3764)
## Fixes #3763
<!-- Add the relevant issue number after the "#" mentioned above (for ex: Fixes #1234) which will automatically close the issue once the PR is merged. -->

<!-- Add a brief overview here of the feature/bug & fix. -->

## PR Type
What kind of change does this PR introduce?
<!-- Please uncomment one or more that apply to this PR. -->

- Bugfix
<!-- - Feature -->
<!-- - Code style update (formatting) -->
<!-- - Refactoring (no functional changes, no api changes) -->
<!-- - Build or CI related changes -->
<!-- - Documentation content changes -->
<!-- - Sample app changes -->
<!-- - Other... Please describe: -->


## What is the current behavior?
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
- Incorrect loading of display names for validated properties
- Repeated error messages after validation

## What is the new behavior?
<!-- Describe how was this issue resolved or changed? -->
Fixed the errors above.

Opening as a draft to have the CI run, but I'm still investigating the second issue from the list above.

## PR Checklist

Please check if your PR fulfills the following requirements:

- [X] Tested code with current [supported SDKs](../readme.md#supported)
- [ ] ~~Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link -->~~
- [ ] ~~Sample in sample app has been added / updated (for bug fixes / features)~~
    - [ ] ~~Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/windows-toolkit/WindowsCommunityToolkit-design-assets)~~
- [X] New major technical changes in the toolkit have or will be added to the [Wiki](https://github.com/windows-toolkit/WindowsCommunityToolkit/wiki) e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
- [X] Tests for the changes have been added (for bug fixes / features) (if applicable)
- [X] Header has been added to all new source files (run *build/UpdateHeaders.bat*)
- [X] Contains **NO** breaking changes
2021-02-22 22:12:17 +00:00
Michael Hawker MSFT (XAML Llama) 94c163c623 Merge branch 'master' into bugfix/observablevalidator-errors 2021-02-22 13:05:38 -08:00
msftbot[bot] 0198299b4f Move Deferred helpers to Microsoft.Toolkit (#3762)
## Fixes #3707
Moves the Deferred Event Helpers to the main .NET package and leaves the Uwp specific extensions in the Microsoft.Toolkit.Uwp package.

## PR Type
What kind of change does this PR introduce?
<!-- Please uncomment one or more that apply to this PR. -->

<!-- - Bugfix -->
<!-- - Feature -->
<!-- - Code style update (formatting) -->
- Refactoring (no functional changes, no api changes)
<!-- - Build or CI related changes -->
<!-- - Documentation content changes -->
<!-- - Sample app changes -->
<!-- - Other... Please describe: -->


## What is the current behavior?
Deferred events pattern only available in UWP.

## What is the new behavior?
Deferred events pattern can be used in .NET

## PR Checklist

Please check if your PR fulfills the following requirements:

- [ ] Tested code with current [supported SDKs](../readme.md#supported)
- [ ] Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link -->
- [ ] Sample in sample app has been added / updated (for bug fixes / features)
    - [ ] Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/windows-toolkit/WindowsCommunityToolkit-design-assets)
- [ ] New major technical changes in the toolkit have or will be added to the [Wiki](https://github.com/windows-toolkit/WindowsCommunityToolkit/wiki) e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
- [ ] Tests for the changes have been added (for bug fixes / features) (if applicable)
- [ ] Header has been added to all new source files (run *build/UpdateHeaders.bat*)
- [ ] Contains **NO** breaking changes

<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. 
     Please note that breaking changes are likely to be rejected within minor release cycles or held until major versions. -->


## Other information
2021-02-22 19:29:32 +00:00
Sergio Pedri 37143b1c10 Fixed nullability annotations in ObservableValidator 2021-02-19 21:34:56 +01:00
Sergio Pedri 0b3f3d5119 Fixed display names loading for validated properties 2021-02-19 21:34:56 +01:00
Sergio Pedri bff688b8d8 Added unit test to validate display names
Issue 1 from https://github.com/windows-toolkit/WindowsCommunityToolkit/issues/3763
2021-02-19 21:34:56 +01:00
Michael Hawker MSFT (XAML Llama) 2c47afe9e3 Merge branch 'master' into deferred-move 2021-02-19 10:26:49 -08:00
Michael Hawker MSFT (XAML Llama) 8194934a3c Merge pull request #1 from pedrolamas/deferred-move
Adds Unit Tests and reverts IDisposable pattern
2021-02-19 10:24:19 -08:00