I have a button with a click method assigned to it. I'd like to move that method to another CS file so I may reuse it in other places. Is it possible in XAML to reference a method, click method, from a CS source file outside of the Pages source file?
<Button x:Name="TheRedButton" Click="DoNotPressTheRedButton_Click" />
I want to locate DoNotPressTheRedButton_Click
in another source file.
ButtonMethods.cs
and then use it in my Page from XAML
MyPage.xaml
What do I need to write in XAML in order to do this?
I thought I need:
xmlns:helpermethods="using:CoreProject.HelperMethods"
then,
<Button x:Name="TheRedButton" Click="helpermethods:ButtonMethods.DoNotPressTheRedButton_Click" />
But I'm getting compiler errors... CS1002 and CS1513. So obviously it's not the right syntax. Is this even possible?