Click here to Skip to main content
15,314,282 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Ambitious "First" Project Pin
Insincere Dave5-Apr-09 13:25
MemberInsincere Dave5-Apr-09 13:25 
AnswerRe: Ambitious "First" Project Pin
ABitSmart6-Apr-09 2:59
MemberABitSmart6-Apr-09 2:59 
AnswerRe: Ambitious "First" Project Pin
Wes Aday7-Apr-09 4:55
professionalWes Aday7-Apr-09 4:55 
AnswerRe: Ambitious "First" Project Pin
Ray Cassick9-Apr-09 4:13
MemberRay Cassick9-Apr-09 4:13 
QuestionLINQ to XML in SL2 ? Pin
Mohammad Dayyan4-Apr-09 11:07
MemberMohammad Dayyan4-Apr-09 11:07 
AnswerRe: LINQ to XML in SL2 ? Pin
Syed Mehroz Alam4-Apr-09 18:47
MemberSyed Mehroz Alam4-Apr-09 18:47 
AnswerRe: LINQ to XML in SL2 ? Pin
Braulio Dez12-Apr-09 7:27
MemberBraulio Dez12-Apr-09 7:27 
Questionsimple wpf timer taking up 50% of resources? how do i fix this? Pin
dirtylarry4-Apr-09 2:45
Memberdirtylarry4-Apr-09 2:45 
here's a code snippet

i start a new thread:

Thread timeThread = new Thread(UpdateDateTime);
timeThread.Start();

then i use this to update the labels:

delegate void UpdateDate(string date);
void updateDate(string date)
{
lblDate.Content = date;
}

delegate void UpdateTime(string time);
void updateTime(string time)
{
lblTime.Content = time;
}

void UpdateDateTime()
{

int seconds;
string time;
DateTime dt = DateTime.Now;
seconds = dt.Second;

for (; ; )
{
dt = DateTime.Now;
if (seconds != dt.Second)
{
seconds = dt.Second;
string dateString;
dateString = dt.Month + "/" + dt.Day + "/" + dt.Year;
lblDate.Dispatcher.Invoke(DispatcherPriority.Send, new UpdateDate(updateDate), dateString);
time = dt.Hour.ToString() + ":" + dt.Minute.ToString() + ":" + dt.Second.ToString();
lblTime.Dispatcher.Invoke(DispatcherPriority.Send, new UpdateTime(updateTime), time);

}
}
}

is there any more efficient way to update the clock without taking up 50% of my resources????
AnswerRe: simple wpf timer taking up 50% of resources? how do i fix this? Pin
Nicholas Butler4-Apr-09 3:08
sitebuilderNicholas Butler4-Apr-09 3:08 
GeneralRe: simple wpf timer taking up 50% of resources? how do i fix this? Pin
dirtylarry4-Apr-09 8:18
Memberdirtylarry4-Apr-09 8:18 
AnswerRe: simple wpf timer taking up 50% of resources? how do i fix this? Pin
Christian Graus4-Apr-09 16:14
mveChristian Graus4-Apr-09 16:14 
AnswerRe: simple wpf timer taking up 50% of resources? how do i fix this? Pin
Luc Pattyn5-Apr-09 1:51
sitebuilderLuc Pattyn5-Apr-09 1:51 
QuestionMulti column Treeview. Pin
hirenkshah3-Apr-09 22:39
Memberhirenkshah3-Apr-09 22:39 
AnswerRe: Multi column Treeview. Pin
ABitSmart4-Apr-09 0:50
MemberABitSmart4-Apr-09 0:50 
QuestionRe: Multi column Treeview. Pin
hirenkshah5-Apr-09 19:47
Memberhirenkshah5-Apr-09 19:47 
AnswerRe: Multi column Treeview. Pin
ABitSmart5-Apr-09 20:13
MemberABitSmart5-Apr-09 20:13 
QuestionGetting session ID with SL2 ! Pin
Mohammad Dayyan3-Apr-09 10:52
MemberMohammad Dayyan3-Apr-09 10:52 
AnswerRe: Getting session ID with SL2 ! Pin
Mark Salsbery3-Apr-09 12:11
MemberMark Salsbery3-Apr-09 12:11 
GeneralRe: Getting session ID with SL2 ! Pin
Mohammad Dayyan3-Apr-09 23:30
MemberMohammad Dayyan3-Apr-09 23:30 
GeneralRe: Getting session ID with SL2 ! Pin
Mark Salsbery4-Apr-09 7:18
MemberMark Salsbery4-Apr-09 7:18 
GeneralRe: Getting session ID with SL2 ! Pin
Mohammad Dayyan4-Apr-09 7:24
MemberMohammad Dayyan4-Apr-09 7:24 
GeneralRe: Getting session ID with SL2 ! Pin
Mark Salsbery6-Apr-09 6:17
MemberMark Salsbery6-Apr-09 6:17 
AnswerRe: Getting session ID with SL2 ! Pin
Braulio Dez12-Apr-09 23:49
MemberBraulio Dez12-Apr-09 23:49 
QuestionNeed ideas for getting data from text file to list view Pin
barker7703-Apr-09 9:48
Memberbarker7703-Apr-09 9:48 
AnswerRe: Need ideas for getting data from text file to list view Pin
sivaddrahcir6-Apr-09 7:04
Membersivaddrahcir6-Apr-09 7:04 

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.