Click here to Skip to main content
15,914,111 members
Home / Discussions / WPF
   

WPF

 
QuestionWPF and ASP.NET Pin
rastaVnuce5-Nov-09 23:46
rastaVnuce5-Nov-09 23:46 
AnswerRe: WPF and ASP.NET Pin
Pete O'Hanlon6-Nov-09 0:03
mvePete O'Hanlon6-Nov-09 0:03 
GeneralRe: WPF and ASP.NET Pin
rastaVnuce6-Nov-09 0:58
rastaVnuce6-Nov-09 0:58 
AnswerRe: WPF and ASP.NET Pin
Christian Graus6-Nov-09 23:42
protectorChristian Graus6-Nov-09 23:42 
AnswerRe: WPF and ASP.NET Pin
Steven Kirk8-Nov-09 23:30
Steven Kirk8-Nov-09 23:30 
QuestionPosition of UIElement Pin
sadas232341s5-Nov-09 19:48
sadas232341s5-Nov-09 19:48 
AnswerRe: Position of UIElement Pin
Mark Salsbery6-Nov-09 9:50
Mark Salsbery6-Nov-09 9:50 
QuestionSilver light application problem [modified] Pin
rag_Singh5-Nov-09 19:26
rag_Singh5-Nov-09 19:26 
AnswerRe: Silver light application problem Pin
Mark Salsbery6-Nov-09 9:55
Mark Salsbery6-Nov-09 9:55 
AnswerRe: Silver light application problem Pin
rag_Singh8-Nov-09 18:21
rag_Singh8-Nov-09 18:21 
QuestionFundamentals: Compiling a Silverlight Application using Csc.exe on the command line Pin
The OldManChild5-Nov-09 13:28
The OldManChild5-Nov-09 13:28 
AnswerRe: Fundamentals: Compiling a Silverlight Application using Csc.exe on the command line Pin
Mark Salsbery6-Nov-09 9:59
Mark Salsbery6-Nov-09 9:59 
GeneralRe: Fundamentals: Compiling a Silverlight Application using Csc.exe on the command line Pin
The OldManChild6-Nov-09 18:54
The OldManChild6-Nov-09 18:54 
QuestionBinding custom objects collection to ListBox in WPF?? Pin
mittalpa5-Nov-09 8:25
mittalpa5-Nov-09 8:25 
AnswerRe: Binding custom objects collection to ListBox in WPF?? Pin
Mark Salsbery5-Nov-09 9:42
Mark Salsbery5-Nov-09 9:42 
QuestionNew to WPF - Would this be easy to implement? Pin
AksharRoop4-Nov-09 19:36
AksharRoop4-Nov-09 19:36 
AnswerRe: New to WPF - Would this be easy to implement? Pin
Mark Salsbery5-Nov-09 7:24
Mark Salsbery5-Nov-09 7:24 
QuestionRe: New to WPF - Would this be easy to implement? Pin
AksharRoop5-Nov-09 20:09
AksharRoop5-Nov-09 20:09 
AnswerRe: New to WPF - Would this be easy to implement? Pin
Mark Salsbery6-Nov-09 10:09
Mark Salsbery6-Nov-09 10:09 
GeneralRe: New to WPF - Would this be easy to implement? Pin
AksharRoop8-Nov-09 19:11
AksharRoop8-Nov-09 19:11 
Questionproblem with WPF graph control Pin
ranganaMIT4-Nov-09 17:18
ranganaMIT4-Nov-09 17:18 
AnswerRe: problem with WPF graph control Pin
hb521342144-Nov-09 18:04
hb521342144-Nov-09 18:04 
You can use System.Threading.Timer just like you would in non-WPF code. The problem that you will likely encounter is that DependencyObjects (many object within WPF derive from a DependencyObject) often need to be used within in the object's original thread context. This is easily handled by having your background thread trigger an action within the dependency object's thread. For example to make a TextBlock with a background that alternates between red and blue every 1 second, try the following:

using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
class FlashingText : TextBlock
{
   Timer timer;
   public FlashingText() {
       timer = new Timer(new TimerCallback(Flash), null, 0, 1000);
   }
   void Flash(object state) {
       Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(ToggleColor));
   }
   void ToggleColor() {
       Background = Background == Brushes.Blue ? Brushes.Red : Brushes.Blue;
   }
}


A few notes of caution:

I have not tested the code above, I just scribbled it out to illustrate a concept. It may need a few tweaks to compile.

Also, composing a graph with a large number of elements within WPF will often slow the UI thread and may lead to temporary hanging of the UI. To reduce this problem, there are a number of techniques that can reduce or eliminate this issue. In my experience, drawing more than a few thousand points is likely to provide disappointing UI interaction without an efficient design.
QuestionXAML TEmplate Pin
Saiyed Alam4-Nov-09 16:08
Saiyed Alam4-Nov-09 16:08 
AnswerRe: XAML TEmplate Pin
Richard MacCutchan4-Nov-09 23:20
mveRichard MacCutchan4-Nov-09 23:20 
QuestionHow to find a height of a Grid Row at runtime? Pin
dbrenth4-Nov-09 7:40
dbrenth4-Nov-09 7:40 

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.