Click here to Skip to main content
15,746,795 members

Comments by Renat Khabibulin (Top 9 by date)

Renat Khabibulin 22-Nov-11 20:10pm View    
I know difference between Invoke and BeginInvoke :) I ll try to use EventLog to understand what happens...
Renat Khabibulin 22-Nov-11 20:08pm View    
In case when I use BeginInvoke() then foreach doesn't ends because I get exception after first result returned because it's navigation properties are NULLs and I am trying to use them. I think that I will have to solve problem of thread safety after I understand why navigation properties are NULL in case of BeginInvoke()
Renat Khabibulin 17-Oct-11 16:28pm View    
Just DataGrid...ok, I ll add some sources now
Renat Khabibulin 13-Oct-11 20:13pm View    
I remove TwoWay binding from SelectedIndex to prevent changes in DataContext. I have added following code that is called each time DataContext changed:
for (int i = 0; i < Tabs.Count; i++)
if (Tabs[i].IsSelected)
SelectedIndex = i;

SelectedIndex=0 (first tab), but NOTHING IS SELECTED!
Renat Khabibulin 13-Oct-11 19:36pm View    
I have tried force OnPropertyChanged("SelectedIndex") after DataContext's changed. Doesn't help. I select any Tab and begin change DataContext's, then while this process somehow SelectedIndex = -1...I just cant understand how...Seems that DataContext is not disconnected with another ListBoxItem where TabControl doesnt't has SelectedItem. And thanks to TwoWay binding, -1 from another ListBoxItem binds to DataContext and then to current TabControl