|
<UserControl x:Class="Catel.Windows.Controls.MultiLineInput"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Converters="clr-namespace:Catel.Windows.Data.Converters"
Height="80" Margin="{DynamicResource Margin.Default}">
<!-- Resources -->
<UserControl.Resources>
<!-- Converters -->
<Converters:EmptyStringToCollapsingVisibilityConverter x:Key="EmptyStringToCollapsingVisibilityConverter" />
</UserControl.Resources>
<!-- Content -->
<DockPanel LastChildFill="True" DataContext="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}">
<!-- Caption -->
<TextBlock DockPanel.Dock="Top" Text="{Binding Caption}"
Visibility="{Binding Caption, Converter={StaticResource EmptyStringToCollapsingVisibilityConverter}}"/>
<!-- Actual textbox -->
<TextBox AcceptsReturn="True" AcceptsTab="True" TextWrapping="Wrap" Width="{Binding ActualWidth}" ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Disabled" Background="{Binding TextBoxBackground}"
HorizontalAlignment="Stretch" MaxLength="{Binding MaxTextLength}" IsReadOnly="{Binding IsReadOnly}"
Text="{Binding Path=Text, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" Margin="0"
Validation.ValidationAdornerSiteFor="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" />
</DockPanel>
</UserControl>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.