|
Write-only property
Last post 02-18-2013 4:29 PM by Cassidy. 14 replies.
-
02-10-2013 10:20 AM
|
|
-
configurator


- Joined on 09-09-2012
- Posts 167
|
public bool InvokePropertyChangedEvent
{
set
{
OnPropertyChanged(new PropertyChangedEventArgs("InvokePropertyChangedEvent"));
}
}
This is called like so: x.InvokePropertyChangedEvent = true;.
Basically, they couldn't figure out how to simulate a PropertyChangedEvent without changing a property, and this is what happened.
|
|
-
-
TheCPUWizard


- Joined on 04-07-2010
- Posts 733
|
configurator: public bool InvokePropertyChangedEvent
{
set
{
OnPropertyChanged(new PropertyChangedEventArgs("InvokePropertyChangedEvent"));
}
}
This is called like so: x.InvokePropertyChangedEvent = true;.
Basically, they couldn't figure out how to simulate a PropertyChangedEvent without changing a property, and this is what happened.
Now if the property type was PropertyChangedEventArgs or even the constructor argument for same...it would be interesting...
|
|
-
-
RaceProUK


- Joined on 06-24-2010
- Reality
- Posts 162
|
configurator: public bool InvokePropertyChangedEvent
{
set
{
OnPropertyChanged(new PropertyChangedEventArgs("InvokePropertyChangedEvent"));
}
}
This is called like so: x.InvokePropertyChangedEvent = true;.
Basically, they couldn't figure out how to simulate a PropertyChangedEvent without changing a property, and this is what happened. Is OnPropertyChanged visible outside the class? I know a lot of these methods are often declared protected override or protected virtual.
[blakeyrat] NOBODY expects the Slashdot inquisition!
|
|
-
-
-
-
RaceProUK


- Joined on 06-24-2010
- Reality
- Posts 162
|
configurator: RaceProUK:Is OnPropertyChanged visible outside the class?
Does that matter? InvokePropertyChangedEvent should be a method, not a setter. Yes, it does matter.
[blakeyrat] NOBODY expects the Slashdot inquisition!
|
|
-
-
TwelveBaud


- Joined on 06-03-2008
- McLean, VA
- Posts 347
|
RaceProUK: configurator: RaceProUK:Is OnPropertyChanged visible outside the class?
Does that matter? InvokePropertyChangedEvent should be a method, not a setter.
Yes, it does matter.
If they're using the same MSDN sample code for handing PropertyChangedEvents that's been around since 2002, then no, it's protected. But either way, a) why is InvokePropertyChangedEvent a property when a method fits better with both the action and the name? b) Why don't they raise the visibility of OnPropertyChanged to public? It's in the source code... c) Why are they sending PropertyChangedEvents that say that no property they actually store a value for is changed?
|
|
-
-
RaceProUK


- Joined on 06-24-2010
- Reality
- Posts 162
|
TwelveBaud: RaceProUK: configurator: RaceProUK:Is OnPropertyChanged visible outside the class?
Does that matter? InvokePropertyChangedEvent should be a method, not a setter.
Yes, it does matter.
If they're using the same MSDN sample code for handing PropertyChangedEvents that's been around since 2002, then no, it's protected. But either way, a) why is InvokePropertyChangedEvent a property when a method fits better with both the action and the name? b) Why don't they raise the visibility of OnPropertyChanged to public? It's in the source code... c) Why are they sending PropertyChangedEvents that say that no property they actually store a value for is changed? a) The handler being tested is OnPropertyChanged, so why not? b) Because they'd have to remember to change it back again c) Because they're testing the handler without wanting to change object state
[blakeyrat] NOBODY expects the Slashdot inquisition!
|
|
-
-
-
RaceProUK


- Joined on 06-24-2010
- Reality
- Posts 162
|
TwelveBaud: RaceProUK:a) The handler being tested is OnPropertyChanged, so why not? b) Because they'd have to remember to change it back again c) Because they're testing the handler without wanting to change object state
Why are you so quick to assume that they're testing?
Who says they aren't?
[blakeyrat] NOBODY expects the Slashdot inquisition!
|
|
-
-
-
RaceProUK


- Joined on 06-24-2010
- Reality
- Posts 162
|
configurator: RaceProUK:Who says they aren't?
They aren't :-( In that case they are fools of the greatest impertinence, and must be vanquished forthwith.
[blakeyrat] NOBODY expects the Slashdot inquisition!
|
|
-
-
Cassidy


- Joined on 01-09-2012
- Posts 2,840
|
RaceProUK:In that case they are fools of the greatest impertinence, and must be vanquished forthwith. Their approach to testing suggests that Darwinism will soon sort that.
|
|
-
-
Page 1 of 1 (15 items)
|
|
|