Disable Controller Readings tab when not associated with a controller and profile

Related to issue #1070
This commit is contained in:
Travis Nickles 2020-03-15 00:58:29 -05:00
parent 90f5a1b5d7
commit a51d789177
2 changed files with 3 additions and 1 deletions

View File

@ -323,7 +323,7 @@
</DockPanel> </DockPanel>
</DockPanel> </DockPanel>
</TabItem> </TabItem>
<TabItem x:Name="contReadingsTab" Header="Controller Readings"> <TabItem x:Name="contReadingsTab" Header="Controller Readings" IsEnabled="False">
<local:ControllerReadingsControl x:Name="conReadingsUserCon" /> <local:ControllerReadingsControl x:Name="conReadingsUserCon" />
</TabItem> </TabItem>
</TabControl> </TabControl>

View File

@ -539,11 +539,13 @@ namespace DS4WinWPF.DS4Forms
{ {
useControllerUD.Value = device + 1; useControllerUD.Value = device + 1;
conReadingsUserCon.UseDevice(device); conReadingsUserCon.UseDevice(device);
contReadingsTab.IsEnabled = true;
} }
else else
{ {
useControllerUD.Value = 1; useControllerUD.Value = 1;
conReadingsUserCon.UseDevice(0); conReadingsUserCon.UseDevice(0);
contReadingsTab.IsEnabled = false;
} }
conReadingsUserCon.EnableControl(false); conReadingsUserCon.EnableControl(false);