forked from reactiveui/ReactiveUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewAttributes.cs
More file actions
39 lines (35 loc) · 1.29 KB
/
ViewAttributes.cs
File metadata and controls
39 lines (35 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MS-PL license.
// See the LICENSE file in the project root for more information.
namespace ReactiveUI
{
using System;
/// <summary>
/// Allows an additional string to make view resolution more specific than
/// just a type. When applied to your <see cref="IViewFor{T}"/> -derived
/// View, you can select between different Views for a single ViewModel
/// instance.
/// </summary>
public class ViewContractAttribute : Attribute
{
/// <summary>
/// Constructs the ViewContractAttribute with a specific contract value.
/// </summary>
/// <param name="contract">The value of the contract for view
/// resolution.</param>
public ViewContractAttribute(string contract)
{
Contract = contract;
}
public string Contract { get; }
}
/// <summary>
/// Indicates that this View should be constructed _once_ and then used
/// every time its ViewModel View is resolved.
/// Obviously, this is not supported on Views that may be reused multiple
/// times in the Visual Tree.
/// </summary>
public class SingleInstanceViewAttribute : Attribute
{
}
}