title: Set a property in XAML to a function
body: <p>I need to set the property of cotrol which is a dependent of another property of its parent.
  I try to explain better my problem with an example. I want to create a toggle switch button that animates a "slider" element into it. The dimensions of the toggle switch is being defined when the usercontrol is inserted into the application window. I want the slider be sized half larger than the switch case. So if the control is large 100, the slider should be 50, or if large 250, the slider should be 125. Then I need a sort of call to a function or something similar:</p>
  
  <pre><code>&lt;UserControl&gt;
   &lt;Border Name="switchCase" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"&gt;
      &lt;Border Name="slider" Width="**Container.Width/2**" &gt;&lt;/Border&gt;
   &lt;/Border&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>Is there any possibilities to achieve this ?? 
  Thanks in advance
  Paolo</p>