using System; using System.Runtime.InteropServices; using System.Windows; using Tetris.ViewsModels; namespace Tetris.Views; /// /// Interaction logic for MainWindow.xaml /// public partial class MainWindow : Window { public MainWindow() { AttachConsole(-1); DataContext = new ViewModel(); InitializeComponent(); } [DllImport("kernel32.dll")] private static extern bool AttachConsole(int dwProcessId); private void StartButton_OnClick(object sender, RoutedEventArgs e) { Console.WriteLine("Start game..."); new GameWindow().Show(); Close(); } }