-1
어떻게이 작업을 수행 할 수 있습니까? xaml을 사용하여 이것을 구현할 수 있었고 그렇게 할 수있었습니다. 대신 ViewModel
패턴을 사용하면 어떻게됩니까?Xamarin Forms. 버튼을 클릭 한 후 ViewModel에서 뷰로드
View.xaml
<Button Margin="50,0,20,20" FontSize="Large" Text="Test" Clicked="Button_Clicked">
</Button>
View.cs XAML 명령 속성을 사용하여 바인딩에서
private void Button_Clicked(object sender, EventArgs e)
{
Get_LessonViewAsync();
}
private async void Get_LessonViewAsync()
{
var view = new LessonView();
await Navigation.PushModalAsync(view);
}
감사합니다. 만약 내가 ICommand 인터페이스를 구현했다. 마찬가지로 public void Execute (object parameter) {} 어떻게 명령이 실행되었는지 알 수 있습니까? – user2202098
질문이 맞다면 각 명령마다 하나의 Property를가집니다. –