Exemplo n.º 1
0
        private void lsb1_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            WeChatFriendShow accout = lsb1.SelectedValue as WeChatFriendShow;
            TreeNode         nodes  = lsb1.DataContext as TreeNode;

            if (accout == null || nodes == null)
            {
                return;
            }
            var selNode = nodes.TreeNodes.FirstOrDefault(t => t.Text == accout.Nick);
            var views   = DataViewPluginAdapter.Instance.GetView("微信", selNode.Type);

            tbdetail.Items.Clear();
            foreach (var v in views)
            {
                v.SelectedDataChanged += OnSelectedDataChanged;
                TabItem ti = new TabItem()
                {
                    Header = v.PluginInfo.Name
                };
                ti.Content = v.GetControl(new DataViewPluginArgument()
                {
                    CurrentNode = selNode
                });
                tbdetail.Items.Add(ti);
            }

            OnSelectedDataChanged?.Invoke(lsb1.SelectedValue);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 选择了某个联系人,在右侧显示对话
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void lsb1_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            DataViewPluginArgument arg = lsb1.DataContext as DataViewPluginArgument;

            if (arg == null)
            {
                return;
            }
            WeChatFriendShow accout = lsb1.SelectedItem as WeChatFriendShow;
            TreeNode         nodes  = arg.CurrentData as TreeNode;

            if (accout == null || nodes == null)
            {
                return;
            }
            var selNode = nodes.TreeNodes.FirstOrDefault(t => t.Text == accout.Nick);   //获取选择的好友
            var views   = DataViewPluginAdapter.Instance.GetView(arg.DataSource.PluginInfo.Guid, selNode.Type, new DataViewConfigure()
            {
                IsDefaultGridViewVisibleWhenMultiviews = true
            });

            tbdetail.Items.Clear();
            foreach (var v in views)    //生成消息列表显示视图列表
            {
                v.SelectedDataChanged += OnSelectedDataChanged;
                tbdetail.Items.Add(v.ToControl(new DataViewPluginArgument()
                {
                    CurrentData = selNode, DataSource = arg.DataSource
                }));
            }
            tbdetail.SelectedIndex = tbdetail.HasItems ? 0 : -1;

            OnSelectedDataChanged?.Invoke(lsb1.SelectedValue);
        }
Exemplo n.º 3
0
 /// <summary>
 /// 表格行选择事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     OnSelectedDataChanged?.Invoke(new DataPreviewPluginArgument()
     {
         CurrentData = (sender as DataGrid).SelectedItem, PluginId = _arg.DataSource?.PluginInfo?.Guid, Type = (_arg.CurrentData as dynamic)?.Type
     });
 }
Exemplo n.º 4
0
 private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     OnSelectedDataChanged?.Invoke(new DataPreviewPluginArgument()
     {
         CurrentData = lsb1.SelectedValue, PluginId = _arg.DataSource?.PluginInfo?.Guid, Type = (_arg.CurrentData as dynamic)?.Type
     });
 }
Exemplo n.º 5
0
 private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     OnSelectedDataChanged?.Invoke((sender as DataGrid).SelectedItem);
 }
Exemplo n.º 6
0
 private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     OnSelectedDataChanged?.Invoke(lsb1.SelectedValue);
 }
Exemplo n.º 7
0
 public void SelectItem(object obj)
 {
     OnSelectedDataChanged?.Invoke(obj);
     //MessageBox.Show($"you click {obj}");
 }
Exemplo n.º 8
0
 public void ActivateDataIndex(string key)
 {
     AssertInitialized();
     mesh.SetDataIndex(key);
     OnSelectedDataChanged?.Invoke();
 }