Skip to content

Commit

Permalink
Fixed drop-down list for selecting devices connected to the PC
Browse files Browse the repository at this point in the history
  • Loading branch information
TTLC198 committed Nov 11, 2023
1 parent c37c237 commit 85d590c
Showing 1 changed file with 37 additions and 14 deletions.
51 changes: 37 additions & 14 deletions HSMonitor/Views/Settings/ConnectionSettingsTabView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,42 @@
<TextBlock
Text="{x:Static p:Resources.SerialPortText}"
VerticalAlignment="Center"/>
<Grid
Grid.Row="1">
<ComboBox
ItemsSource="{Binding AvailablePorts}"
SelectedValue="{Binding SelectedPort, Mode=TwoWay}"
materialDesign:ComboBoxAssist.ShowSelectedItem="True">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock
Text="{Binding }"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<ComboBox
Grid.Row="1"
ItemsSource="{Binding AvailablePorts}"
SelectedValue="{Binding SelectedDevice, Mode=TwoWay}"
materialDesign:ComboBoxAssist.ShowSelectedItem="True"
DropDownOpened="{s:Action UpdateAvailablePorts}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock>
<Run
Text="{Binding PortName}"/>
<Run
Text=" - "/>
<Run
Text="{Binding BusDescription}"/>
<TextBlock.Resources>
<Style
TargetType="{x:Type TextBlock}">
<Style.Triggers>
<DataTrigger
Binding="{Binding IsHsMonitorDevice}"
Value="True">
<Setter
Property="FontWeight"
Value="Bold"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Resources>
</TextBlock>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<!--<Grid
>
<DockPanel
LastChildFill="False"
Margin="0, 0, 10, 0">
Expand All @@ -58,7 +81,7 @@
Kind="Refresh" />
</Button>
</DockPanel>
</Grid>
</Grid>-->
</Grid>
<!--Select Baud Rate-->
<Grid
Expand Down

0 comments on commit 85d590c

Please sign in to comment.