|
5 | 5 | xmlns:conv="clr-namespace:SignalGoTest.Desktop.Converters" |
6 | 6 | xmlns:types="clr-namespace:SignalGo.Shared.Helpers;assembly=SignalGo.Shared" |
7 | 7 | xmlns:viewmodels="clr-namespace:SignalGoTest.ViewModels;assembly=SignalGoTest.ViewModels"> |
8 | | - <UserControl.DataContext> |
| 8 | + <UserControl.Resources> |
| 9 | + <viewmodels:ConnectionInfoViewModel x:Key="ConnectionInfoViewModel"/> |
| 10 | + </UserControl.Resources> |
| 11 | + <!--<UserControl.DataContext> |
9 | 12 | <viewmodels:ConnectionInfoViewModel /> |
10 | | - </UserControl.DataContext> |
11 | | - <local:BusyDialogView IsBusy="{Binding IsBusy}" IsAlert="{Binding IsAlert}" Message="{Binding BusyContent}"> |
| 13 | + </UserControl.DataContext>--> |
| 14 | + <local:BusyDialogView DataContext="{StaticResource ConnectionInfoViewModel}" IsBusy="{Binding IsBusy}" IsAlert="{Binding IsAlert}" Message="{Binding BusyContent}"> |
12 | 15 | <local:BusyDialogView.Child> |
13 | 16 | <Grid Margin="10"> |
14 | 17 | <Grid.RowDefinitions> |
|
21 | 24 | <StackPanel Orientation="Horizontal" Margin="0,5,0,0"> |
22 | 25 | <Button Command="{Binding ConnectCommand}" Content="Connect" /> |
23 | 26 | <Button x:Name="btndisconnect" Command="{Binding DisconnectCommand}" IsEnabled="False" Content="Disconncet" Margin="5,0,0,0"/> |
24 | | - <Button x:Name="btnHtttpUpdate" Content="Http Update" Margin="5,0,0,0"/> |
| 27 | + <Button x:Name="btnHtttpUpdate" Command="{Binding HttpUpdateCommand}" Content="Http Update" Margin="5,0,0,0"/> |
25 | 28 | <Button x:Name="btnSave" Command="{Binding SaveCommand}" Content="Save" Margin="5,0,0,0"/> |
26 | 29 | </StackPanel> |
27 | 30 | </StackPanel> |
|
44 | 47 | <TextBox x:Name="txtSearch"> |
45 | 48 |
|
46 | 49 | </TextBox> |
47 | | - <TreeView x:Name="TreeViewServices" BorderThickness="1" Background="White" Margin="0,5,0,0" DataContext="{Binding CurrentConnectionInfo}" Items="{Binding ItemsSource}" Grid.Row="1"> |
| 50 | + <TreeView x:Name="TreeViewServices" BorderThickness="1" Background="White" Margin="0,5,0,0" Items="{Binding CurrentConnectionInfo.ItemsSource}" SelectedItem="{Binding SelectedTreeItem}" Grid.Row="1"> |
48 | 51 | <TreeView.DataTemplates> |
49 | 52 | <TreeDataTemplate DataType="{x:Type self:ServiceDetailsInterface}" ItemsSource="{Binding Methods}"> |
50 | 53 | <StackPanel Orientation="Horizontal"> |
|
139 | 142 | <TextBox x:Name="newRequestName" Text=""/> |
140 | 143 | <Button x:Name="btnAddRequest" Content="Add" Grid.Column="1"/> |
141 | 144 | </Grid> |
142 | | - <ListBox x:Name="lstRequests" Grid.Row="1" SelectedIndex="0" Items="{Binding SelectedItem.Requests,ElementName=TreeViewServices}"> |
| 145 | + <ListBox x:Name="lstRequests" Grid.Row="1" Items="{Binding SelectedItem.Requests,ElementName=TreeViewServices}" SelectedItem="{Binding ServiceDetailsRequestInfo,Mode=OneWayToSource}" SelectedIndex="0"> |
143 | 146 | <ListBox.ItemTemplate> |
144 | 147 | <DataTemplate> |
145 | 148 | <Grid> |
|
345 | 348 | </ContentControl> |
346 | 349 | </TabItem> |
347 | 350 | <TabItem Header="Request"> |
348 | | - <Grid> |
| 351 | + <Grid IsEnabled="{Binding IsRequestSelected}"> |
349 | 352 | <Grid.RowDefinitions> |
350 | 353 | <RowDefinition Height="auto"/> |
351 | 354 | <RowDefinition Height="*"/> |
|
356 | 359 | </Grid.RowDefinitions> |
357 | 360 |
|
358 | 361 | <TextBlock Text="Request Values:"/> |
| 362 | + <ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Disabled"> |
| 363 | + <ItemsControl DataContext="{Binding ElementName=lstRequests,Path=SelectedItem}" Items="{Binding Parameters}" Margin="0,5,0,0"> |
| 364 | + <ItemsControl.ItemTemplate> |
| 365 | + <DataTemplate> |
| 366 | + <Grid Margin="5"> |
| 367 | + <Grid.ColumnDefinitions> |
| 368 | + <ColumnDefinition Width="auto"/> |
| 369 | + <ColumnDefinition Width="*"/> |
| 370 | + </Grid.ColumnDefinitions> |
| 371 | + <StackPanel x:Name="mainStack" Margin="5" Orientation="Horizontal"> |
| 372 | + <TextBlock VerticalAlignment="Center" Text="{Binding Name}"/> |
| 373 | + <TextBlock VerticalAlignment="Center" Text=":"/> |
| 374 | + <Button Margin="5,0,0,0" VerticalAlignment="Center" Content="Simple Template" DataContext="{DynamicResource ConnectionInfoViewModel}" Command="{Binding LoadSimpleTemplateCommand}" CommandParameter="{Binding DataContext,ElementName=mainStack}" /> |
| 375 | + <Button Margin="5,0,0,0" VerticalAlignment="Center" Content="Full Template" DataContext="{DynamicResource ConnectionInfoViewModel}" Command="{Binding LoadFullTemplateCommand}" CommandParameter="{Binding DataContext,ElementName=mainStack}"/> |
| 376 | + </StackPanel> |
| 377 | + <TextBox Grid.Column="1" Text="{Binding Value}" AcceptsReturn="True" TextWrapping="Wrap"/> |
| 378 | + </Grid> |
| 379 | + </DataTemplate> |
| 380 | + </ItemsControl.ItemTemplate> |
| 381 | + </ItemsControl> |
| 382 | + </ScrollViewer> |
| 383 | + |
359 | 384 | <!--<DataGrid x:Name="DGRequestValues" ScrollViewer.CanContentScroll="False" AutoGenerateColumns="False" CanUserAddRows="False" DataContext="{Binding ElementName=lstRequests,Path=SelectedItem}" ItemsSource="{Binding Parameters}" Margin="0,5,0,0" Grid.Row="1" HeadersVisibility="Column"> |
360 | 385 | <DataGrid.Columns> |
361 | 386 | <DataGridTextColumn Header="Name" IsReadOnly="True" Binding="{Binding Name}"/> |
|
405 | 430 | <ColumnDefinition Width="auto"/> |
406 | 431 | <ColumnDefinition Width="auto"/> |
407 | 432 | </Grid.ColumnDefinitions> |
408 | | - <Button x:Name="btnSend" Content="Send" Padding="10,0,10,0" Margin="0,5,0,0" /> |
| 433 | + <Button x:Name="btnSend" DataContext="{DynamicResource ConnectionInfoViewModel}" Command="{Binding SendCommand}" Content="Send" Padding="10,0,10,0" Margin="0,5,0,0" /> |
409 | 434 | <Button Grid.Column="1" x:Name="btnAttachment" Content="Attach File (0)" Padding="10,0,10,0" Margin="10,5,0,0" /> |
410 | 435 | <Button Grid.Column="2" x:Name="btnRemoveAttachment" Content="Remove Attachment" Padding="10,0,10,0" Margin="10,5,0,0" /> |
411 | 436 | </Grid> |
|
415 | 440 | <TextBlock Text="Comming soon!"/> |
416 | 441 | </TabItem>--> |
417 | 442 | <TabItem x:Name="rawDataTab" Header="Raw Data"> |
418 | | - <TextBox x:Name="txtReponse" Margin="0,5,0,0" AcceptsReturn="True" TextWrapping="Wrap"/> |
| 443 | + <TextBox x:Name="txtReponse" Text="{Binding ServiceDetailsRequestInfo.Response}" Margin="0,5,0,0" AcceptsReturn="True" TextWrapping="Wrap"/> |
419 | 444 | </TabItem> |
420 | 445 | </TabControl> |
421 | 446 | <Button x:Name="btnToString" Content="ToString" Height="23" Padding="10,0,10,0" Margin="0,5,0,0" Grid.Row="5"/> |
|
0 commit comments