title: usercontrol inside an other user control. How to use properties?
body: <p>I made a usercontrol with several element inside (toggles, button, text box, etc...). I'm using this usercontrol inside an other one, and load this final usercontrol at runtime and on my final application. I'm a little lost with dependency property, I would like to access the properties of the very first from my application.</p>
  
  <p>The first usercontrol is called "Ch_Parameters" :</p>
  
  <pre><code>&lt;UserControl
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
           xmlns:local="clr-namespace:CustomControlTest"
           xmlns:System="clr-namespace:System;assembly=mscorlib" x:Class="CustomControlTest.ChannelParameters"
           mc:Ignorable="d" 
           x:Name="Ch_Parameters"
           d:DesignHeight="247.465" d:DesignWidth="436.624"&gt;
  </code></pre>
  
  <p>I'm trying to first communicate with a toggle button contained in "Ch_Parameters" and its properties "IsChecked"</p>
  
  <pre><code>&lt;ToggleButton x:Name="Flip_X" Content="FLIP X" Style="{DynamicResource BaseToggleButtonStyle}" IsChecked="{Binding Path=DataContext.Flip_X, ElementName=Ch_Parameters, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/&gt;
  </code></pre>
  
  <p>and here is a the code for the property</p>
  
  <pre><code>        public static readonly DependencyProperty FlipXProperty =
      DependencyProperty.Register("FlipX", typeof(bool), typeof(ChannelParameters), new PropertyMetadata(true));
  
      [Bindable(true)]
      public bool FlipX
      {
          get { return (bool)this.GetValue(FlipXProperty); }
          set { this.SetValue(FlipXProperty, value); }
      }
  </code></pre>
  
  <p>Now this usercontrol is used in other one called cmix :</p>
  
  <pre><code>         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
           xmlns:local="clr-namespace:CustomControlTest"
           x:Name="cmix"
           xmlns:System="clr-namespace:System;assembly=mscorlib" x:Class="CustomControlTest.C_MiX_UserInterface"
           mc:Ignorable="d" d:DesignWidth="674.669" d:DesignHeight="337.953"&gt;
  </code></pre>
  
  <p>here :</p>
  
  <pre><code>&lt;local:ChannelParameters FlipX="{Binding Path=Datacontext.VidFlipX, ElementName=cmix, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/&gt;
  </code></pre>
  
  <p>and the code for the cmix property : </p>
  
  <pre><code>        public static readonly DependencyProperty VidFlipXProperty =
      DependencyProperty.Register("VidFlipX", typeof(bool), typeof(C_MiX_UserInterface), new PropertyMetadata(true));
  
      [Bindable(true)]
      public bool VidFlipX
      {
          get { return (bool)this.GetValue(VidFlipXProperty); }
          set { this.SetValue(VidFlipXProperty, value); }
      }
  </code></pre>
  
  <p>but, when I use the usercontrol "cmix" and load it at runtime, the property FLIPX from the Ch_Parameters usercontrol is not outputing anything when I trigger the toggle button.</p>
  
  <pre><code>var uiElement = (C_MiX_UserInterface)UIElementOut[i];
  var toggle = uiElement.VidFlipX;
  </code></pre>
  
  <p>Is there a specific method to use properties from usercontrol inside an other usercontrol ?</p>