Commit Graph
1201 Commits
Author SHA1 Message Date
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
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
Pedro Lamas 818633db90 Adds Unit Tests and reverts IDisposable pattern 2021-02-19 15:35:34 +00:00
Michael Hawker MSFT (XAML Llama) 49142bead4 Merge pull request #3723 from Kyaa-dost/Kyaa-UpdateIssueTemplate
Update issue template
2021-02-18 13:37:16 -08:00
Michael Hawker MSFT (XAML Llama) ff13de61db Merge branch 'master' into Kyaa-UpdateIssueTemplate 2021-02-18 13:37:09 -08:00
msftbot[bot] e184ee92c0 Upgrade to WinUI 2.5 and other Dependencies - Deprecate RadialProgressBar (#3758)
## Contributes to #3062 
Adds deprecation message to the RadialProgressBar. Updates some of our dependencies. Few more to do, but will wait until we remove parsers and services packages.
2021-02-18 01:05:49 +00:00
michael-hawker 639d411272 Clean-up warnings around IDisposable pattern and null usages 2021-02-17 14:41:29 -08:00
michael-hawker edc387a097 Move Deferred Files to Microsoft.Toolkit 2021-02-17 14:36:24 -08:00
Nikola Metulev 78b89b91cc Merge branch 'master' into deprecate-radial 2021-02-17 12:38:56 -08:00
Sergio Pedri eb0c485af9 Merge pull request #3760 from Sergio0694/refactoring/object-marshal
Refactor ObjectExtensions -> ObjectMarshal
2021-02-17 20:00:17 +01:00
Sergio Pedri 41d4f0536e Removed leftover deprecated extensions 2021-02-17 13:03:47 +01:00
Sergio Pedri a03405fd03 Moved ObjectExtensions -> ObjectMarshal 2021-02-17 13:02:03 +01:00
michael-hawker 4f6c3ac1c0 Upgrade to WinUI 2.5 and other Dependencies - Deprecate RadialProgressBar 2021-02-16 11:43:00 -08:00
msftbot[bot] a8a3324955 [Feature] Microsoft.Toolkit.Mvvm package (Preview 5) (#3562)
## Follow up to #3428 
<!-- Add the relevant issue number after the "#" mentioned above (for ex: Fixes #1234) which will automatically close the issue once the PR is merged. -->
This PR is for tracking all changes/fixes/improvements to the `Microsoft.Toolkit.Mvvm` package following the Preview 4.

<!-- 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. -->

- Feature
- Improvements
<!-- - 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

This PR is used to track and implement new features and tweaks for the `Microsoft.Toolkit.Mvvm` package.
See the linked issue for more info, and for a full list of changes included in this PR.


## 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] 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-13 00:44:06 +00:00
Sergio Pedri 604b98be0e Added unit test for validation with an injected service 2021-02-13 00:16:32 +01:00
Sergio Pedri 2e1312b6ef Switched to LINQ expressions for ValidateAllProperties 2021-02-13 00:16:32 +01:00
Sergio Pedri d32592c69c Added missing nullability annotations 2021-02-13 00:16:31 +01:00
Sergio Pedri f1da0ed9ad Tweaked ObservableValidator constructors, added tests 2021-02-13 00:16:31 +01:00
Sergio Pedri 1834f9581c Added custom ValidationContext to ObservableValidator 2021-02-13 00:16:31 +01:00
Sergio Pedri fca033b27a Added missing types to NuGet description 2021-02-13 00:16:30 +01:00
Sergio Pedri e61ef82070 Added .NET 5 target (and removed built-in package) 2021-02-13 00:16:30 +01:00
Sergio Pedri c5800998ae Added missing nullability annotations 2021-02-13 00:16:30 +01:00
Sergio Pedri 7bdcd48b4f Added caching for reflection setup in ValidateAllProperties 2021-02-13 00:16:30 +01:00
Sergio Pedri a5e5c1115d Added ObservableValidator.ValidateAllProperties() API 2021-02-13 00:16:29 +01:00
Sergio Pedri 12e7c96c50 Added unit tests for ClearErrors 2021-02-13 00:16:29 +01:00
Sergio Pedri b16656a845 Added ObservableValidator.ClearErrors(string) API 2021-02-13 00:16:29 +01:00
Sergio Pedri 70821903f2 Fixed unit tests with RelayCommand and value types 2021-02-13 00:16:29 +01:00
Sergio Pedri c1778f1eae Switched ObservableValidator.ValidateProperty to protected 2021-02-13 00:16:28 +01:00
Sergio Pedri 657eaac84a Fixed NRE when calling CanExecute(null) over value types 2021-02-13 00:16:28 +01:00
Sergio Pedri 0b92c97764 Minor code style tweaks 2021-02-13 00:16:28 +01:00
Sergio Pedri 752c15196c Updated NuGet packages 2021-02-13 00:16:27 +01:00
Sergio Pedri 562c505a82 Minor code tweaks 2021-02-13 00:16:27 +01:00
Sergio Pedri 451111ff82 Minor codegen improvements 2021-02-13 00:16:27 +01:00
Sergio Pedri 262eadd387 Improved nullability annotations in commands 2021-02-13 00:16:27 +01:00
Sergio Pedri c7fa6c54dd Changed command CanExecute args to Predicate<T> 2021-02-13 00:16:26 +01:00