summaryrefslogtreecommitdiff
path: root/src/bindings/mono/efl_mono/Bind.cs
blob: 5a10f780f557efe84599ae0442ed05d5025231d5 (plain) (blame)
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
#if EFL_BETA

using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel;

namespace Efl {

/// <summary>Representas a bindable property as used by <see cref="Efl.Ui.ItemFactory&lt;T&gt;" /> instances.
///
/// <para>It is internally instantiated and returned by generated extension methods.</para>
/// </summary>
public class Bindable<T>
{
    /// <summary>Creates a new bindable property with the source name <c>name</c>.</summary>
    public Bindable(string name, Efl.Ui.IPropertyBind binder)
    {
        this.name = name;
        this.binder = binder;
    }

    /// <summary>Binds the model property <c>model_property</c> to the property <c>name</c> set in the constructor.</summary>
    public void Bind(string model_property)
    {
        binder.PropertyBind(name, model_property);
    }

    string name;
    Efl.Ui.IPropertyBind binder;
}

}

#endif