mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-26 02:54:20 +01:00
Moved right click disconnect method to View Model
This commit is contained in:
parent
c4cdade076
commit
c865e3c9b2
@ -705,19 +705,7 @@ Properties.Resources.DS4Update, MessageBoxButton.YesNo, MessageBoxImage.Question
|
||||
private void ContStatusImg_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
CompositeDeviceModel item = conLvViewModel.CurrentItem;
|
||||
DS4Device tempDev = item.Device;
|
||||
if (tempDev.Synced && !tempDev.Charging)
|
||||
{
|
||||
if (tempDev.ConnectionType == ConnectionType.BT)
|
||||
{
|
||||
//tempDev.StopUpdate();
|
||||
tempDev.DisconnectBT();
|
||||
}
|
||||
else if (tempDev.ConnectionType == ConnectionType.SONYWA)
|
||||
{
|
||||
tempDev.DisconnectDongle();
|
||||
}
|
||||
}
|
||||
item.RequestDisconnect();
|
||||
}
|
||||
|
||||
private void ExportLogBtn_Click(object sender, RoutedEventArgs e)
|
||||
|
@ -405,5 +405,21 @@ namespace DS4WinWPF.DS4Forms.ViewModels
|
||||
SelectedIndex = profileListHolder.ProfileListCol.IndexOf(temp);
|
||||
}
|
||||
}
|
||||
|
||||
public void RequestDisconnect()
|
||||
{
|
||||
if (device.Synced && !device.Charging)
|
||||
{
|
||||
if (device.ConnectionType == ConnectionType.BT)
|
||||
{
|
||||
//device.StopUpdate();
|
||||
device.DisconnectBT();
|
||||
}
|
||||
else if (device.ConnectionType == ConnectionType.SONYWA)
|
||||
{
|
||||
device.DisconnectDongle();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user