Guest User

Untitled

a guest
Aug 10th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  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>
Add Comment
Please, Sign In to add comment