pry 2 years ago
parent
commit
f79d9032f5
3 changed files with 8 additions and 7 deletions
  1. +5
    -5
      BeDesignerSCADA/Controls/MainCanvasPanel.xaml
  2. +2
    -2
      BeDesignerSCADA/MainWindow.xaml.cs
  3. +1
    -0
      BeDesignerSCADA/ViewModel/MainViewModelNew.cs

+ 5
- 5
BeDesignerSCADA/Controls/MainCanvasPanel.xaml View File

@@ -319,7 +319,7 @@
</mypro:EditorTemplateDefinition.EditingTemplate>
</mypro:EditorTemplateDefinition>

<mypro:EditorTemplateDefinition TargetProperties="DeviceValuleName" >
<!--<mypro:EditorTemplateDefinition TargetProperties="DeviceValuleName" >
<mypro:EditorTemplateDefinition.EditingTemplate>
<DataTemplate>
<ComboBox Grid.Column="1" Height="25" Width="{Binding Width, ElementName=com}" Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
@@ -327,13 +327,13 @@
></ComboBox>
</DataTemplate>
</mypro:EditorTemplateDefinition.EditingTemplate>
</mypro:EditorTemplateDefinition>
</mypro:EditorTemplateDefinition>-->

<mypro:EditorTemplateDefinition TargetProperties="DeviceName" >
<mypro:EditorTemplateDefinition.EditingTemplate>
<DataTemplate>
<ComboBox Grid.Column="1" Height="25" Width="{Binding Width, ElementName=com}" Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window},Path=DataContext.DevNameList}"
ItemsSource="{Binding RelativeSource={RelativeSource Self},Path=DataContext.DevNameList}"
></ComboBox>
</DataTemplate>
</mypro:EditorTemplateDefinition.EditingTemplate>
@@ -356,10 +356,10 @@
</Grid.ColumnDefinitions>
<TextBlock>绑定:</TextBlock>
<ComboBox x:Name="namebox" DropDownOpened="namebox_DropDownOpened" Grid.Column="1" Height="25" IsTextSearchEnabled="True" IsEditable="True" Tag="{Binding Text, ElementName=valuebox}" TextBoxBase.TextChanged="ComboBoxName_TextChanged"
ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window},Path=DataContext.DevNameList}">
ItemsSource="{Binding RelativeSource={RelativeSource Self},Path=DataContext.DevNameList}">
</ComboBox>
<ComboBox x:Name="valuebox" DropDownOpened="valuebox_DropDownOpened" Grid.Column="2" Height="25" IsTextSearchEnabled="True" IsEditable="True" Tag="{Binding Text, ElementName=namebox}" TextBoxBase.TextChanged="ComboBoxValue_TextChanged"
ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window},Path=DataContext.DevValueList}"/>
ItemsSource="{Binding RelativeSource={RelativeSource Self},Path=DataContext.DevValueList}"/>
</Grid>
<TextBox Grid.Row="2" x:Name="wenben" Padding="5" Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" TextWrapping="Wrap"></TextBox>



+ 2
- 2
BeDesignerSCADA/MainWindow.xaml.cs View File

@@ -332,8 +332,8 @@ namespace BeDesignerSCADA
/// <param name="e"></param>
private void namebox_DropDownOpened(object sender,EventArgs e)
{
viewModel.DevNameList = new System.Collections.ObjectModel.ObservableCollection<string>();
Class_DataBus.GetInstance().Dic_DeviceData.Keys?.ToList().ForEach(key => { viewModel.DevNameList.Add(key); });
//viewModel.DevNameList = new System.Collections.ObjectModel.ObservableCollection<string>();
//Class_DataBus.GetInstance().Dic_DeviceData.Keys?.ToList().ForEach(key => { viewModel.DevNameList.Add(key); });
}
#endregion



+ 1
- 0
BeDesignerSCADA/ViewModel/MainViewModelNew.cs View File

@@ -37,6 +37,7 @@ namespace BeDesignerSCADA.ViewModel
{
IsRunning = !IsRunning;
});
//DevNameList = new ObservableCollection<string>() {"qqqq","wewew" };
//DataBusModel.GetInstance().RefreshTheVariableManagerAction += RefreshTheVariableManagerActionHader;
}



Loading…
Cancel
Save