MainWindow.xaml 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <Window x:Class="FestoDebugger.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:FestoDebugger"
  7. xmlns:UserControls="clr-namespace:FestoDebugger.UserControls"
  8. xmlns:prism="http://prismlibrary.com/"
  9. xmlns:local1="clr-namespace:FestoDebugger.ViewModels"
  10. mc:Ignorable="d"
  11. Title="FestoDebuger" Height="450" Width="800">
  12. <Window.DataContext>
  13. <local1:MainViewModel />
  14. </Window.DataContext>
  15. <Canvas>
  16. <Grid Height="40" Width="700" Margin="10,10,0,0" Panel.ZIndex="1">
  17. <Grid.RowDefinitions>
  18. <RowDefinition Height="30"/>
  19. </Grid.RowDefinitions>
  20. <Grid.ColumnDefinitions>
  21. <ColumnDefinition Width="50"/>
  22. <ColumnDefinition Width="100"/>
  23. <ColumnDefinition Width="50"/>
  24. <ColumnDefinition Width="50"/>
  25. <ColumnDefinition Width="100"/>
  26. <ColumnDefinition Width="100"/>
  27. </Grid.ColumnDefinitions>
  28. <!-- IP地址输入 -->
  29. <TextBlock Text="IP地址:"
  30. Grid.Row="0" Grid.Column="0"
  31. VerticalAlignment="Center"/>
  32. <TextBox x:Name="IpTextBox"
  33. Grid.Row="0" Grid.Column="1"
  34. Text="{Binding IpAddress, UpdateSourceTrigger=PropertyChanged}"
  35. VerticalContentAlignment="Center" TextChanged="IpTextBox_TextChanged"/>
  36. <!-- 端口输入 -->
  37. <TextBlock Text="端口:"
  38. Grid.Row="0" Grid.Column="2"
  39. Margin="10,0,0,0"
  40. VerticalAlignment="Center"/>
  41. <TextBox x:Name="PortTextBox"
  42. Grid.Row="0" Grid.Column="3"
  43. Margin="0,0,0,0"
  44. Text="{Binding Port, UpdateSourceTrigger=PropertyChanged}"
  45. VerticalContentAlignment="Center"/>
  46. <!-- 连接按钮 -->
  47. <Button Content="Connect" Width="70"
  48. Margin="10,0,0,0"
  49. Grid.Row="0" Grid.Column="4"
  50. Command="{Binding ConnectCommand}"
  51. IsEnabled="{Binding IsNotConnecting}"/>
  52. <TextBlock Text="{Binding ConnectionStatus}"
  53. Grid.Row="0" Grid.Column="5"
  54. Margin="10,10,0,0"
  55. Foreground="{Binding StatusColor}"
  56. HorizontalAlignment="Center"/>
  57. </Grid>
  58. <ScrollViewer Height="450" Width="800">
  59. <ItemsControl ItemsSource="{Binding SignalModuleDatas}">
  60. <ItemsControl.ItemsPanel>
  61. <ItemsPanelTemplate>
  62. <WrapPanel Orientation="Horizontal" Margin="20,50,20,0"/>
  63. </ItemsPanelTemplate>
  64. </ItemsControl.ItemsPanel>
  65. <ItemsControl.ItemTemplate>
  66. <DataTemplate>
  67. <UserControls:FestoControl />
  68. </DataTemplate>
  69. </ItemsControl.ItemTemplate>
  70. </ItemsControl>
  71. </ScrollViewer>
  72. </Canvas>
  73. </Window>