Commit Graph
2284 Commits
Author SHA1 Message Date
Michael Hawker MSFT (XAML Llama) a053f0b8f2 Merge pull request #4285 from Sergio0694/bugfix/csharp8.0-mvvm-toolkit
Fix MVVM Toolkit build errors when using C# < 9.0
2021-10-07 13:35:32 -07:00
Sergio Pedri c9c601486f Disabled ValidateAllProperties/RegisterAll generators w/ <= 8.0 2021-09-29 11:30:47 +02:00
Sergio Pedri 7cc3ac6c14 Removed unnecessary C# version checks in two generators 2021-09-29 11:24:29 +02:00
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
Sergio Pedri 181e63f9a2 Added short path in fallback logic for RegisterAll 2021-09-28 11:08:51 +02:00
Sergio Pedri 9a3462f371 Added short path in fallback logic for ValidateAllProperties 2021-09-28 10:52:54 +02:00
Sergio Pedri 0a090ff802 Added more unit tests for ValidateAllProperties fallback 2021-09-28 10:47:14 +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
Nirmal Guru 1293491813 Update UnitTests' EditorConfig
Add comments describing the nature of the warning.
2021-09-10 07:09:39 +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 0814b3ae63 Added unit tests for new diagnostic 2021-09-08 18:02:11 +02:00
Sergio Pedri 02598f38d7 Added diagnostic for unsupported C# language version 2021-09-08 15:58:57 +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 b69f458394 Merge pull request #4198 from Sergio0694/testing/mvvm-toolkit-sg
Fix and enable MVVM Toolkit source generator unit tests
2021-09-04 00:34:28 +02:00
Sergio Pedri 3b368785d7 Fixed [ObservableProperty] for fields named "value" 2021-09-02 12:30:39 +02:00
msftbot[bot] aeeb669319 Attached Shadows (Composition and Win2D + Animations) (#4179)
## Fixes #3122 #3607 #3516

_Also implements #3693 for the new DropShadow._

FYI @seanocali as this is a different implementation approach (which is simpler to use outside of the DropShadowPanel we've been working on) but should hopefully achieve the same result.

This PR adds attached shadows which can easily be attached to any FrameworkElement without needing to modify the layout like DropShadowPanel does today. They can also be shared using a resource, added to the style of an element, and animated! All the things! 🎉

## PR Type

What kind of change does this PR introduce?

<!-- Please uncomment one or more options below that apply to this PR. -->

<!-- - Bugfix -->
- Feature by @Ryken100 and integrated/extended by @michael-hawker 
<!-- - 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?

DropShadowPanel is clunky and requires modifying how you layout your app.

## What is the new behavior?

Just attach a shadow and be done! (DropShadowPanel is deprecated.)

## PR Checklist

- [x] Composition Only Shadow Support? (with Target)
- [x] Add XML Docs
- [x] Animation Support to Explicit Animation System?
- [x] Bug can't use `AttachedCardShadow` directly with `Border`?

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

- [ ] Tested code with current [supported SDKs](../#supported)
- [ ] Pull Request has been submitted to the documentation repository [instructions](../blob/main/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

<!-- Please add any other information that might be helpful to reviewers. -->
2021-08-27 23:09:34 +00:00
michael-hawker e74617a9de Clean-up Shadow internal part usage based on @Sergio0694 PR comments 2021-08-27 14:52:40 -07:00
Sergio Pedri 0b69f437b5 Fix MVVM Toolkit source generator tests 2021-08-27 16:31:35 +02:00
michael-hawker e093b38e75 Fix issues with XML documentation for new shadows feature 2021-08-25 11:44:19 -07:00
Christopher Blackman f654ac78c4 Initial attached shadow code 2021-08-25 11:42:43 -07:00
Michael Hawker MSFT (XAML Llama) 6626c070f9 Merge pull request #4173 from CommunityToolkit/shweaver/file-storage
Enable item renaming and add tests for ApplicationDataStorageHelper
2021-08-19 14:45:54 -07:00
Sergio Pedri bb741ac877 Fixed links to related issue 2021-08-12 12:57:08 +02:00
Shane Weaver 4117941ca4 Added TryRenameItemAsync and TryDeleteItemAsync to IFileStorageHelper 2021-08-09 15:21:05 -07:00
Sergio Pedri 193931d1e0 Switched .NET Standard 2.0 check to use accessibility 2021-08-09 20:22:19 +02:00
Sergio Pedri 082be3f371 Fixed nullability attributes generation on .NET Standard 2.0 2021-08-09 20:15:22 +02:00
Sergio Pedri a55a90be77 Added .NET Standard 2.0 test project 2021-08-09 20:09:43 +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
msftbot[bot] 94a6edcae3 Fix warnings in HighPerformance/Mvvm unit tests (#4142)
## Fixes https://github.com/CommunityToolkit/WindowsCommunityToolkit/pull/4102#issuecomment-888964962
<!-- 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 options below that apply to this PR. -->

- Maintenance
<!-- - 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. -->
Some HighPerformance/Mvvm unit tests produce warnings when the projects are built.

## What is the new behavior?
<!-- Describe how was this issue resolved or changed? -->
No more warnings 🙌

## PR Checklist

Please check if your PR fulfills the following requirements:

- [X] Tested code with current [supported SDKs](../readme.md#supported)
- [X] Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link -->
- [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-08-04 18:23:46 +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 a030cf8585 Fixed warnings in HighPerformance unit tests 2021-07-30 02:16:57 +02:00
Sergio Pedri dad3018fd3 Added attributes generation if missing 2021-07-30 02:14:08 +02:00
Sergio Pedri a5e1045d6f Removed leftover comment 2021-07-30 02:14:08 +02:00
Sergio Pedri 208ee5efd3 Added more nullability annotations to helper methods 2021-07-30 02:14:08 +02:00
msftbot[bot] 87c1d68a26 ObjectStorage enhancements (#4102)
<!-- 🚨 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 #3903 
<!-- 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 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?
<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->
The ObjectStorage helper interfaces and implementations currently live in the `*.Uwp` package. This means that they are not consumable from NetStandard projects, such as the `CommunityToolkit.Graph` package.

In addition, the `IObjectStorageHelper` is a mixture of support for both dictionary style settings storage, with some file storage features as well. Currently, supporting both file and folder scenarios is odd/difficult for storage endpoints that don't operate in a similar manner to `Windows.Storage.ApplicationData`.

Lastly, the support for file storage in `IObjectStorageHelper` is not complete and missing some basic CRUD operations that can make it difficult to work with in real-world application scenarios.

## What is the new behavior?
<!-- Describe how was this issue resolved or changed? -->
I've done a few things:

1. Deprecated the existing structures in the `Microsoft.Toolkit.Uwp/Helpers/ObjectStorage` folder:
    - `BaseObjectStorageHelper`
    - `IObjectSerializer`
    - `IObjectStorageHelper`
    - `LocalObjectStorageHelper`
    - `SystemSerializer`

2. Migrated some of the previous structures up into the `Microsoft.Toolkit/Helpers/ObjectStorage` folder so that they are consumable from NetStandard:
    - `IObjectSerializer`
    - `SystemSerializer`

3. Created new interfaces to replace the functionality defined in the now defunct `IObjectStorageHelper`:
    - `ISettingsStorageHelper` - Interop with values as key/value pairs, like a dictionary.
    - `IFileStorageHelper` - Interop with a file system to store values in files and folders.

4. Replaced the functionality provided by `BaseObjectStorageHelper` and `LocalObjectStorageHelper` with an implementation of `ISettingsStorageHelper` and `IFileStorageHelper`:
    - `ApplicationDataStorageHelper` - Interop with local settings and files through `Windows.Storage.ApplicationData`.

Use it like so:
```
ApplicationDataStorageHelper appDataStorageHelper = ApplicationDataStorageHelper.GetCurrent(new Toolkit.Helpers.SystemSerializer());

// Save and Read simple objects
string keySimpleObject = "simple";
appDataStorageHelper.Save(keySimpleObject, 42);
appDataStorageHelper.TryRead<string>(keySimpleObject, out string result);

// Save and Read complex objects
string complexObjectKey = "complexObject";
await appDataStorageHelper.SaveFileAsync(complexObjectKey, new MyComplexObject());
var complexObject = await appDataStorageHelper.ReadFileAsync<MyComplexObject>(complexObjectKey);

// Complex object example
public class MyComplexObject
{
    public string MyContent { get; set; }
    public List<string> MyContents { get; set; }
    public List<MyComplexObject> MyObjects { get; set; }
}
```

Altogether, this provides a transition path from the previous ObjectStorage constructs to a more granular set of interfaces with identical signatures plus enhanced support for file and folder CRUD operations.

## 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 -->
- [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/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

<!-- 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
Looking for feedback!
2021-07-29 19:26:04 +00:00
Shane WeaverandSergio Pedri d9e68b09cc Update Microsoft.Toolkit/Extensions/ISettingsStorageHelperExtensions.cs
Co-authored-by: Sergio Pedri <sergio0694@live.com>
2021-07-28 10:55:26 -07:00
Shane Weaver 1ff63d00dd PR updates 2021-07-27 17:34:38 -07:00
Shane Weaver 5d9421e328 PR updates 2021-07-26 15:09:18 -07:00
Shane Weaver 8dc1ed92a5 Merge branch 'shweaver/storage-helpers' of https://github.com/windows-toolkit/WindowsCommunityToolkit into shweaver/storage-helpers 2021-07-26 12:15:50 -07:00
Shane Weaver 29536e4dc9 PR updates 2021-07-26 12:15:46 -07:00
Shane WeaverandSergio Pedri 23551ebd63 Update Microsoft.Toolkit/Helpers/ObjectStorage/ISettingsStorageHelper.cs
Co-authored-by: Sergio Pedri <sergio0694@live.com>
2021-07-26 11:50:08 -07:00
Shane Weaver ded67f306c Merge branch 'main' into shweaver/storage-helpers 2021-07-23 15:18:43 -07:00
Michael Hawker MSFT (XAML Llama) 1e52eba578 Merge pull request #3873 from Sergio0694/feature/mvvm-toolkit-sg
MVVM Toolkit vNext: source generators
2021-07-23 14:41:34 -07:00