如何为onw WPF窗口制作两个代码隐藏文件。 [英] How to make two codebehind files for onw WPF window.
问题描述
我的wpf窗口需要两个代码隐藏文件。设置如下:
Window1.xaml
Window1.xaml.cs
我需要一个更多.cs文件,我可以在其中存储事件处理函数。
i需要以下列方式访问这些函数:
< Button MouseEnter =aFunctionInTheEventHandlerSourceFile/> ;
提前感谢。
我的尝试:
i尝试按如下方式导入文件:
xmlns:localclr-namespace:myNamespace.Class
但我不知道如何访问这些函数。
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.
推荐答案
看看部分类和方法 [ ^ ]
部分类,多个代码隐藏文件 [< a href =http://stackoverflow.com/a/2 3996167/1147428target =_ blanktitle =新窗口> ^ ]
这篇关于如何为onw WPF窗口制作两个代码隐藏文件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!