Click here to Skip to main content
15,886,632 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
i need two codebehind files for my wpf window. The setup is as follows:
Window1.xaml
Window1.xaml.cs

and i need one more .cs file in which i can store the event handler functions.
i need to access those functions in the following way:
<Button MouseEnter="aFunctionInTheEventHandlerSourceFile"/>
thanks in advance.

What I have tried:

i tried to import the file as follows:
xmlns:local"clr-namespace:myNamespace.Class"
but i dont know how to access the functions.
Posted
Updated 1-Apr-16 4:02am

1 solution

 
Share this answer
 
v2
Comments
Ratul Thakur 1-Apr-16 10:48am    
Yeh that seems to work..... but i need a different class name so that i may use those functions from other classes.
Karthik_Mahalingam 1-Apr-16 10:51am    
then you can go for a static class or a noraml class to create properties and common methods over there.. which you can access from other class also..
note : you cant access any object of the xaml control directly in the other class.
Ratul Thakur 1-Apr-16 10:57am    
not directly (-_-)... k i'll go with the same class name. ...ty (^_^)
Karthik_Mahalingam 1-Apr-16 10:57am    
hmm.
Ratul Thakur 1-Apr-16 10:57am    
m from himachal btw

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