static void Main(string[] args) { brick = new ConnectToBrick(); brick.Connect(); brick.brick.BrickChanged += EventCalled; Console.ReadLine(); }
public MainWindow() { InitializeComponent(); brick = new ConnectToBrick(); // connecting to brick method. brick.Connect(); this.DataContext = brick; }