mirror of
https://github.com/chylex/.NET-Community-Toolkit.git
synced 2024-10-17 15:42:47 +02:00
3adf6fb689
Renormalize new lines and remove BOM from all files
32 lines
1.3 KiB
C#
32 lines
1.3 KiB
C#
// Licensed to the .NET Foundation under one or more agreements.
|
|
// The .NET Foundation licenses this file to you under the MIT license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
using System;
|
|
using System.ComponentModel;
|
|
|
|
namespace CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
/// <summary>
|
|
/// An attribute that indicates that a given type should have all the members from <see cref="ObservableObject"/>
|
|
/// generated into it, as well as the <see cref="INotifyPropertyChanged"/> and <see cref="INotifyPropertyChanging"/>
|
|
/// interfaces. This can be useful when you want the same functionality from <see cref="ObservableObject"/> into a class
|
|
/// that already inherits from another one (since C# doesn't support multiple inheritance). This attribute will trigger
|
|
/// the source generator to just create the same APIs directly into the decorated class.
|
|
/// <para>
|
|
/// This attribute can be used as follows:
|
|
/// <code>
|
|
/// [ObservableObject]
|
|
/// partial class MyViewModel : SomeOtherClass
|
|
/// {
|
|
/// // Other members here...
|
|
/// }
|
|
/// </code>
|
|
/// </para>
|
|
/// And with this, the same APIs from <see cref="ObservableObject"/> will be available on this type as well.
|
|
/// </summary>
|
|
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
|
|
public sealed class ObservableObjectAttribute : Attribute
|
|
{
|
|
}
|