mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-06-18 14:35:37 -04:00
Invert WatchProperty(...)
methods' watchInitialValue
This commit is contained in:
parent
281e0f608a
commit
42e6de359e
@ -65,8 +65,7 @@ public class App : Application, IDisposable
|
|||||||
};
|
};
|
||||||
|
|
||||||
InitializeTheme();
|
InitializeTheme();
|
||||||
},
|
}
|
||||||
false
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -11,15 +11,11 @@ internal static class NotifyPropertyChangedExtensions
|
|||||||
this TOwner owner,
|
this TOwner owner,
|
||||||
Expression<Func<TOwner, TProperty>> propertyExpression,
|
Expression<Func<TOwner, TProperty>> propertyExpression,
|
||||||
Action callback,
|
Action callback,
|
||||||
bool watchInitialValue = true
|
bool watchInitialValue = false
|
||||||
)
|
)
|
||||||
where TOwner : INotifyPropertyChanged
|
where TOwner : INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
var memberExpression =
|
var memberExpression = propertyExpression.Body as MemberExpression;
|
||||||
propertyExpression.Body as MemberExpression
|
|
||||||
// Property value might be boxed inside a conversion expression, if the types don't match
|
|
||||||
?? (propertyExpression.Body as UnaryExpression)?.Operand as MemberExpression;
|
|
||||||
|
|
||||||
if (memberExpression?.Member is not PropertyInfo property)
|
if (memberExpression?.Member is not PropertyInfo property)
|
||||||
throw new ArgumentException("Provided expression must reference a property.");
|
throw new ArgumentException("Provided expression must reference a property.");
|
||||||
|
|
||||||
@ -45,7 +41,7 @@ internal static class NotifyPropertyChangedExtensions
|
|||||||
public static IDisposable WatchAllProperties<TOwner>(
|
public static IDisposable WatchAllProperties<TOwner>(
|
||||||
this TOwner owner,
|
this TOwner owner,
|
||||||
Action callback,
|
Action callback,
|
||||||
bool watchInitialValues = true
|
bool watchInitialValues = false
|
||||||
)
|
)
|
||||||
where TOwner : INotifyPropertyChanged
|
where TOwner : INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user