frame logic visualized in mainWindow.xaml.cs