/// <summary> /// 历史订单 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CommandBinding_Executed_HistoryOrder(object sender, ExecutedRoutedEventArgs e) { TradeJieYue data = (e.OriginalSource as DataGridRow).DataContext as TradeJieYue; OrderInfoWindow orderInfo = new OrderInfoWindow(data.Account); orderInfo.DataContext = this.DataContext; orderInfo.ShowDialog(); }
private void dataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e) { //DataGrid dg = sender as DataGrid; TradeJieYue t = dataGrid.SelectedItem as TradeJieYue; if (t != null) { DataGridRow dr = (DataGridRow)(dataGrid.ItemContainerGenerator.ContainerFromItem(t)); if (dr == null) { return; } if (vm.CurJieYue.State == "0") { dr.ContextMenu.Visibility = System.Windows.Visibility.Visible; } else { //dr.ContextMenu.Visibility = System.Windows.Visibility.Hidden; dr.ContextMenu = null; } } }