I have created a user control that needs to reference an external resource dictionary file. A style within this resource file is then used against a textbox in the user control.
The external resource dictionary file is as follows:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Style x:Key="ValidatedTextboxStyle" TargetType="{x:Type TextBox}"> ... </Style> I then import this into the user control as follows: (with the long file location removed)
<Control.Resources> <ResourceDictionary x:Key="Test" Source="..." /> <common:StringCollapseVisibilityConverter x:Key="StringCollapseVisibilityConverter" /> </Control.Resources> The WPF designer forces me to give it a "key" due to the other resource that is referenced.
Without the dictionary having a name, you would normally reference it like:
Style="{StaticResource ValidatedTextboxStyle}" How would I reference the style that has name "ValidatedTextboxStyle" within the external resource file taking into account that the imported resource dictionary is given the key name "Test"?