Я пытаюсь вызвать метод в mainwindow.xaml из mainwindow.xaml.cs.
Я не могу найти нигде, как это будет работать.
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.
Подробнее здесь: https://stackoverflow.com/questions/614 ... mainwindow
Как позвонить в метод в XAML из MainWindow? ⇐ C#
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Как использовать несколько вспомогательных файлов xaml с MainWindow.xaml в WinUI3
Anonymous » » в форуме C# - 0 Ответы
- 148 Просмотры
-
Последнее сообщение Anonymous
-