private void dgResultDeals_LoadingRow(object sender, DataGridRowEventArgs e) { SubDealInfo di = (e.Row.Item as SubDealInfo); if (di == null) { return; } if (di.actiond == ActionDeal.subbuy) { e.Row.Background = new SolidColorBrush(Color.FromArgb(255, 220, 222, 255)); } if (di.actiond == ActionDeal.subsell) { e.Row.Background = new SolidColorBrush(Color.FromArgb(255, 255, 205, 219)); } else if (di.actiond == ActionDeal.buy && di.margin >= 0) { e.Row.Background = new SolidColorBrush(Colors.SkyBlue); } else if (di.actiond == ActionDeal.buy && di.margin < 0) { e.Row.Background = new SolidColorBrush(Color.FromArgb(255, 0xFF, 0x1E, 0x00)); } else if (di.actiond == ActionDeal.sell && di.margin >= 0) { e.Row.Background = new SolidColorBrush(Colors.HotPink); } else if (di.actiond == ActionDeal.sell && di.margin < 0) { e.Row.Background = new SolidColorBrush(Color.FromArgb(255, 0xFF, 0x1E, 0x00)); } }
public void InitGraph(object obj) { SubDealInfo sd = (obj as SubDealInfo); DateTime dt1 = sd.datetimeEnter.Subtract(new TimeSpan(0, 3, 0)); DateTime dt2 = sd.datetimeExit.Add(new TimeSpan(0, 3, 0)); tradeGraphVisual.drData = dsourceDB.dicSelectedDataTables[sd.shortName].datatable .Select("dtserver > '" + dt1.ToString() + "' AND dtserver <'" + dt2.ToString() + "' AND priceTick IS NOT NULL" ); }
private void dgResultDeals_SelectionChanged(object sender, SelectionChangedEventArgs e) { SubDealInfo sd = (sender as DataGrid).SelectedItem as SubDealInfo; if (sd == null) { return; } // находим родительскую сделку if (sd.parentDeal != null) { sd = sd.parentDeal; } string shortN = sd.shortName; if (threadViewGraphDeal == null || !threadViewGraphDeal.IsAlive) { threadViewGraphDeal = new Thread(new ParameterizedThreadStart(InitGraph)); threadViewGraphDeal.Start(sd); } }