示例#1
0
        public MainPage()
        {
            this.InitializeComponent();
            App.Current.Suspending += App_Suspending;
            dataRegister            = new DataRegister()
                                      .SetConditionFontIcon(ref ConditionIcon)
                                      .SetConditionFontIcon2(ref ConditionIcon2)
                                      .SetConditionTextBox(ref ConditionData)
                                      .SetPulseTextBox(ref PulseData)
                                      .SetSPO2TextBox(ref SPO2Data)
                                      .SetTempTextBox(ref TempData)
                                      .SetLocationTextBox(ref LocationData);

            communicator = new BluetoothCommunicator(guid, ref dataRegister);


            communicator.SetOnDisconnect(
                () => {
                isConnected = false;
                ConnectDeviceButton.Content = "Connect to Selected Device";
                return(true);
            }
                );

            communicator.SetOnReconnect(
                () => {
                isConnected = true;
                ResetMainUI();
                ConnectDeviceButton.Content = "Disconnected from Device";
                return(true);
            }
                );
            isConnected = false;
        }
 public BluetoothCommunicator(Guid guid, ref DataRegister dataRegister)
 {
     //
     this.guid         = guid;
     this.dataRegister = dataRegister;
 }