Click here to Skip to main content
15,890,557 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Another Dummies question (sorry) Pin
Pete O'Hanlon15-Apr-11 0:56
mvePete O'Hanlon15-Apr-11 0:56 
GeneralRe: Another Dummies question (sorry) Pin
Mycroft Holmes15-Apr-11 2:15
professionalMycroft Holmes15-Apr-11 2:15 
QuestionHow to read data from databinding controls(listbox in my code) [modified] Pin
Rocky2313-Apr-11 23:51
Rocky2313-Apr-11 23:51 
AnswerRe: How to read data from databinding controls(listbox in my code) Pin
Tarun.K.S14-Apr-11 0:07
Tarun.K.S14-Apr-11 0:07 
QuestionMoving multiple Shapes in Canvas Pin
Member 773700213-Apr-11 22:15
Member 773700213-Apr-11 22:15 
AnswerRe: Moving multiple Shapes in Canvas Pin
SledgeHammer0114-Apr-11 6:33
SledgeHammer0114-Apr-11 6:33 
GeneralRe: Moving multiple Shapes in Canvas Pin
Member 773700215-Apr-11 10:00
Member 773700215-Apr-11 10:00 
QuestionThe problem with listview and timer [modified] Pin
Tesic Goran13-Apr-11 19:33
professionalTesic Goran13-Apr-11 19:33 
Hello,

I have WPF application. I use this code with different messages (SetMessage method) throughout the application:

infoMessageDlg = new InfoMessage();
infoMessageDlg.SetMessage("Записи не найдены...");
infoMessageDlg.Show();

timer.Interval = TimeSpan.FromMilliseconds(800);
timer.Start();


The timer I use is this:

private DispatcherTimer timer = null;
InfoMessage infoMessageDlg = null;

public MainWindow()
{
  ...

  timer = new DispatcherTimer();
  timer.Tick += new EventHandler(timer_Task);
}


It means dialog box appears for 800 milliseconds to display some message and closes automatically using this code:

private void timer_Task(object sender, EventArgs e)
{
  infoMessageDlg.Close();
  timer.Stop();
}


It works fine everywhere except in case I click listview item. The listview is bound to some data through its ItemsSource property. What happens? The dialog appears for very short time (almost not noticeable) and closes. It's much more shorter than 800 milliseconds.

The code looks like this:

private void lstvTestRuns_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
  ...

  listTestLogs.ItemsSource = null;
  listTestLogs.ItemsSource = lstTestLogs;

  if (treeAdditionalInfo.Items.Count == 0 && listTestLogs.Items.Count == 0)
  {
    infoMessageDlg = new InfoMessage();
    infoMessageDlg.SetMessage("Записи не найдены...");
    infoMessageDlg.Show();

    timer.Interval = TimeSpan.FromMilliseconds(800);
    timer.Start();
  }

  ...
}


Does anybody know what's going on here?

Thank you in advance for help.

modified on Thursday, April 14, 2011 1:53 AM

QuestionWPF virtualizingstackpanel vs Grid or StackPanel Pin
devvvy13-Apr-11 18:52
devvvy13-Apr-11 18:52 
AnswerRe: WPF virtualizingstackpanel vs Grid or StackPanel [modified] Pin
Tarun.K.S13-Apr-11 21:18
Tarun.K.S13-Apr-11 21:18 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
SledgeHammer0114-Apr-11 6:24
SledgeHammer0114-Apr-11 6:24 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
Tarun.K.S14-Apr-11 21:16
Tarun.K.S14-Apr-11 21:16 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
Pete O'Hanlon14-Apr-11 22:47
mvePete O'Hanlon14-Apr-11 22:47 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
Tarun.K.S14-Apr-11 23:47
Tarun.K.S14-Apr-11 23:47 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
Pete O'Hanlon15-Apr-11 0:03
mvePete O'Hanlon15-Apr-11 0:03 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
Tarun.K.S15-Apr-11 0:17
Tarun.K.S15-Apr-11 0:17 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
SledgeHammer0115-Apr-11 4:36
SledgeHammer0115-Apr-11 4:36 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
Tarun.K.S15-Apr-11 7:25
Tarun.K.S15-Apr-11 7:25 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
SledgeHammer0115-Apr-11 7:50
SledgeHammer0115-Apr-11 7:50 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
Tarun.K.S16-Apr-11 8:41
Tarun.K.S16-Apr-11 8:41 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
devvvy14-Apr-11 23:10
devvvy14-Apr-11 23:10 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
Tarun.K.S15-Apr-11 0:00
Tarun.K.S15-Apr-11 0:00 
AnswerRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
SledgeHammer0114-Apr-11 6:26
SledgeHammer0114-Apr-11 6:26 
GeneralRe: WPF virtualizingstackpanel vs Grid or StackPanel Pin
devvvy14-Apr-11 23:04
devvvy14-Apr-11 23:04 
QuestionHow to add the data from text box to already created list data item source Pin
Rocky2313-Apr-11 4:09
Rocky2313-Apr-11 4:09 

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.