# C1.WPF.Schedule.PropertyBridge-1

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_WPF_Schedule_PropertyBridge_1" data-uid="C1.WPF.Schedule.PropertyBridge`1" class="text-break">PropertyBridge&lt;TPropType&gt; Class
</h1>
  <div class="markdown level0 summary"><p>Represents a class that exposes two dependency properties and keeps
their values equal.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.media.visual">Visual</a></div>
    <div class="level2"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.uielement">UIElement</a></div>
    <div class="level3"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a></div>
    <div class="level4"><span class="xref">PropertyBridge&lt;TPropType&gt;</span></div>
      <div class="level5"><a class="xref" href="C1.WPF.Schedule.PropertyBridge.html">PropertyBridge</a></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.media.animation.ianimatable">IAnimatable</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.iframeworkinputelement">IFrameworkInputElement</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.iinputelement">IInputElement</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.isupportinitialize">ISupportInitialize</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.markup.iqueryambient">IQueryAmbient</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.WPF.Schedule.html">C1.WPF.Schedule</a></h6>
  <h6><strong>Assembly</strong>: C1.WPF.Schedule.dll</h6>
  <h5 id="C1_WPF_Schedule_PropertyBridge_1_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[Obfuscation(Exclude = true, ApplyToMembers = true)]
public class PropertyBridge&lt;TPropType&gt; : FrameworkElement, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">&lt;Obfuscation(Exclude:=True, ApplyToMembers:=True)&gt;
Public Class PropertyBridge(Of TPropType)
    Inherits FrameworkElement
    Implements IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient</code></pre>
  </div>
  <h5 class="typeParameters">Type Parameters</h5>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="parametername">TPropType</span></td>
        <td><p>Defines a type of exposed dependency properties.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="C1_WPF_Schedule_PropertyBridge_1_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><p>For a usage in XAML appeal to the non-generic class derived from the
<a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.html">PropertyBridge&lt;TPropType&gt;</a>, for example use the
<a class="xref" href="C1.WPF.Schedule.PropertyBridge.html">PropertyBridge</a> class.</p>
<p>
<a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.html">PropertyBridge&lt;TPropType&gt;</a> exposes two dependency properties, 
<a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.Source.html#C1_WPF_Schedule_PropertyBridge_1_Source">Source</a> and 
<a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.Target.html#C1_WPF_Schedule_PropertyBridge_1_Target">Target</a>, and keeps these property values 
equal, that is when a value of one property is being changed then the other 
property is being set to the same value. This simple behavior allows you to 
use non-DependencyProperty properties along with WPF mechanisms that are 
designed to work with DependencyProperty-only properties. 
</p>
<p>
The behavioral difference between the <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.Source.html#C1_WPF_Schedule_PropertyBridge_1_Source">Source</a>
and <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.Target.html#C1_WPF_Schedule_PropertyBridge_1_Target">Target</a> properties lies in the fact that after
an initialization of XAML tree where the <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.html">PropertyBridge&lt;TPropType&gt;</a>
element is included, the <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.Target.html#C1_WPF_Schedule_PropertyBridge_1_Target">Target</a> property value 
is initialized with the <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.Source.html#C1_WPF_Schedule_PropertyBridge_1_Source">Source</a> property value – 
in all other respects the behavior of these properties is equivalent.
</p>
<p>
Note that if you need to use <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.html">PropertyBridge&lt;TPropType&gt;</a> as a 
standalone object in run-time, that is without including it in a XAML tree,
you need to call its BeginInit and EndInit methods – only after this
action <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.html">PropertyBridge&lt;TPropType&gt;</a> will start property value
synchronization.
</p>
<p>
The useful examples of 
the <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.html">PropertyBridge&lt;TPropType&gt;</a> class usage are:
</p>
<ul><li><span class="term">
Binding between two non-dependency properties.
</span>
Assign the <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.Source.html#C1_WPF_Schedule_PropertyBridge_1_Source">Source</a> property with a TwoWay binding 
having one non-dependency property as a source, and the <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.Target.html#C1_WPF_Schedule_PropertyBridge_1_Target">Target</a> property 
with a TwoWay binding having another non-dependency property as a source. 
After this, the non-dependency properties will behave as bound ones. 
This only works well if classes exposing the mentioned non-dependency properties 
implement the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.inotifypropertychanged">INotifyPropertyChanged</a> interface.
</li><li><span class="term">
Setting a non-dependency property value from within a Trigger.
</span>
Assign the <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.Source.html#C1_WPF_Schedule_PropertyBridge_1_Source">Source</a> property with a TwoWay or 
OneWayToSource binding having one non-dependency property as a source, and 
by specifying a Trigger's Setter set a value to the 
<a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.Target.html#C1_WPF_Schedule_PropertyBridge_1_Target">Target</a> property of 
<a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.html">PropertyBridge&lt;TPropType&gt;</a> – this value will be assigned to the 
non-dependency property which is bound to 
<a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.Source.html#C1_WPF_Schedule_PropertyBridge_1_Source">Source</a>.
</li><li><span class="term">
Many-to-many binding.
</span>
Assign the <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.Source.html#C1_WPF_Schedule_PropertyBridge_1_Source">Source</a> and 
<a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.Target.html#C1_WPF_Schedule_PropertyBridge_1_Target">Target</a> with MultiBinding 
bindings – you will get the many-to-many binding.
</li><li><span class="term">
Assign value to a nested property.
</span>
Set up the <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.Target.html#C1_WPF_Schedule_PropertyBridge_1_Target">Target</a> property with 
a TwoWay or OneWayToSource binding where Binding.Path references a nested property, 
then assign the <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.Source.html#C1_WPF_Schedule_PropertyBridge_1_Source">Source</a> property 
(directly or from within a Setter) with a value - as a result the nested property 
will be assigned to this value.
</li><li><span class="term">
Assign a property of an object that is not accessible directly.
</span>
Similar to the way explained in the previous item, and using 
Binding.RelativeSource in a 
binding to the <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.Target.html#C1_WPF_Schedule_PropertyBridge_1_Target">Target</a> property, you may 
assign a property value of an element that can't be referenced directly in XAML, 
for example TemplatedParent or some parent element in visual tree.
</li></ul>
<p>
The <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.html">PropertyBridge&lt;TPropType&gt;</a> class is derived from the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a> class
and, in order to work properly, should be placed somewhere in the visual tree among elements 
that it should communicate with. The derivation from the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a> class is intentional; 
it allows the <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.html">PropertyBridge&lt;TPropType&gt;</a> to be part of a visual tree, 
which in turn provides bindings established on its properties with a correct context. 
</p>
<p>
The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.uielement.visibility">Visibility</a> property of the <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.html">PropertyBridge&lt;TPropType&gt;</a> element 
is set to Collapsed by default, so this object will not appear on a screen and doesn't participate 
in layout measurement and arrangement processes, that is, it doesn't affect
a visual representation of the visual tree where it placed in.
</p>
</div>
  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Schedule_PropertyBridge_1__ctor" data-uid="C1.WPF.Schedule.PropertyBridge`1.#ctor">
          <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.-ctor.html#C1_WPF_Schedule_PropertyBridge_1__ctor">PropertyBridge()</a>
        </td>
        <td class="markdown level1 summary"><p>Creates an instance of the <a class="xref" href="C1.WPF.Schedule.PropertyBridge.html">PropertyBridge</a> element.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="fields">Fields
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Schedule_PropertyBridge_1_SourceProperty" data-uid="C1.WPF.Schedule.PropertyBridge`1.SourceProperty">
          <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.SourceProperty.html">SourceProperty</a>
        </td>
        <td class="markdown level1 summary"><p>Identifies the <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.Source.html#C1_WPF_Schedule_PropertyBridge_1_Source">Source</a> dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Schedule_PropertyBridge_1_TargetProperty" data-uid="C1.WPF.Schedule.PropertyBridge`1.TargetProperty">
          <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.TargetProperty.html">TargetProperty</a>
        </td>
        <td class="markdown level1 summary"><p>Identifies the <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.Target.html#C1_WPF_Schedule_PropertyBridge_1_Target">Target</a> dependency property.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Schedule_PropertyBridge_1_Source" data-uid="C1.WPF.Schedule.PropertyBridge`1.Source">
          <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.Source.html#C1_WPF_Schedule_PropertyBridge_1_Source">Source</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a source value.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Schedule_PropertyBridge_1_Target" data-uid="C1.WPF.Schedule.PropertyBridge`1.Target">
          <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.Target.html#C1_WPF_Schedule_PropertyBridge_1_Target">Target</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a target value.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Schedule_PropertyBridge_1_OnInitialized_System_EventArgs_" data-uid="C1.WPF.Schedule.PropertyBridge`1.OnInitialized(System.EventArgs)">
          <a class="xref" href="C1.WPF.Schedule.PropertyBridge-1.OnInitialized.html#C1_WPF_Schedule_PropertyBridge_1_OnInitialized_System_EventArgs_">OnInitialized(EventArgs)</a>
        </td>
        <td class="markdown level1 summary"><p>Synchronize the source and target properties after initializing.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
