다음 C# 코드를 VB로 변환하려고합니다. 시도한 온라인 변환 페이지의 결과는 나에게 의미가 없으며 VS2010은 결함으로 표시됩니다.특정 C#에서 VB 로의 변환 문제
public interface IRequestCloseViewModel
{
event EventHandler RequestClose
}
그리고이 기본 클래스에서 사용됩니다 :
public class ApplicationWindowBase : Window
{
public ApplicationWindowBase()
{
this.DataContextChanged += new DependencyPropertyChangedEventHandler(this.OnDataContextChanged);
}
private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
if (e.NewValue is IRequestCloseViewModel)
{
// if the new datacontext supports the IRequestCloseViewModel we can use
// the event to be notified when the associated viewmodel wants to close
// the window
((IRequestCloseViewModel)e.NewValue).RequestClose += (s, e) => this.Close();
}
}
}
이벤트에 대한 내 제한 C#을 지식
MVVM 샘플은이 인터페이스를 사용하여 ...이 일을 해결하는 것만으로는 충분하지 않습니다
올바른 VB .NET 번역은 어떤 모양입니까?
당신은 온라인 변환 도구가 생성 한 코드를 공유 할 수 있습니까? –