Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <Style TargetType="{x:Type controls:FieldTextBox}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type controls:FieldTextBox}">
- <Border BorderThickness="0" Margin="5">
- <StackPanel ToolTip="{Binding Path=Field.HintText, RelativeSource={RelativeSource TemplatedParent}}">
- <TextBlock Text="{Binding Path=Field.FieldLabel, RelativeSource={RelativeSource TemplatedParent}}"
- HorizontalAlignment="Left"
- />
- <TextBox Width="{Binding Path=Field.DisplayWidth, RelativeSource={RelativeSource TemplatedParent}}"
- HorizontalAlignment="Left"
- Text="{Binding Path=Field.Data.CurrentValue, RelativeSource={RelativeSource TemplatedParent}}"
- IsEnabled="{Binding Path=Field.IsEnabled, RelativeSource={RelativeSource TemplatedParent}}"
- ContextMenu="{Binding Source={StaticResource FieldContextMenu}}" >
- <TextBox.Background>
- <SolidColorBrush Color="{Binding Path=Field.CurrentBackgroundColor, RelativeSource={RelativeSource TemplatedParent}}"/>
- </TextBox.Background>
- </TextBox>
- </StackPanel>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="Focusable" Value="True" />
- <Setter Property="IsTabStop" Value="False" />
- </Style>
- Control control = (Control)this.Template.FindName("FocusableControl", this);
- if (control != null)
- {
- control.Focus();
- }
Add Comment
Please, Sign In to add comment