DataSourceView.xaml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <UserControl x:Class="Aitex.UI.Charting.View.DataSourceView"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. mc:Ignorable="d" d:DesignHeight="346" d:DesignWidth="687">
  7. <UserControl.Resources>
  8. <Style TargetType="{x:Type Label}">
  9. <Setter Property="Foreground" Value="Black"/>
  10. <Setter Property="FontSize" Value="12"/>
  11. </Style>
  12. </UserControl.Resources>
  13. <Grid>
  14. <Grid.RowDefinitions>
  15. <RowDefinition Height="25" />
  16. <RowDefinition Height="256*" />
  17. </Grid.RowDefinitions>
  18. <StackPanel Name="TopView_TopToolbar" Grid.Row="0" Background="#FFF0F0F0" Orientation="Horizontal">
  19. <Button Height="23" HorizontalAlignment="Left" VerticalAlignment="Top" Width="110" Command="{Binding CommonViewModel.Switch2DataDisplayViewCommand}" Margin="1,0,0,0">
  20. <Button.Content>
  21. <StackPanel Orientation="Horizontal">
  22. <Image Source="/DataAnalysisControl;component/Charting/Images/Chart.png" Stretch="Fill" Height="16" Width="16" HorizontalAlignment="Left" />
  23. <Label Content="{DynamicResource GlobalLableSwitchToChart}" VerticalContentAlignment="Center" Padding="0" />
  24. </StackPanel>
  25. </Button.Content>
  26. </Button>
  27. <Button Height="23" HorizontalAlignment="Left" VerticalAlignment="Top" Width="92" Command="{Binding ConfigDbConnectionCommand}"
  28. ToolTip="{DynamicResource GlobalLableDatabaseConnection}" Margin="5,0">
  29. <Button.Content>
  30. <StackPanel Orientation="Horizontal">
  31. <Image Source="/DataAnalysisControl;component/Charting/Images/DatabaseCfg.png" Stretch="Fill" Height="16" Width="16" HorizontalAlignment="Left" />
  32. <Label Content="{DynamicResource GlobalLableDatabaseConfig}" VerticalContentAlignment="Center" Padding="0" />
  33. </StackPanel>
  34. </Button.Content>
  35. </Button>
  36. <Button Height="23" HorizontalAlignment="Left" VerticalAlignment="Top" Width="92" Command="{Binding SelectDataSourceCommand}" Margin="5,0"
  37. ToolTip="{DynamicResource GlobalLableLoadData}">
  38. <Button.Content>
  39. <StackPanel Orientation="Horizontal">
  40. <Image Source="/DataAnalysisControl;component/Charting/Images/LoadFromDb.png" Stretch="Fill" Height="17" Width="17" HorizontalAlignment="Left" />
  41. <Label Content="{DynamicResource GlobalLableDatabaseLoad}" VerticalContentAlignment="Center" Padding="0" />
  42. </StackPanel>
  43. </Button.Content>
  44. </Button>
  45. <!--<Button Height="23" HorizontalAlignment="Left" VerticalAlignment="Top" Width="92" Command="{Binding SelectFileSourceCommand}"
  46. ToolTip="{DynamicResource GlobalLableGetDataFromFile} ">
  47. <Button.Content>
  48. <StackPanel Orientation="Horizontal">
  49. <Image Source="/DataAnalysisControl;component/Charting/Images/LoadFromFile.png" Stretch="Fill" Height="19" Width="19" HorizontalAlignment="Left" />
  50. <Label Content="{DynamicResource GlobalLableFileLoad}" VerticalContentAlignment="Center" Padding="0" />
  51. </StackPanel>
  52. </Button.Content>
  53. </Button>-->
  54. <Button Height="23" VerticalAlignment="Top" HorizontalAlignment="Left" Width="92" Command="{Binding RemoveAllDataSourceCommand}" Margin="5,0"
  55. ToolTip=" {DynamicResource GlobalLableDeleteAllDataSource} ">
  56. <Button.Content>
  57. <StackPanel Orientation="Horizontal">
  58. <Image Source="/DataAnalysisControl;component/Charting/Images/deletered.png" Stretch="Fill" Height="19" Width="19" HorizontalAlignment="Left" />
  59. <Label Content="{DynamicResource GlobalLableDeleteAll}" VerticalContentAlignment="Center" Padding="0" />
  60. </StackPanel>
  61. </Button.Content>
  62. </Button>
  63. </StackPanel>
  64. <DataGrid Grid.Row="1"
  65. AutoGenerateColumns="False"
  66. Background="#FFF0F0F0"
  67. ItemsSource="{Binding CommonViewModel.DataSourceList, Mode=OneWay}"
  68. Name="dataGrid_DataSources"
  69. SelectionChanged="DataSource_SelectionChanged"
  70. SelectionMode="Single"
  71. SelectionUnit="FullRow" AlternationCount="1"
  72. SelectedItem="{Binding CommonViewModel.CurrentSelectedDataSource}">
  73. <DataGrid.Columns>
  74. <DataGridTextColumn Binding="{Binding Title,Mode=OneWay}" CanUserReorder="True" CanUserSort="False" IsReadOnly="True" Width="600*">
  75. <DataGridTextColumn.HeaderTemplate >
  76. <DataTemplate>
  77. <TextBlock Text="{DynamicResource GlobalLableDataSourceName}" />
  78. </DataTemplate>
  79. </DataGridTextColumn.HeaderTemplate>
  80. <DataGridTextColumn.CellStyle>
  81. <Style TargetType="DataGridCell">
  82. <Setter Property="ToolTip" Value="{Binding Title}" />
  83. </Style>
  84. </DataGridTextColumn.CellStyle>
  85. </DataGridTextColumn>
  86. <DataGridTextColumn Binding="{Binding BeginTime,Mode=OneWay,StringFormat={}\{0:yyyy/MM/dd HH:mm:ss\}}" CanUserSort="False" IsReadOnly="True" Width="150" >
  87. <DataGridTextColumn.HeaderTemplate >
  88. <DataTemplate>
  89. <TextBlock Text="{DynamicResource GlobalLableBeginTime}" />
  90. </DataTemplate>
  91. </DataGridTextColumn.HeaderTemplate>
  92. </DataGridTextColumn>
  93. <DataGridTextColumn Binding="{Binding EndTime,Mode=OneWay,StringFormat={}\{0:yyyy/MM/dd HH:mm:ss\}}" CanUserSort="False" IsReadOnly="True" Width="150">
  94. <DataGridTextColumn.HeaderTemplate >
  95. <DataTemplate>
  96. <TextBlock Text="{DynamicResource GlobalLableEndTime}" />
  97. </DataTemplate>
  98. </DataGridTextColumn.HeaderTemplate>
  99. </DataGridTextColumn>
  100. <DataGridTemplateColumn Width="300" CanUserSort="False">
  101. <DataGridTemplateColumn.HeaderTemplate >
  102. <DataTemplate>
  103. <TextBlock Text="{DynamicResource GlobalLableSyncTime}" />
  104. </DataTemplate>
  105. </DataGridTemplateColumn.HeaderTemplate>
  106. <DataGridTemplateColumn.CellTemplate>
  107. <DataTemplate>
  108. <ComboBox ItemsSource="{Binding RecipeSteps}" Tag="{Binding Title}" SelectedItem="{Binding SyncPoint,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
  109. </DataTemplate>
  110. </DataGridTemplateColumn.CellTemplate>
  111. </DataGridTemplateColumn>
  112. <!--<DataGridTemplateColumn Header="文件" Width="50" CanUserSort="False">
  113. <DataGridTemplateColumn.CellTemplate>
  114. <DataTemplate>
  115. <Button Content="导出" FontSize="11" Height="20" Tag="{Binding Title}" Click="DataSource_Export"/>
  116. </DataTemplate>
  117. </DataGridTemplateColumn.CellTemplate>
  118. </DataGridTemplateColumn>-->
  119. <DataGridTemplateColumn Header=" " Width="50" CanUserSort="False">
  120. <DataGridTemplateColumn.CellTemplate>
  121. <DataTemplate>
  122. <Button Content="{DynamicResource GlobalLableDelete}" FontSize="11" Height="20" Tag="{Binding Title}" Click="DataSource_Remove"/>
  123. </DataTemplate>
  124. </DataGridTemplateColumn.CellTemplate>
  125. </DataGridTemplateColumn>
  126. </DataGrid.Columns>
  127. </DataGrid>
  128. </Grid>
  129. </UserControl>