public MainWindow() { InitializeComponent(); ConnectionManager.Instance.onControllerConnectionEstalblishResult += OnControllerConnectionEstablishResult; ConnectionManager.Instance.onControllerConnectionReceiveMessage += OnControllerConnectionReceiveMessage; DebugBackend.DebugBackend.Instance.OnServerFailed += OnDebugServerFailed; DebugBackend.DebugBackend.Instance.OnServerStart += OnDebugServerStart; DebugBackend.DebugBackend.Instance.OnReceiveSendRequest += OnReceiveSendRequest; BluetoothManager bluetoothManager = BluetoothManager.Instance; bluetoothServerConnection = bluetoothManager.CreateRfcommServerConnection(Guid.Parse("14c5449a-6267-4c7e-bd10-63dd79740e5" + 0)); ConnectionManager.Instance.ControllerConnection = bluetoothServerConnection; Timer startServerTimer = new Timer(5000); startServerTimer.Elapsed += OnStartTimerElapsed; startServerTimer.Start(); DebugBackend.DebugBackend.Instance.StartBackend(8083); img_QR.Source = bluetoothServerConnection.GetQRCode().ToBitmapImage(); tb_Mac.Text = bluetoothServerConnection.ConnectCode; }