title: How to access Control Template controls outside using XAML?
body: <p>I want to use a NumercUpDown value designed inside a ControlTemplate in another NumericUpDown DatatTrigger, to set up its maximum value based on a condition.</p>
  
  <p>Code -1</p>
  
  <pre><code>&lt;ControlTemplate x:Key="OrderInfo" TargetType="ContentControl"&gt;
  
              &lt;TextBlock Grid.Row="0" Grid.Column="0" Style="{StaticResource TextBlockStyle}"&gt;Limit Price:&lt;/TextBlock&gt;
              &lt;i:NumericUpDown Grid.Row="0" Grid.Column="1" x:Name="Price" i:Skin.IsPrice="True" RoundingDecimalPlaces="{Binding Source={StaticResource PriceFormat}, Path=MaxDecimalPlaces}" DisplayFormat="{Binding Source={StaticResource PriceFormat}, Path=StringFormat}" Minimum="0" Increment="{Binding Path=PriceIncrement.Value, TargetNullValue=1}" IncrementCount="{Binding Path=PriceIncrementCount.Value}"&gt;
                  &lt;i:NumericUpDown.Style&gt;
                      &lt;Style TargetType="i:NumericUpDown" BasedOn="{StaticResource BasicStyle}"&gt;
                          &lt;Setter Property="Value" Value="{Binding Path=Price.Value, ValidatesOnExceptions=True, ValidatesOnDataErrors=True}" /&gt;
                          &lt;Style.Triggers&gt;
                              &lt;DataTrigger Binding="{Binding Path=Price.IsAvailable}" Value="False"&gt;
                                  &lt;Setter Property="Value" Value="{Binding Path=Price.EstimatedPrice, Mode=OneWay}" /&gt;
                              &lt;/DataTrigger&gt;
                          &lt;/Style.Triggers&gt;
                      &lt;/Style&gt;
                  &lt;/i:NumericUpDown.Style&gt;
              &lt;/i:NumericUpDown&gt;
  
          &lt;/Grid&gt;
      &lt;/ControlTemplate&gt;
  </code></pre>
  
  <p>Want to use the above Price element in the below  Data Trigger</p>
  
  <pre><code>&lt;i:NumericUpDown Grid.Row="0" Grid.Column="3" x:Name="CompletionPrice" 
                                   Value="{Binding Path=ExternalAlgoProperties[(i:Description)CompletionPrice].Value, 
                      ValidatesOnExceptions=True, ValidatesOnDataErrors=True}" IsEnabled="True"
                                   RoundingDecimalPlaces="0" Increment="1" Minimum="0"&gt;
                      &lt;i:NumericUpDown.Style&gt;
                          &lt;Style TargetType="i:NumericUpDown" BasedOn="{StaticResource BasicStyle}"&gt;
                              &lt;Setter Property="Maximum" Value="0"&gt;&lt;/Setter&gt;
                              &lt;Style.Triggers&gt;
                                  &lt;DataTrigger Binding="{Binding Path=Side.Code,ConverterParameter={x:Static i:SideCodes.Sell}, Converter={StaticResource EqualsConverter},UpdateSourceTrigger=PropertyChanged}" Value="True"&gt;
                                      &lt;Setter Property="Maximum" Value="{Binding ElementName=Price,Path=Text,UpdateSourceTrigger=PropertyChanged}"&gt;&lt;/Setter&gt;
                                  &lt;/DataTrigger&gt;
                              &lt;/Style.Triggers&gt;
                          &lt;/Style&gt;
                      &lt;/i:NumericUpDown.Style&gt;
  
                  &lt;/i:NumericUpDown&gt;
  </code></pre>