Ejemplo n.º 1
0
        void Page_PrepareCellDisplayElement(object sender, PrepareCellDisplayElementEventArgs e)
        {
            Order    order  = (Order)e.DisplayElement.DataContext;
            TextEdit editor = (TextEdit)e.DisplayElement;

            if (order.Price > 200)
            {
                editor.Foreground = new SolidColorBrush(Colors.Red);
            }
        }
Ejemplo n.º 2
0
 private void unitPriceColumn_PrepareCellDisplayElement(object sender,
                                                        PrepareCellDisplayElementEventArgs e)
 {
     if ((double)e.CellData > 20)
     {
         ((TextEdit)e.DisplayElement).Foreground = new SolidColorBrush(Colors.Red);
         ((TextEdit)e.DisplayElement).Background = new SolidColorBrush(Colors.Yellow);
         ((TextEdit)e.DisplayElement).FontWeight = FontWeights.Bold;
     }
 }