Click here to Skip to main content
15,878,945 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi to everybody!

I have the next trouble.

In my WPF application I have some ResourceDictionaries( TextBoxStyle, CheckBoxStyle... and others) and a global ResouceDictionary (ResourceLibrary) where I merge the rest of the ResourceDictionaries.

In my app.xaml I have this xaml code:

XML
<Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/Application;component/ResourceDictionaries/ResourceLibrary.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>


Hitherto, all the styles have been working perfectly, but now I want to add a PreviewMouseLeftButtonDown event to all TextBoxes in my app so I tried to add this code

XML
<EventSetter Event="MouseLeftButtonDown" Handler="TextBlockMouseLeftButtonDown" />

at TextBoxStyle ResourceDictionary.

What else is needed to make this work? Where I have to add the code for the event? In a new class?

Thanks for all!!
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900