Commit Graph

56 Commits

Author SHA1 Message Date
Sergio Pedri 755eb70bdc Fixed nullability warning in ObservableValidator
Also fixed some build warnings in the unit test project
2021-09-28 14:39:46 +02:00
Michael Hawker MSFT (XAML Llama) b29ec83d2a Merge pull request #4125 from Nirmal4G/hotfix/warnings
Fix most build warnings from the projects
2021-09-16 12:57:46 -07:00
Rosario Pulella b833a1300a Merge pull request #4221 from Sergio0694/bugfix/validate-all-generated-props
Fixed ValidateAllProperties generation for generated properties
2021-09-16 14:34:38 -04:00
msftbot[bot] e3a9464c4b Fixed generated properties within regions (#4227)
<!-- 🚨 Please Do Not skip any instructions and information mentioned below as they are all required and essential to evaluate and test the PR. By fulfilling all the required information you will be able to reduce the volume of questions and most likely help merge the PR faster 🚨 -->

<!-- 👉 It is imperative to resolve ONE ISSUE PER PR and avoid making multiple changes unless the changes interrelate with each other -->

<!-- 📝 Please always keep the "☑️ Allow edits by maintainers" button checked in the Pull Request Template as it increases collaboration with the Toolkit maintainers by permitting commits to your PR branch (only) created from your fork. This can let us quickly make fixes for minor typos or forgotten StyleCop issues during review without needing to wait on you doing extra work. Let us help you help us! 🎉 -->

## Fixes #4225

<!-- Add the relevant issue number after the word "Fixes" 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 options below 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?
Compilation fails If the Microsoft MVVM Toolkit source generator attribute `[ObservableProperty]` is in a `#region` block.
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->

## What is the new behavior?
The generated code is now correct when regions are used.
<!-- Describe how was this issue resolved or changed? -->

## PR Checklist

Please check if your PR fulfills the following requirements: <!-- and remove the ones that are not applicable to the current PR -->

- [X] Tested code with current [supported SDKs](../#supported)
- [X] New component
  - [X] Pull Request has been submitted to the documentation repository [instructions](../blob/main/Contributing.md#docs). Link: <!-- docs PR link -->
  - [X] Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
  - [X] If control, added to Visual Studio Design project
- [X] Sample in sample app has been added / updated (for bug fixes / features)
  - [X] Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/CommunityToolkit/WindowsCommunityToolkit-design-assets)
- [X] New major technical changes in the toolkit have or will be added to the [Wiki](https://github.com/CommunityToolkit/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-09-16 18:17:45 +00:00
Sergio Pedri f4fdaf3879 Fixed [AlsoNotifyChangeFor] attribute definition 2021-09-12 20:26:40 +02:00
Nirmal Guru 62134065cd Fix CS8618 warnings
Code CS1591: Non-nullable field must contain a non-null value when exiting constructor.
2021-09-10 07:10:04 +05:30
Sergio Pedri f6d63a7440 Improved unit tests for generated validation methods 2021-09-09 20:12:04 +02:00
Sergio Pedri 56dd350420 Fixed ValidateAllProperties generation for generated properties 2021-09-09 20:12:04 +02:00
Sergio Pedri 8a2cd16f42 Added test region in [ICommand] tests 2021-09-04 16:53:17 +02:00
Sergio Pedri cb672c9bca Fixed [ObservableProperty] within regions 2021-09-04 16:49:34 +02:00
Sergio Pedri 3b368785d7 Fixed [ObservableProperty] for fields named "value" 2021-09-02 12:30:39 +02:00
Sergio Pedri bb741ac877 Fixed links to related issue 2021-08-12 12:57:08 +02:00
Sergio Pedri 082be3f371 Fixed nullability attributes generation on .NET Standard 2.0 2021-08-09 20:15:22 +02:00
Sergio Pedri 4849a31e5d Added test for generate properties for [INPC] 2021-08-09 13:53:16 +02:00
msftbot[bot] f24528f894 Add WinUI 2.6 Dependency to UnitTests.UWP App (#4156)
## Related to #3650
Splitting out the upgrade to WinUI 2.6 in the Unit Tests project to help try and isolate what might be going on.

Noticed some our other NuGet dependencies have updates as well, so if this works as-is, will try and update those as well.

Then we can check this in, and rebase #3650 to try and determine what else might be going on or pull in others to help investigate.

FYI @huynhsontung @azchohfi 

## PR Type
What kind of change does this PR introduce?
<!-- Please uncomment one or more options below 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?
WinUI 2.6 not included when we run unit tests

## What is the new behavior?
WinUI 2.6 is now included when we run unit tests.

## 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/CommunityToolkit/WindowsCommunityToolkit-design-assets)
- [ ] New major technical changes in the toolkit have or will be added to the [Wiki](https://github.com/CommunityToolkit/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-08-04 18:27:57 +00:00
michael-hawker 397a92b28c Update Unit Test SDK packages 2021-08-03 17:57:07 -07:00
Sergio Pedri 7fd3e751f8 Fixed warnings in Mvvm unit tests 2021-07-30 02:16:57 +02:00
Sergio Pedri d9720a57f9 Renamed [AlsoNotifyFor] attribute to [AlsoNotifyChangeFor] 2021-07-21 02:32:12 +02:00
Sergio Pedri 5a1c227c50 Switched generated command field to concrete type
Doing this enables the JIT to devirtualize function calls through the property
2021-07-21 02:32:12 +02:00
Sergio Pedri 42318d208d Improved code generation for IRecipient generator 2021-07-21 02:32:12 +02:00
Sergio Pedri 8860e46d3d Enabled nullability annotations for [ObservableProperty] 2021-07-21 02:32:11 +02:00
Sergio Pedri 8f82555b13 Added support for <summary> XML docs for generated commands 2021-07-21 02:32:11 +02:00
Sergio Pedri 8adf8b2659 Stripped Async suffix to generated command names 2021-07-21 02:32:11 +02:00
Sergio Pedri ebb0ced14f Enabled [ICommand] generation for all command types 2021-07-21 02:32:11 +02:00
Sergio Pedri a131d8dbfe Enabled ICommandGenerator for RelayCommand type 2021-07-21 02:32:11 +02:00
Sergio Pedri 10613019d6 Added diagnostic for observable property + validation without base class 2021-07-21 02:32:10 +02:00
Sergio Pedri 774c1558c2 Enabled validation support for generated properties 2021-07-21 02:32:10 +02:00
Sergio Pedri 6826c44943 Added unit tests for validation attributes generation 2021-07-21 02:32:10 +02:00
Sergio Pedri e3ca7429d3 Added AlsoNotifyForAttribute type 2021-07-21 02:32:10 +02:00
Sergio Pedri b1fb60f331 Added handling for modifiers in sealed classes 2021-07-21 02:32:09 +02:00
Sergio Pedri b744017678 Added XML docs copying from fields to generated properties 2021-07-21 02:32:09 +02:00
Sergio Pedri 341e394e9b Added initial version of ObservablePropertyAttribute 2021-07-21 02:32:09 +02:00
Sergio Pedri 6b96fcd4ea Fixed unit test for generated RegisterAll method 2021-07-21 02:31:05 +02:00
Sergio Pedri e8a9c5636a Initial draft for IMessengerRegisterAllGenerator 2021-07-21 02:31:04 +02:00
Sergio Pedri b000e8af48 Fixed errors in unit tests 2021-07-21 02:31:04 +02:00
Sergio Pedri 08a3131fc0 Enabled constructor generation for [ObservableRecipient] 2021-07-21 02:31:03 +02:00
Sergio Pedri 6f9a2f4ed9 Added [ObservableRecipient] tests, minor bug fixes 2021-07-21 02:31:03 +02:00
Sergio Pedri 4f90d6295d Added INotifyPropertyChangedAttribute.IncludeAdditionalHelperMethods 2021-07-21 02:31:03 +02:00
Sergio Pedri b6f99dfcde Minor fixes to code generators and unit tests 2021-07-21 02:31:03 +02:00
Sergio Pedri f95072ee27 Added generator for [INotifyPropertyChanged] 2021-07-21 02:31:03 +02:00
Sergio Pedri a838dd9605 Added unit test file and reference 2021-07-21 02:31:02 +02:00
Nirmal Guru e6e4a221c3 Refactor Test project files
Remove redundant MSBuild logic
Consolidate common MSBuild logic
Reorder code-blocks for better readability
Fix-up comments and new-lines across project files

Improve support for Visual Studio 2022:
Since VS IDE 2022 (17.0) is 64-bit only, replace all 32-bit specific MSBuild properties with generic ones.
2021-07-20 21:45:10 +05:30
Nirmal Guru d52cc99280 Consolidate package versions
Update renamed files in the build logic
Use correct path format in the build logic
2021-06-04 21:00:29 +05:30
Nirmal Guru 35d785190b Fix-up white-spaces across project files
Add/Remove leading and trailing white-space (only in comments, code blocks, xml strings)
2021-06-04 21:00:20 +05:30
Nirmal Guru a661ee7522 Clean-up trailing white-spaces
Remove final new-lines
Remove trailing white-spaces
2021-05-17 12:43:06 -07:00
michael-hawker 4f6c3ac1c0 Upgrade to WinUI 2.5 and other Dependencies - Deprecate RadialProgressBar 2021-02-16 11:43:00 -08:00
Sergio Pedri e61ef82070 Added .NET 5 target (and removed built-in package) 2021-02-13 00:16:30 +01:00
Sergio Pedri 92131a4cbf Added missing references to test projects 2021-02-03 12:05:29 +01:00
Sergio Pedri 6c825897cf Fixed compiler switches for .NET Core 3.1 and .NET 5 2020-11-05 19:00:25 +01:00
Sergio Pedri d94c429519 Added unit tests for new request message types 2020-06-26 15:05:07 +02:00