Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
BindingProxy.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 
4 using System.Windows;
5 
6 // http://www.thomaslevesque.com/2011/03/21/wpf-how-to-bind-to-data-when-the-datacontext-is-not-inherited/
7 
8 namespace SiliconStudio.Presentation.Core
9 {
10  /// <summary>
11  /// A class that serves as a proxy for data binding. As a freezable, its <see cref="Data"/> dependency property can inherit data context from a container <see cref="DependencyObject"/>.
12  /// </summary>
13  public class BindingProxy : Freezable
14  {
15  /// <summary>
16  /// Identifies the <see cref="Data"/> dependency property.
17  /// </summary>
18  public static readonly DependencyProperty DataProperty = DependencyProperty.Register("Data", typeof(object), typeof(BindingProxy));
19 
20  /// <summary>
21  /// Gets or sets the data contained in this <see cref="BindingProxy"/>.
22  /// </summary>
23  public object Data { get { return GetValue(DataProperty); } set { SetValue(DataProperty, value); } }
24 
25  /// <inheritdoc/>
26  protected override Freezable CreateInstanceCore()
27  {
28  return new BindingProxy();
29  }
30  }
31 }
A class that serves as a proxy for data binding. As a freezable, its Data dependency property can inh...
Definition: BindingProxy.cs:13