Click here to Skip to main content
15,893,814 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: WPF TabContol problem Pin
ABitSmart17-Jun-09 2:57
ABitSmart17-Jun-09 2:57 
AnswerRe: WPF TabContol problem Pin
#realJSOP17-Jun-09 5:37
mve#realJSOP17-Jun-09 5:37 
GeneralRe: WPF TabContol problem Pin
Jacobus0117-Jun-09 20:38
Jacobus0117-Jun-09 20:38 
GeneralRe: WPF TabContol problem Pin
#realJSOP17-Jun-09 23:13
mve#realJSOP17-Jun-09 23:13 
Questionhow to use the same file in two project in visual studio Pin
bigkingjiang16-Jun-09 21:43
bigkingjiang16-Jun-09 21:43 
AnswerRe: how to use the same file in two project in visual studio - Link it Pin
ProtoBytes19-Jun-09 3:50
ProtoBytes19-Jun-09 3:50 
QuestionFrozen Property After Animating [SOLVED] Pin
#realJSOP15-Jun-09 9:26
mve#realJSOP15-Jun-09 9:26 
QuestionUpdate Databindings to Object on assignment to new Object Pin
Dan Payment15-Jun-09 7:59
Dan Payment15-Jun-09 7:59 
I'm fairly new to WPF/WCF/C# so the solution may be obvious to some experts out there.

I have a WPF application with simple TextBlocks that are bound to a custom data object that is being updating by a WCF service, the service sends me a fresh object with all new info periodically. The initial binding work fine, and when I receive a new object from the service, I want to be able to just set my object reference to that new object (not each property one at a time). This however breaks my bindings as they are still displaying the information from the previous object. If I rebind the exact same way as before, they update to the new refence.

Simple example (not perfect syntax, just to help explain):

public class MyData : INotifyPropertyChanged {
private int randomInt = [some random int]
//constructor sets randomInt to some random integer
//get set methods are here and call OnPropertyChange correctly
}

//WPF Code behind
MyData myData = new MyData;
Binding b = new Binding(); b.Source = "myData"; b.Path = "randomInt";
this.SomeTextBlock.SetBinding(TextBlock.TextProperty, b);

//all works great here
myData.randomInt = [another random int]
//also works great, TextBlock updates;
myData = new MyData(); //would create a new randomInt int with new value
//TextBlock doesn't update, if new binding is created and set it works fine
//want to be able to set myData object to a new instance of the class, but keep the bindings

I believe that on receiving a new data object, running through all the properties and setting my current data object properties to the new values would work great, but I will have many data objects coming fairly frequently so I'd rather not just set each one individually

I've explored several ideas that i had, but came up empty handed. Any ideas or tricks on if/how this could be done?
AnswerRe: Update Databindings to Object on assignment to new Object Pin
Mark Salsbery15-Jun-09 8:17
Mark Salsbery15-Jun-09 8:17 
GeneralRe: Update Databindings to Object on assignment to new Object Pin
Dan Payment15-Jun-09 9:44
Dan Payment15-Jun-09 9:44 
Questionfence-sitting : SilverLight vs. WPF : one year out ... ? Pin
BillWoodruff15-Jun-09 7:47
professionalBillWoodruff15-Jun-09 7:47 
AnswerRe: fence-sitting : SilverLight vs. WPF : one year out ... ? Pin
Mark Salsbery15-Jun-09 8:13
Mark Salsbery15-Jun-09 8:13 
GeneralRe: fence-sitting : SilverLight vs. WPF : one year out ... ? Pin
BillWoodruff15-Jun-09 9:17
professionalBillWoodruff15-Jun-09 9:17 
QuestionWPF listbox scroolbar width Pin
peterotoole15-Jun-09 4:52
peterotoole15-Jun-09 4:52 
AnswerRe: WPF listbox scroolbar width Pin
Pete O'Hanlon15-Jun-09 5:01
mvePete O'Hanlon15-Jun-09 5:01 
GeneralRe: WPF listbox scroolbar width Pin
#realJSOP17-Jun-09 5:41
mve#realJSOP17-Jun-09 5:41 
QuestionConsume huge excel sheets by WCF Services Pin
Vipul Mehta15-Jun-09 4:26
Vipul Mehta15-Jun-09 4:26 
AnswerRe: Consume huge excel sheets by WCF Services Pin
RugbyLeague15-Jun-09 10:22
RugbyLeague15-Jun-09 10:22 
QuestionGray focus comes on treeview Pin
Ravi Mori15-Jun-09 3:02
Ravi Mori15-Jun-09 3:02 
AnswerRe: Gray focus comes on treeview Pin
ABitSmart15-Jun-09 3:35
ABitSmart15-Jun-09 3:35 
GeneralRe: Gray focus comes on treeview Pin
Ravi Mori15-Jun-09 3:52
Ravi Mori15-Jun-09 3:52 
GeneralRe: Gray focus comes on treeview Pin
ABitSmart15-Jun-09 4:07
ABitSmart15-Jun-09 4:07 
QuestionCapture mouse event on slider track [modified] Pin
Christian Graus15-Jun-09 0:19
protectorChristian Graus15-Jun-09 0:19 
AnswerRe: Capture mouse event on slider track Pin
Pete O'Hanlon15-Jun-09 0:21
mvePete O'Hanlon15-Jun-09 0:21 
GeneralRe: Capture mouse event on slider track Pin
Christian Graus15-Jun-09 0:30
protectorChristian Graus15-Jun-09 0:30 

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.