private void l_profiles_ItemClick(object sender, ItemClickEventArgs e) { TClientProfile profile = (TClientProfile)e.ClickedItem; if (profile.State == ConnectionState.Disconnected) { Task.Run(() => client.ConnectAsync(profile.LastIPAddress)); } }
private void b_disconnect_Click(object sender, RoutedEventArgs e) { TClientProfile selected = (TClientProfile)l_profiles.SelectedItem; if (selected.State == ConnectionState.Connected || selected.State == ConnectionState.LackOfResponse) { client.Close(selected); } appbar.IsOpen = false; }
private async void b_connect_Click(object sender, RoutedEventArgs e) { TClientProfile selected = (TClientProfile)l_profiles.SelectedItem; b_connect.IsEnabled = false; await client.CancelScanningAsync(); if (selected.State == ConnectionState.Disconnected) { await client.ConnectAsync(selected.LastIPAddress); } appbar.IsOpen = false; b_connect.IsEnabled = true; }