Wie rufe ich die Methode in XAML aus dem Mainwindow auf?

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Wie rufe ich die Methode in XAML aus dem Mainwindow auf?

by Anonymous » 17 Aug 2025, 08:08

Ich versuche, eine Methode in MainWindow.xaml von MainWindow.xaml.cs zu nennen.
xmlns="http://schemas.microsoft.com/winfx/2006 ... esentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/marku ... ility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Example"
mc:Ignorable="d">




< /code>

public partial class Example : Page
{
public Example()
{
InitializeComponent();
}

public void MethodIWantToCall()
{
//Body
}
}
< /code>

Of course when i run the code and press Ctrl+E nothing will happen.
If i put the Method in other class it will work, but in my situation i need that to be this Page which the xaml is behind.

Top