using System.Windows.Controls; namespace InfineonHMI; /// /// Interaktionslogik für AutomaticModePage.xaml /// public partial class NIOStationPage : Page { public NIOStationPage() { InitializeComponent(); // Unloaded += OnUnloaded; } private void OnUnloaded(object? sender, EventArgs e) { var disposable = DataContext as IDisposable; disposable?.Dispose(); } }