diff --git a/BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj b/BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj index 09391b18..518a2237 100644 --- a/BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj +++ b/BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj @@ -9,6 +9,9 @@ + + + @@ -42,6 +45,8 @@ + + @@ -49,6 +54,7 @@ + diff --git a/BPASmartClient.SCADAControl/Converters/ItemsList.cs b/BPASmartClient.SCADAControl/Converters/ItemsList.cs index 2203b480..a278c903 100644 --- a/BPASmartClient.SCADAControl/Converters/ItemsList.cs +++ b/BPASmartClient.SCADAControl/Converters/ItemsList.cs @@ -34,4 +34,28 @@ namespace BPASmartClient.SCADAControl.Converters } } + + public class ItemsListObj:ObservableCollection + { + public ItemsListObj() + { + AddCommand = new RelayCommand(AddItem); + DeleteCommand = new RelayCommand(DeleteItem); + } + + private void DeleteItem(object obj) + { + if (obj!=null) + Remove(obj); + } + + public RelayCommand AddCommand { get; } + public RelayCommand DeleteCommand { get; } + private void AddItem(object txt) + { + if (txt != null) + Add(txt); + } + + } } diff --git a/BPASmartClient.SCADAControl/CustomerControls/TheDataGrid.xaml b/BPASmartClient.SCADAControl/CustomerControls/TheDataGrid.xaml new file mode 100644 index 00000000..50bdf1a6 --- /dev/null +++ b/BPASmartClient.SCADAControl/CustomerControls/TheDataGrid.xaml @@ -0,0 +1,10 @@ + + diff --git a/BPASmartClient.SCADAControl/CustomerControls/TheDataGrid.xaml.cs b/BPASmartClient.SCADAControl/CustomerControls/TheDataGrid.xaml.cs new file mode 100644 index 00000000..9efb1557 --- /dev/null +++ b/BPASmartClient.SCADAControl/CustomerControls/TheDataGrid.xaml.cs @@ -0,0 +1,101 @@ +using BPASmartClient.Compiler; +using BPASmartClient.MessageName.接收消息Model.物料仓; +using BPASmartClient.SCADAControl.Converters; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace BPASmartClient.SCADAControl.CustomerControls +{ + /// + /// TheDataGrid.xaml 的交互逻辑 + /// + public partial class TheDataGrid :DataGrid, IExecutable + { + public TheDataGrid() + { + InitializeComponent(); + Style = Application.Current.Resources["DesignTheDataGrid"] as Style; + + ItemsString=new ItemsListObj() + { + new datalist { Name="23232",Description="wwewewew",Messgae="564654645"}, + new datalist { Name="23232",Description="wwewewew",Messgae="564654645"}, + new datalist { Name="23232",Description="wwewewew",Messgae="564654645"}, + new datalist { Name="23232",Description="wwewewew",Messgae="564654645"}, + new datalist { Name="23232",Description="wwewewew",Messgae="564654645"}, + new datalist { Name="23232",Description="wwewewew",Messgae="564654645"}, + new datalist { Name="23232",Description="wwewewew",Messgae="564654645"}, + new datalist { Name="23232",Description="wwewewew",Messgae="564654645"}, + new datalist { Name="23232",Description="wwewewew",Messgae="564654645"}, + }; + } + + public ItemsListObj ItemsString + { + get { return (ItemsListObj)GetValue(ItemsStringProperty); } + set { SetValue(ItemsStringProperty,value); } + } + + public static readonly DependencyProperty ItemsStringProperty = + DependencyProperty.Register("ItemsString",typeof(ItemsListObj),typeof(TheDataGrid),new PropertyMetadata(null)); + + + + + public string ControlType => "控件"; + + private bool isExecuteState; + public bool IsExecuteState + { + get { return isExecuteState; } + set + { + isExecuteState = value; + if (IsExecuteState) + { + Style = null; + Register(); + } + } + } + + /// + /// 注册需要处理的事件 + /// + public void Register() + { + // 运行时进行项目绑定 + Binding binding = new Binding(); + binding.RelativeSource = new RelativeSource() { Mode = RelativeSourceMode.Self }; + binding.Path = new PropertyPath("ItemsString"); + + SetBinding(ItemsSourceProperty,binding); + } + + private void MyButton_Click(object sender,RoutedEventArgs e) + { + + } + } + + public class datalist + { + public string Name { get; set; } + public string Description { get; set; } + public string Messgae { get; set; } + } +} diff --git a/BPASmartClient.SCADAControl/Images/biogebj.png b/BPASmartClient.SCADAControl/Images/biogebj.png new file mode 100644 index 00000000..9b4a981e Binary files /dev/null and b/BPASmartClient.SCADAControl/Images/biogebj.png differ diff --git a/BPASmartClient.SCADAControl/Images/bj.png b/BPASmartClient.SCADAControl/Images/bj.png new file mode 100644 index 00000000..f6b621e0 Binary files /dev/null and b/BPASmartClient.SCADAControl/Images/bj.png differ diff --git a/BPASmartClient.SCADAControl/Images/databj.png b/BPASmartClient.SCADAControl/Images/databj.png new file mode 100644 index 00000000..ef7fa61a Binary files /dev/null and b/BPASmartClient.SCADAControl/Images/databj.png differ diff --git a/BPASmartClient.SCADAControl/Themes/Generic.xaml b/BPASmartClient.SCADAControl/Themes/Generic.xaml index b73fec52..ee1a803f 100644 --- a/BPASmartClient.SCADAControl/Themes/Generic.xaml +++ b/BPASmartClient.SCADAControl/Themes/Generic.xaml @@ -9,6 +9,18 @@ + + + + + + + + + + + + @@ -16,7 +28,9 @@ + + pack://application:,,,/Fonts/#DS-Digital @@ -376,4 +390,249 @@ + + + + + + + + + + + + + + +