private void bfc_Loaded(object sender, RoutedEventArgs e) { _boundedClient = GetBoundedByflyClient(); dpdBalanceLabel.AddValueChanged(balanceLabel, (object a, EventArgs b) => { try { if (!string.IsNullOrEmpty((string)(a as Label).Content)) { ControlState = State.Logged; } } catch { } }); dpdErrorTextBlock.AddValueChanged(errorTbl, (object a, EventArgs b) => { try { if (!string.IsNullOrEmpty((a as TextBlock).Text)) { if (_boundedClient.IsBlocked) { ControlState = State.BlockError; } else { ControlState = State.Error; } } else if (ControlState == State.Error || ControlState == State.BlockError) { ControlState = State.Login; } } catch { } }); ControlState = State.Login; }
private void bfc_Loaded(object sender, RoutedEventArgs e) { _boundedClient = GetBoundedByflyClient(); dpdBalanceLabel.AddValueChanged(balanceLabel, (object a, EventArgs b) => { try { if (!string.IsNullOrEmpty((string)(a as Label).Content)) ControlState = State.Logged; } catch { } }); dpdErrorTextBlock.AddValueChanged(errorTbl, (object a, EventArgs b) => { try { if (!string.IsNullOrEmpty((a as TextBlock).Text)) { if (_boundedClient.IsBlocked) ControlState = State.BlockError; else ControlState = State.Error; } else if (ControlState == State.Error || ControlState == State.BlockError) ControlState = State.Login; } catch { } }); ControlState = State.Login; }