daily pastebin goal
49%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. In WPF, how can I set a TextBox MaxHeight according to Two other controls
  2. <StackPanel
  3.                 Name="stkOuter">
  4.                 <StackPanel
  5.                     Name="stkInner">
  6.                     Content...
  7.                 </StackPanel>
  8.                 <TextBox>
  9.                     Content...
  10.                 </TextBox>
  11.             </StackPanel>
  12.    
  13. stkOuter.ActualHeight-stkInner.ActualHeight
  14.    
  15. MaxHeight="{Binding RelativeSource={RelativeSource AncestorType={x:Type StackPanel}},
  16.                     Path=ActualHeight,
  17.                     Converter={StaticResource MyConverter},
  18.                     ConverterParameter={WHAT GOES HERE?}}"
  19.    
  20. <TextBox.MaxHeight>
  21.    <MultiBinding Converter={StaticResource myIMultiValueConverter}>
  22.       <Binding /> <!-- bind the first value here -->
  23.       <Binding /> <!-- bind the second value here -->
  24.       ...
  25.    </MultiBinding>
  26. </TextBox.MaxHeight>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top