private void SlideCommandHandler(object parameter) { Reveal.Stop(); Hide.Stop(); if (parameter is bool) { if (!_shouldShow) { Hide.Begin(); _shouldShow = true; } return; } if (_shouldShow) { Reveal.Begin(); } else { Hide.Begin(); } _shouldShow = !_shouldShow; }
private void Hide_Completed(object sender, object e) { if (gloablvalue.DeviceState == "-2") { Show.Stop(); Hide.Stop(); Devicestate_txt.Text = "An error occurred, try again."; ConnectBTN.Content = "connect"; ConnectBTN.Tag = "connect"; ConnectBTN.IsEnabled = true; gloablvalue.DeviceState = "-1"; } else if (gloablvalue.DeviceState == "-1") { Show.Begin(); } else if (gloablvalue.DeviceState == "0") { BTImg.Opacity = 1; Show.Stop(); Hide.Stop(); Devicestate_txt.Text = "' " + gloablvalue.DeviceName + " ' " + " Dissconnected"; ConnectBTN.Content = "connect"; ConnectBTN.Tag = "connect"; ConnectBTN.IsEnabled = true; gloablvalue.DeviceState = "-1"; } else if (gloablvalue.DeviceState == "1") { Show.Stop(); Hide.Stop(); Devicestate_txt.Text = "' " + gloablvalue.DeviceName + " ' " + " Connected"; ConnectBTN.Content = "Dissconnect"; ConnectBTN.Tag = "Dissconnect"; ConnectBTN.IsEnabled = true; //await BluetoothConnection.SendCommand("*"); newrec_txt.Text = gloablvalue.checksend(gloablvalue.RecivedText); } else if (gloablvalue.DeviceState == "2") { Show.Stop(); Hide.Stop(); Devicestate_txt.Text = "' " + gloablvalue.DeviceName + " ' " + " Bluetooth device not found, try again."; ConnectBTN.Content = "connect"; ConnectBTN.Tag = "connect"; ConnectBTN.IsEnabled = true; gloablvalue.DeviceState = "-1"; } else if (gloablvalue.DeviceState == "3") { Show.Stop(); Hide.Stop(); Devicestate_txt.Text = "Not found any device paired, try again."; ConnectBTN.Content = "connect"; ConnectBTN.Tag = "connect"; ConnectBTN.IsEnabled = true; gloablvalue.DeviceState = "-1"; } }