We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This issue tracks adding a new source generator for CanvasEffect properties. It will be conceptually similar to the MVVM Toolkit observable property generator.
CanvasEffect
In ComputeSharp.D2D1.WinUI:
namespace ComputeSharp.D2D1.WinUI; [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] public sealed class GeneratedCanvasEffectPropertyAttribute(CanvasEffectInvalidationType invalidationType = CanvasEffectInvalidationType.Update) : Attribute { public CanvasEffectInvalidationType InvalidationType { get; } }
User code:
public sealed partial class MyEffect : CanvasEffect { [GeneratedCanvasEffectProperty] public partial int BlurAmount { get; set; } }
Generated code:
partial class MyEffect : CanvasEffect { public partial int BlurAmount { get => field; set { if (EqualityComparer<int>.Default.Equals(field, value)) { return; } int oldValue = field; OnBlurAmountChanging(value); OnBlurAmountChanging(oldValue, value); field = value; OnBlurAmountChanged(value); OnBlurAmountChanged(oldValue, value); InvalidateEffectGraph(invalidationType); } } partial void OnBlurAmountChanging(int newValue); partial void OnBlurAmountChanging(int oldValue, int newValue); partial void OnBlurAmountChanged(int newValue); partial void OnBlurAmountChanged(int oldValue, int newValue); }
This should contain any drawbacks for the proposal that came up during the discussions.
Just do nothing.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Description
This issue tracks adding a new source generator for
CanvasEffect
properties.It will be conceptually similar to the MVVM Toolkit observable property generator.
Proposed API
In ComputeSharp.D2D1.WinUI:
Example use
User code:
Generated code:
This should contain any drawbacks for the proposal
that came up during the discussions.
Alternatives
Just do nothing.
Work items
The text was updated successfully, but these errors were encountered: