public MainWindow() { InitializeComponent(); i = new Image(); RenderOptions.SetBitmapScalingMode(i, BitmapScalingMode.NearestNeighbor); RenderOptions.SetEdgeMode(i, EdgeMode.Aliased); w = this; w.Content = i; w.Show(); _game = new GameOfLife.GameOfLife(); _game.Init(); writeableBitmap = new WriteableBitmap( _game.Size, _game.Size, 96, 96, PixelFormats.Bgr32, null); i.Source = writeableBitmap; i.Stretch = Stretch.Uniform; i.HorizontalAlignment = HorizontalAlignment.Left; i.VerticalAlignment = VerticalAlignment.Top; Display(_game); SetTimer(this); //this.KeyUp += MainWindow_KeyUp; //i.MouseMove += new MouseEventHandler(i_MouseMove); //i.MouseLeftButtonDown += // new MouseButtonEventHandler(i_MouseLeftButtonDown); //i.MouseRightButtonDown += // new MouseButtonEventHandler(i_MouseRightButtonDown); //w.MouseWheel += new MouseWheelEventHandler(w_MouseWheel); }
static void Main(string[] args) { GameOfLife game = new GameOfLife(new Cell[24, 24]); game.Init(); Console.ReadKey(); }