| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using GalaSoft.MvvmLight.Messaging;
- using Muchinfo.MTPClient.Data.Enums;
- using System;
- using System.Windows.Controls;
- using System.Windows.Input;
- namespace Muchinfo.MTPClient.Account.Views
- {
- /// <summary>
- /// AccountTreeView.xaml 的交互逻辑
- /// </summary>
- public partial class AccountTreeView : UserControl
- {
- public AccountTreeView()
- {
- InitializeComponent();
- this.AccountInfo.IsSelected = true;
- TreeViewClick();
- //Messenger.Default.Register<string>(this, MessengerTokens.OrderCancelCommand, (args) =>
- //{
-
- // TreeViewClick();
- //});
- }
- private void TreeViewClick()
- {
- var treeItem = FunctionTreeView.SelectedItem as TreeViewItem;
- if (treeItem == null || treeItem.Tag==null) return;
- var tradeTreeMenu = TradeTreeMenu.AccountInfo;
- if (Enum.TryParse(treeItem.Tag.ToString(), out tradeTreeMenu))
- {
- Messenger.Default.Send(tradeTreeMenu, MessengerTokens.AccountFunction);
- }
- }
- private void TreeView_OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
- {
- TreeViewClick();
- }
- }
- }
|