1

I need some help with my XAML code. I have this code. I use the style from the references in each TextBox control, that works perfectly.

xmlns:estilos="clr-namespace:Application.UtilityApplicationLayer.Recursos;assembly=UtilityApplicationLayer" <TextBox x:Name="Name" Style="{estilos:ApplicationWindowsResource ResourceKey=WaterMarkTextBox}"/> <TextBox x:Name="Middle name" Style="{estilos:ApplicationWindowsResource ResourceKey=WaterMarkTextBox}"/> <TextBox x:Name="Last name" Style="{estilos:ApplicationWindowsResource ResourceKey=WaterMarkTextBox}"/> <TextBox x:Name="Age" Style="{estilos:ApplicationWindowsResource ResourceKey=WaterMarkTextBox}"/> 

Now I want to do is to create the TextBox controls without directly apply the style in each one. I have done this, but that doesn't work. Any suggestions.

xmlns:estilos="clr-namespace:Application.UtilityApplicationLayer.Recursos;assembly=UtilityApplicationLayer" <Window.Resources> <ResourceDictionary> <Style TargetType="TextBox"> <Setter Property="Style" Value="{estilos:PractalisVentanasRecursos ResourceKey=WaterMarkTextBox}"/> </Style> </ResourceDictionary> </Window.Resources> <TextBox x:Name="Name" /> <TextBox x:Name="Middle name"/> <TextBox x:Name="Last name" /> <TextBox x:Name="Age"/> 

Thanks.

1
  • Do you have the ResourcesDictionary that lives in estilos UtilityApplicationLayer? I means the full resource Dictionary Xaml code? Commented Jul 7, 2016 at 22:26

1 Answer 1

1

Try use Styles looks like:

<Style TargetType="TextBox" BasedOn="{estilos:PractalisVentanasRecursos ResourceKey=WaterMarkTextBox}"/> 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.