@@ -31,8 +31,10 @@ namespace BPASmartClient.SCADAControl.CustomerControls | |||
public TheTextBlock() | |||
{ | |||
ResourceDictionary languageResDic = new ResourceDictionary(); | |||
languageResDic.Source = new Uri(@"/BPASmartClient.SCADAControl;component/Themes/Generic.xaml",UriKind.RelativeOrAbsolute); | |||
languageResDic.Source = new Uri(@"/BPASmartClient.SCADAControl;component/Themes/Generic.xaml", UriKind.RelativeOrAbsolute); | |||
this.Resources.MergedDictionaries.Add(languageResDic); | |||
Height = 30; | |||
Width = 80; | |||
} | |||
public string ControlType => "控件"; | |||
@@ -491,6 +491,12 @@ | |||
<Setter Property="HorizontalAlignment" Value="Left" /> | |||
<Setter Property="VerticalAlignment" Value="Center" /> | |||
<Setter Property="FontSize" Value="20" /> | |||
<Setter Property="FocusVisualStyle" Value="{x:Null}" /> | |||
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/> | |||
<Setter Property="KeyboardNavigation.TabNavigation" Value="None" /> | |||
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" /> | |||
<Setter Property="AllowDrop" Value="true" /> | |||
<Setter Property="TextWrapping" Value="Wrap"/> | |||
</Style.Setters> | |||
</Style> | |||
@@ -267,13 +267,13 @@ | |||
<ColumnDefinition Width="*" x:Name="Text"/> | |||
</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}" Width="{Binding Width, ElementName=key}" TextBoxBase.TextChanged="ComboBoxName_TextChanged" | |||
<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}"> | |||
</ComboBox> | |||
<ComboBox x:Name="valuebox" DropDownOpened="valuebox_DropDownOpened" Grid.Column="2" Height="25" IsTextSearchEnabled="True" IsEditable="True" Tag="{Binding Text, ElementName=namebox}" Width="{Binding Width, ElementName=Text}" TextBoxBase.TextChanged="ComboBoxValue_TextChanged" | |||
<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}"/> | |||
</Grid> | |||
<TextBox Grid.Row="2" x:Name="wenben" Width="{Binding Width, ElementName=Text}" Padding="5" Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" TextWrapping="Wrap"></TextBox> | |||
<TextBox Grid.Row="2" x:Name="wenben" Padding="5" Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" TextWrapping="Wrap"></TextBox> | |||
</Grid> | |||
</DataTemplate> | |||
@@ -271,13 +271,13 @@ | |||
<ColumnDefinition Width="*" x:Name="Text"/> | |||
</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}" Width="{Binding Width, ElementName=key}" TextBoxBase.TextChanged="ComboBoxName_TextChanged" | |||
<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}"> | |||
</ComboBox> | |||
<ComboBox x:Name="valuebox" DropDownOpened="valuebox_DropDownOpened" Grid.Column="2" Height="25" IsTextSearchEnabled="True" IsEditable="True" Tag="{Binding Text, ElementName=namebox}" Width="{Binding Width, ElementName=Text}" TextBoxBase.TextChanged="ComboBoxValue_TextChanged" | |||
<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}"/> | |||
</Grid> | |||
<TextBox Grid.Row="2" x:Name="wenben" Width="{Binding Width, ElementName=Text}" Padding="5" Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" TextWrapping="Wrap"></TextBox> | |||
<TextBox Grid.Row="2" x:Name="wenben" Padding="5" Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" TextWrapping="Wrap"></TextBox> | |||
</Grid> | |||
</DataTemplate> | |||
@@ -44,6 +44,20 @@ namespace BeDesignerSCADA | |||
Assembly assembly = Assembly.LoadFile($"{System.AppDomain.CurrentDomain.BaseDirectory}\\BPASmartClient.SCADAControl.dll"); //Assembly.GetExecutingAssembly(); | |||
var controls = assembly.GetTypes().Where(t => t.GetInterface("IExecutable") != null).OrderBy(o=>o.Name); | |||
CtlList.ItemsSource = controls; | |||
this.GotFocus += MainWindow_GotFocus; | |||
this.LostFocus += MainWindow_LostFocus; | |||
} | |||
private void MainWindow_LostFocus(object sender, RoutedEventArgs e) | |||
{ | |||
System.Diagnostics.Trace.WriteLine("失去焦点:" + e.OriginalSource.ToString()); | |||
// Console.WriteLine(e.OriginalSource.ToString()); | |||
} | |||
private void MainWindow_GotFocus(object sender, RoutedEventArgs e) | |||
{ | |||
System.Diagnostics.Trace.WriteLine("获得焦点:"+e.OriginalSource.ToString()); | |||
} | |||
#region 加载数据中心与事件中心 | |||