|
120 | 120 | <TextBlock Grid.Row="2" Foreground="{DynamicResource AccentColorBrush}" Text="{Binding StatusMessage}" Visibility="{Binding DisplayStatusMessage, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{DynamicResource DefaultTextBlock}" Margin="0,10,0,0" /> |
121 | 121 | </Grid> |
122 | 122 | <TextBlock Grid.Row="2" Text="{DynamicResource String_Header_Status}" Style="{StaticResource HeaderTextBlock}" /> |
123 | | - <Control:ScrollingDataGrid Grid.Row="3" ItemsSource="{Binding PingResultView}"> |
| 123 | + <Control:ScrollingDataGrid Grid.Row="3" ItemsSource="{Binding PingResultView}" SelectedItem="{Binding SelectedPingResult}"> |
124 | 124 | <Control:ScrollingDataGrid.Resources> |
125 | 125 | <Style TargetType="{x:Type ScrollBar}" BasedOn="{StaticResource ScrollingDataGridScrollBar}" /> |
| 126 | + <ContextMenu x:Key="RowContextMenu" Opened="ContextMenu_Opened" MinWidth="150"> |
| 127 | + <MenuItem Header="{DynamicResource String_CopyDots}"> |
| 128 | + <MenuItem.Icon> |
| 129 | + <Rectangle Width="16" Height="16" Fill="{DynamicResource BlackColorBrush}"> |
| 130 | + <Rectangle.OpacityMask> |
| 131 | + <VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=ContentCopy}" /> |
| 132 | + </Rectangle.OpacityMask> |
| 133 | + </Rectangle> |
| 134 | + </MenuItem.Icon> |
| 135 | + <MenuItem Header="{DynamicResource String_Timestamp}" Command="{Binding CopySelectedTimestampCommand}"> |
| 136 | + <MenuItem.Icon> |
| 137 | + <Rectangle Width="16" Height="16" Fill="{DynamicResource BlackColorBrush}"> |
| 138 | + <Rectangle.OpacityMask> |
| 139 | + <VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=ContentCopy}" /> |
| 140 | + </Rectangle.OpacityMask> |
| 141 | + </Rectangle> |
| 142 | + </MenuItem.Icon> |
| 143 | + </MenuItem> |
| 144 | + <MenuItem Header="{DynamicResource String_IPAddress}" Command="{Binding CopySelectedIPAddressCommand}"> |
| 145 | + <MenuItem.Icon> |
| 146 | + <Rectangle Width="16" Height="16" Fill="{DynamicResource BlackColorBrush}"> |
| 147 | + <Rectangle.OpacityMask> |
| 148 | + <VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=ContentCopy}" /> |
| 149 | + </Rectangle.OpacityMask> |
| 150 | + </Rectangle> |
| 151 | + </MenuItem.Icon> |
| 152 | + </MenuItem> |
| 153 | + <MenuItem Header="{DynamicResource String_Hostname}" Command="{Binding CopySelectedHostnameCommand}"> |
| 154 | + <MenuItem.Icon> |
| 155 | + <Rectangle Width="16" Height="16" Fill="{DynamicResource BlackColorBrush}"> |
| 156 | + <Rectangle.OpacityMask> |
| 157 | + <VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=ContentCopy}" /> |
| 158 | + </Rectangle.OpacityMask> |
| 159 | + </Rectangle> |
| 160 | + </MenuItem.Icon> |
| 161 | + </MenuItem> |
| 162 | + <MenuItem Header="{DynamicResource String_Bytes}" Command="{Binding CopySelectedBytesCommand}"> |
| 163 | + <MenuItem.Icon> |
| 164 | + <Rectangle Width="16" Height="16" Fill="{DynamicResource BlackColorBrush}"> |
| 165 | + <Rectangle.OpacityMask> |
| 166 | + <VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=ContentCopy}" /> |
| 167 | + </Rectangle.OpacityMask> |
| 168 | + </Rectangle> |
| 169 | + </MenuItem.Icon> |
| 170 | + </MenuItem> |
| 171 | + <MenuItem Header="{DynamicResource String_Time}" Command="{Binding CopySelectedTimeCommand}"> |
| 172 | + <MenuItem.Icon> |
| 173 | + <Rectangle Width="16" Height="16" Fill="{DynamicResource BlackColorBrush}"> |
| 174 | + <Rectangle.OpacityMask> |
| 175 | + <VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=ContentCopy}" /> |
| 176 | + </Rectangle.OpacityMask> |
| 177 | + </Rectangle> |
| 178 | + </MenuItem.Icon> |
| 179 | + </MenuItem> |
| 180 | + <MenuItem Header="{DynamicResource String_TTL}" Command="{Binding CopySelectedTTLCommand}"> |
| 181 | + <MenuItem.Icon> |
| 182 | + <Rectangle Width="16" Height="16" Fill="{DynamicResource BlackColorBrush}"> |
| 183 | + <Rectangle.OpacityMask> |
| 184 | + <VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=ContentCopy}" /> |
| 185 | + </Rectangle.OpacityMask> |
| 186 | + </Rectangle> |
| 187 | + </MenuItem.Icon> |
| 188 | + </MenuItem> |
| 189 | + <MenuItem Header="{DynamicResource String_Status}" Command="{Binding CopySelectedStatusCommand}"> |
| 190 | + <MenuItem.Icon> |
| 191 | + <Rectangle Width="16" Height="16" Fill="{DynamicResource BlackColorBrush}"> |
| 192 | + <Rectangle.OpacityMask> |
| 193 | + <VisualBrush Stretch="Uniform" Visual="{IconPacks:Material Kind=ContentCopy}" /> |
| 194 | + </Rectangle.OpacityMask> |
| 195 | + </Rectangle> |
| 196 | + </MenuItem.Icon> |
| 197 | + </MenuItem> |
| 198 | + </MenuItem> |
| 199 | + </ContextMenu> |
126 | 200 | </Control:ScrollingDataGrid.Resources> |
127 | 201 | <Control:ScrollingDataGrid.Columns> |
128 | | - <DataGridTextColumn Header="Timestamp" Binding="{Binding Timestamp}" MinWidth="180" /> |
| 202 | + <DataGridTextColumn Header="{DynamicResource String_Timestamp}" Binding="{Binding Timestamp}" MinWidth="180" /> |
129 | 203 | <DataGridTextColumn Header="{DynamicResource String_IPAddress}" Binding="{Binding IPAddress}" MinWidth="150" /> |
130 | 204 | <DataGridTextColumn Header="{DynamicResource String_Hostname}" Binding="{Binding Hostname}" MinWidth="150" /> |
131 | 205 | <DataGridTextColumn Header="{DynamicResource String_Bytes}" Binding="{Binding Bytes, Converter={StaticResource IntToStringConverter}}" MinWidth="80" /> |
|
140 | 214 | <DataGridTextColumn Header="{DynamicResource String_TTL}" Binding="{Binding TTL, Converter={StaticResource IntToStringConverter}}" MinWidth="80"/> |
141 | 215 | <DataGridTextColumn Header="{DynamicResource String_Status}" Binding="{Binding Status, Converter={StaticResource IPStatusToStringConverter}}" MinWidth="150" Width="*" /> |
142 | 216 | </Control:ScrollingDataGrid.Columns> |
| 217 | + <Control:ScrollingDataGrid.RowStyle> |
| 218 | + <Style TargetType="{x:Type DataGridRow}" BasedOn="{StaticResource MetroDataGridRow}"> |
| 219 | + <Style.Triggers> |
| 220 | + <DataTrigger Binding="{Binding SelectedItems.Count, RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type DataGrid}}}" Value="1" > |
| 221 | + <Setter Property="ContextMenu" Value="{StaticResource RowContextMenu}"/> |
| 222 | + </DataTrigger> |
| 223 | + </Style.Triggers> |
| 224 | + </Style> |
| 225 | + </Control:ScrollingDataGrid.RowStyle> |
143 | 226 | </Control:ScrollingDataGrid> |
144 | 227 | <Expander Grid.Row="4" IsExpanded="{Binding ExpandStatistics}" Visibility="{Binding ShowStatistics, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource HeaderExpander}" Margin="0,20,0,0"> |
145 | 228 | <Expander.Header> |
|
0 commit comments