Click here to Skip to main content
15,908,264 members
Home / Discussions / C#
   

C#

 
AnswerRe: c# code to convert txt to xls Pin
Eddy Vluggen10-Feb-12 5:19
professionalEddy Vluggen10-Feb-12 5:19 
GeneralRe: c# code to convert txt to xls Pin
taurusone10-Feb-12 6:11
taurusone10-Feb-12 6:11 
AnswerRe: c# code to convert txt to xls Pin
Eddy Vluggen10-Feb-12 6:48
professionalEddy Vluggen10-Feb-12 6:48 
GeneralRe: c# code to convert txt to xls Pin
jschell10-Feb-12 9:28
jschell10-Feb-12 9:28 
AnswerRe: c# code to convert txt to xls Pin
Richard MacCutchan10-Feb-12 6:38
mveRichard MacCutchan10-Feb-12 6:38 
AnswerRe: c# code to convert txt to xls Pin
Tim Groven10-Feb-12 7:02
Tim Groven10-Feb-12 7:02 
QuestionHow to dynamically change the gradient of a usercontrol according to the values using c# and wpf Pin
Amalrulezz10-Feb-12 0:05
Amalrulezz10-Feb-12 0:05 
AnswerRe: How to dynamically change the gradient of a usercontrol according to the values using c# and wpf Pin
Pete O'Hanlon10-Feb-12 0:15
mvePete O'Hanlon10-Feb-12 0:15 
The quickest and dirtiest way (and I am assuming you are using binding here) would be to have a custom converter class which accepts the temperature as an input, and returns the relevant colour as the output. What you need to look at is implementing an IValueConverter - and hook this up in a binding. For instance:
C#
BackgroundColor="{Binding Temperature, Converter={StaticResource myTemperatureToColorConverter}}"
Note that you would have to add a reference to your colour converter in a resources section like this:
XML
<converters:TemperatureToColorConverter x:Key="myTemperatureToColorConverter" />
I leave the actual implementation of the converter class to you, but you should find plenty of source samples on the web, as this is a very trivial task.

BTW - don't surround your text in the <pre> tags, these should be reserved for code samples.

Second BTW - you should have asked this in the WPF forum.

*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

"Mind bleach! Send me mind bleach!" - Nagy Vilmos


My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility


Questionexception when serialize binary entity framework objects Pin
Giorgi Nistor9-Feb-12 22:13
Giorgi Nistor9-Feb-12 22:13 
AnswerRe: exception when serialize binary entity framework objects Pin
Pete O'Hanlon9-Feb-12 22:45
mvePete O'Hanlon9-Feb-12 22:45 
GeneralRe: exception when serialize binary entity framework objects Pin
Giorgi Nistor9-Feb-12 22:55
Giorgi Nistor9-Feb-12 22:55 
GeneralRe: exception when serialize binary entity framework objects Pin
Pete O'Hanlon9-Feb-12 23:09
mvePete O'Hanlon9-Feb-12 23:09 
GeneralRe: exception when serialize binary entity framework objects Pin
Giorgi Nistor9-Feb-12 23:16
Giorgi Nistor9-Feb-12 23:16 
GeneralRe: exception when serialize binary entity framework objects Pin
karmjit9-Feb-12 23:23
karmjit9-Feb-12 23:23 
GeneralRe: exception when serialize binary entity framework objects Pin
Giorgi Nistor9-Feb-12 23:58
Giorgi Nistor9-Feb-12 23:58 
GeneralRe: exception when serialize binary entity framework objects Pin
Giorgi Nistor10-Feb-12 0:14
Giorgi Nistor10-Feb-12 0:14 
GeneralRe: exception when serialize binary entity framework objects Pin
BobJanova10-Feb-12 0:27
BobJanova10-Feb-12 0:27 
GeneralRe: exception when serialize binary entity framework objects Pin
Giorgi Nistor10-Feb-12 0:45
Giorgi Nistor10-Feb-12 0:45 
QuestionExport to PDF Chinese in pixels Pin
Rchiu2hk9-Feb-12 15:10
Rchiu2hk9-Feb-12 15:10 
AnswerRe: Export to PDF Chinese in pixels Pin
Richard MacCutchan9-Feb-12 22:17
mveRichard MacCutchan9-Feb-12 22:17 
AnswerRe: Export to PDF Chinese in pixels Pin
Rchiu2hk12-Feb-12 15:59
Rchiu2hk12-Feb-12 15:59 
AnswerLoop while mouse or key is down Pin
DerecL9-Feb-12 12:13
DerecL9-Feb-12 12:13 
GeneralRe: Loop while mouse or key is down Pin
Richard Andrew x649-Feb-12 12:17
professionalRichard Andrew x649-Feb-12 12:17 
GeneralRe: Loop while mouse or key is down Pin
BillWoodruff9-Feb-12 19:41
professionalBillWoodruff9-Feb-12 19:41 
GeneralRe: Loop while mouse or key is down Pin
Pete O'Hanlon9-Feb-12 12:18
mvePete O'Hanlon9-Feb-12 12:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.