Some cleanup, copyright info, etc. No features.
This commit is contained in:
Родитель
21c7c0c312
Коммит
f690ec2cf0
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="AssemblyInfo.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// <copyright file="RelayCommand.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="RelayCommandGeneric.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="DesignerLibrary.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="NotificationMessageActionGeneric.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="FeatureDetection.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="IExecuteWithObject.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="IExecuteWithObjectAndResult.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2012-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2012-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="WeakAction.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="WeakActionGeneric.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="WeakFunc.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2012-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2012-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="WeakFuncGeneric.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2012-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2012-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="ICleanup.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Copyright (c) 2009-2015 Laurent Bugnion (GalaSoft), laurent@galasoft.ch
|
||||
Copyright (c) 2009-2016 Laurent Bugnion (GalaSoft), laurent@galasoft.ch
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="DialogMessage.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// **************************************************************************
|
||||
// <copyright file="GenericMessage.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// **************************************************************************
|
||||
// <copyright file="IMessenger.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="MessageBase.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="Messenger.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="NotificationMessage.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="NotificationMessageAction.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="NotificationMessageActionGeneric.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="NotificationMessageGeneric.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="NotificationMessageWithCallback.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="PropertyChangedMessage.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="PropertyChangedMessageBase.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="ObservableObject.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2011-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2011-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="AssemblyInfo.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
@ -22,7 +22,7 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("GalaSoft Laurent Bugnion @ http://www.galasoft.ch")]
|
||||
[assembly: AssemblyProduct("GalaSoft.MvvmLight")]
|
||||
[assembly: AssemblyCopyright("Copyright © GalaSoft Laurent Bugnion 2009-2015")]
|
||||
[assembly: AssemblyCopyright("Copyright © GalaSoft Laurent Bugnion 2009-2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="ViewModelBase.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="IDialogService.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="INavigationService.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="ISimpleIoc.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2011-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2011-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="PreferredConstructor.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2011-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2011-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="SimpleIoc.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2011-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2011-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="AssemblyInfo.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
@ -23,7 +23,7 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("GalaSoft Laurent Bugnion @ http://www.galasoft.ch")]
|
||||
[assembly: AssemblyProduct("GalaSoft.MvvmLight.Extras")]
|
||||
[assembly: AssemblyCopyright("Copyright © GalaSoft Laurent Bugnion 2009-2015")]
|
||||
[assembly: AssemblyCopyright("Copyright © GalaSoft Laurent Bugnion 2009-2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="Binding.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="BindingGeneric.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
@ -1326,14 +1326,13 @@ namespace GalaSoft.MvvmLight.Helpers
|
|||
{
|
||||
private readonly WeakReference _bindingReference;
|
||||
private readonly bool _updateFromSourceToTarget;
|
||||
private readonly WeakReference _instanceReference;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the instance that this listener listens to.
|
||||
/// </summary>
|
||||
public WeakReference InstanceReference
|
||||
{
|
||||
get
|
||||
{
|
||||
return _instanceReference;
|
||||
}
|
||||
get;
|
||||
}
|
||||
|
||||
public PropertyChangedEventListener(
|
||||
|
@ -1343,7 +1342,7 @@ namespace GalaSoft.MvvmLight.Helpers
|
|||
{
|
||||
_updateFromSourceToTarget = updateFromSourceToTarget;
|
||||
_bindingReference = new WeakReference(binding);
|
||||
_instanceReference = new WeakReference(instance);
|
||||
InstanceReference = new WeakReference(instance);
|
||||
}
|
||||
|
||||
public bool ReceiveWeakEvent(Type managerType, object sender, EventArgs e)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="BindingGenericAndroid.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="BindingMode.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="Extensions.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
@ -55,6 +55,9 @@ namespace GalaSoft.MvvmLight.Helpers
|
|||
/// if the PropertyChanged event is raised by the source, the target property will be updated. TwoWay means that the source
|
||||
/// property will also be updated if the target raises the PropertyChanged event. Default means OneWay if only the source
|
||||
/// implements INPC, and TwoWay if both the source and the target implement INPC.</param>
|
||||
/// <param name="fallbackValue">The value to use when the binding is unable to return a value. This can happen if one of the
|
||||
/// items on the Path (except the source property itself) is null, or if the Converter throws an exception.</param>
|
||||
/// <param name="targetNullValue">The value used when the source property is null (or equals to default(TSource)).</param>
|
||||
/// <returns>The new Binding instance.</returns>
|
||||
public static Binding<TSource, TTarget> SetBinding<TSource, TTarget>(
|
||||
this object source,
|
||||
|
@ -90,6 +93,9 @@ namespace GalaSoft.MvvmLight.Helpers
|
|||
/// if the PropertyChanged event is raised by the source, the target property will be updated. TwoWay means that the source
|
||||
/// property will also be updated if the target raises the PropertyChanged event. Default means OneWay if only the source
|
||||
/// implements INPC, and TwoWay if both the source and the target implement INPC.</param>
|
||||
/// <param name="fallbackValue">The value to use when the binding is unable to return a value. This can happen if one of the
|
||||
/// items on the Path (except the source property itself) is null, or if the Converter throws an exception.</param>
|
||||
/// <param name="targetNullValue">The value used when the source property is null (or equals to default(TSource)).</param>
|
||||
/// <typeparam name="TSource">The type of the bound property.</typeparam>
|
||||
/// <returns>The created binding instance.</returns>
|
||||
public static Binding<TSource, TSource> SetBinding<TSource>(
|
||||
|
@ -131,6 +137,9 @@ namespace GalaSoft.MvvmLight.Helpers
|
|||
/// if the PropertyChanged event is raised by the source, the target property will be updated. TwoWay means that the source
|
||||
/// property will also be updated if the target raises the PropertyChanged event. Default means OneWay if only the source
|
||||
/// implements INPC, and TwoWay if both the source and the target implement INPC.</param>
|
||||
/// <param name="fallbackValue">The value to use when the binding is unable to return a value. This can happen if one of the
|
||||
/// items on the Path (except the source property itself) is null, or if the Converter throws an exception.</param>
|
||||
/// <param name="targetNullValue">The value used when the source property is null (or equals to default(TSource)).</param>
|
||||
/// <returns>The new Binding instance.</returns>
|
||||
public static Binding<TSource, TTarget> SetBinding<TSource, TTarget>(
|
||||
this object source,
|
||||
|
@ -172,6 +181,9 @@ namespace GalaSoft.MvvmLight.Helpers
|
|||
/// if the PropertyChanged event is raised by the source, the target property will be updated. TwoWay means that the source
|
||||
/// property will also be updated if the target raises the PropertyChanged event. Default means OneWay if only the source
|
||||
/// implements INPC, and TwoWay if both the source and the target implement INPC.</param>
|
||||
/// <param name="fallbackValue">The value to use when the binding is unable to return a value. This can happen if one of the
|
||||
/// items on the Path (except the source property itself) is null, or if the Converter throws an exception.</param>
|
||||
/// <param name="targetNullValue">The value used when the source property is null (or equals to default(TSource)).</param>
|
||||
/// <returns>The new Binding instance.</returns>
|
||||
public static Binding<TSource, TTarget> SetBinding<TSource, TTarget>(
|
||||
this object source,
|
||||
|
@ -212,6 +224,9 @@ namespace GalaSoft.MvvmLight.Helpers
|
|||
/// if the PropertyChanged event is raised by the source, the target property will be updated. TwoWay means that the source
|
||||
/// property will also be updated if the target raises the PropertyChanged event. Default means OneWay if only the source
|
||||
/// implements INPC, and TwoWay if both the source and the target implement INPC.</param>
|
||||
/// <param name="fallbackValue">The value to use when the binding is unable to return a value. This can happen if one of the
|
||||
/// items on the Path (except the source property itself) is null, or if the Converter throws an exception.</param>
|
||||
/// <param name="targetNullValue">The value used when the source property is null (or equals to default(TSource)).</param>
|
||||
/// <returns>The new Binding instance.</returns>
|
||||
public static Binding<TSource, TTarget> SetBinding<TSource, TTarget>(
|
||||
this object source,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="IWeakEventListener.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="ObservableAdapter.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="PropertyChangedEventManager.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="UpdateTriggerMode.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="DispatcherHelper.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="ActivityBase.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
@ -13,7 +13,6 @@
|
|||
// </license>
|
||||
// ****************************************************************************
|
||||
|
||||
using System;
|
||||
using Android.App;
|
||||
|
||||
namespace GalaSoft.MvvmLight.Views
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="DialogService.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="NavigationService.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="EventToCommand.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="IEventArgsConverter.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="AssemblyInfo.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
@ -30,7 +30,7 @@ using System.Windows.Markup;
|
|||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("GalaSoft Laurent Bugnion @ http://www.galasoft.ch")]
|
||||
[assembly: AssemblyProduct("GalaSoft.MvvmLight.Platform")]
|
||||
[assembly: AssemblyCopyright("Copyright © GalaSoft Laurent Bugnion 2009-2015")]
|
||||
[assembly: AssemblyCopyright("Copyright © GalaSoft Laurent Bugnion 2009-2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="DispatcherHelper.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="DialogService.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="NavigationService.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="DialogService.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="NavigationService.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="BindingGenericApple.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="ObservableTableViewController.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="DispatcherHelper.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="DialogService.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
@ -207,11 +207,8 @@ namespace GalaSoft.MvvmLight.Views
|
|||
title,
|
||||
message,
|
||||
null,
|
||||
buttonCancelText,
|
||||
new[]
|
||||
{
|
||||
buttonConfirmText
|
||||
});
|
||||
buttonCancelText,
|
||||
buttonConfirmText);
|
||||
|
||||
av.Dismissed += (s, e) =>
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// ****************************************************************************
|
||||
// <copyright file="NavigationService.cs" company="GalaSoft Laurent Bugnion">
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2015
|
||||
// Copyright © GalaSoft Laurent Bugnion 2009-2016
|
||||
// </copyright>
|
||||
// ****************************************************************************
|
||||
// <author>Laurent Bugnion</author>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using GalaSoft.MvvmLight.Helpers;
|
||||
using GalaSoft.MvvmLight.Test.ViewModel;
|
||||
using NUnit.Framework;
|
||||
|
||||
|
@ -9,6 +10,8 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class BindingDeepPathTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
public TestViewModel VmSource
|
||||
{
|
||||
get;
|
||||
|
@ -21,69 +24,6 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
private set;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void BindingDeepPath_DeepSourceSetPath_NoError()
|
||||
{
|
||||
VmSource = new TestViewModel
|
||||
{
|
||||
Nested = new TestViewModel
|
||||
{
|
||||
Nested = new TestViewModel
|
||||
{
|
||||
Model = new TestModel
|
||||
{
|
||||
MyProperty = "Initial value"
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
VmSource,
|
||||
() => VmSource.Nested.Nested.Model.MyProperty,
|
||||
VmTarget,
|
||||
() => VmTarget.TargetProperty);
|
||||
|
||||
Assert.AreEqual(VmSource.Nested.Nested.Model.MyProperty, VmTarget.TargetProperty);
|
||||
var newValue = DateTime.Now.Ticks.ToString();
|
||||
VmSource.Nested.Nested.Model.MyProperty = newValue;
|
||||
Assert.AreEqual(VmSource.Nested.Nested.Model.MyProperty, VmTarget.TargetProperty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void BindingDeepPath_DeepSourceExistingPathGraduallySettingPath_NoError()
|
||||
{
|
||||
VmSource = new TestViewModel();
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
const string fallback = "This is the fallback";
|
||||
const string targetNull = "Target is null";
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
VmSource,
|
||||
() => VmSource.Nested.Nested.Model.MyProperty,
|
||||
VmTarget,
|
||||
() => VmTarget.TargetProperty,
|
||||
fallbackValue: fallback,
|
||||
targetNullValue: targetNull);
|
||||
|
||||
Assert.AreEqual(fallback, VmTarget.TargetProperty);
|
||||
VmSource.Nested = new TestViewModel();
|
||||
Assert.AreEqual(fallback, VmTarget.TargetProperty);
|
||||
VmSource.Nested.Nested = new TestViewModel();
|
||||
Assert.AreEqual(fallback, VmTarget.TargetProperty);
|
||||
VmSource.Nested.Nested.Model = new TestModel();
|
||||
Assert.AreEqual(targetNull, VmTarget.TargetProperty);
|
||||
var initialValue = "Initial value";
|
||||
VmSource.Nested.Nested.Model.MyProperty = initialValue;
|
||||
Assert.AreEqual(initialValue, VmTarget.TargetProperty);
|
||||
var newValue = DateTime.Now.Ticks.ToString();
|
||||
VmSource.Nested.Nested.Model.MyProperty = newValue;
|
||||
Assert.AreEqual(newValue, VmTarget.TargetProperty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void BindingDeepPath_DeepSourceExistingPathChangingObjects_NoError()
|
||||
{
|
||||
|
@ -103,7 +43,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
VmSource,
|
||||
() => VmSource.Nested.Nested.Model.MyProperty,
|
||||
VmTarget,
|
||||
|
@ -156,67 +96,68 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
Assert.AreEqual(value5, VmTarget.TargetProperty);
|
||||
}
|
||||
|
||||
|
||||
[Test]
|
||||
public void BindingDeepPath_DeepTargetSetPath_NoError()
|
||||
public void BindingDeepPath_DeepSourceExistingPathGraduallySettingPath_NoError()
|
||||
{
|
||||
VmTarget = new TestViewModel
|
||||
VmSource = new TestViewModel();
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
const string fallback = "This is the fallback";
|
||||
const string targetNull = "Target is null";
|
||||
|
||||
_binding = new Binding<string, string>(
|
||||
VmSource,
|
||||
() => VmSource.Nested.Nested.Model.MyProperty,
|
||||
VmTarget,
|
||||
() => VmTarget.TargetProperty,
|
||||
fallbackValue: fallback,
|
||||
targetNullValue: targetNull);
|
||||
|
||||
Assert.AreEqual(fallback, VmTarget.TargetProperty);
|
||||
VmSource.Nested = new TestViewModel();
|
||||
Assert.AreEqual(fallback, VmTarget.TargetProperty);
|
||||
VmSource.Nested.Nested = new TestViewModel();
|
||||
Assert.AreEqual(fallback, VmTarget.TargetProperty);
|
||||
VmSource.Nested.Nested.Model = new TestModel();
|
||||
Assert.AreEqual(targetNull, VmTarget.TargetProperty);
|
||||
var initialValue = "Initial value";
|
||||
VmSource.Nested.Nested.Model.MyProperty = initialValue;
|
||||
Assert.AreEqual(initialValue, VmTarget.TargetProperty);
|
||||
var newValue = DateTime.Now.Ticks.ToString();
|
||||
VmSource.Nested.Nested.Model.MyProperty = newValue;
|
||||
Assert.AreEqual(newValue, VmTarget.TargetProperty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void BindingDeepPath_DeepSourceSetPath_NoError()
|
||||
{
|
||||
VmSource = new TestViewModel
|
||||
{
|
||||
Nested = new TestViewModel
|
||||
{
|
||||
Nested = new TestViewModel
|
||||
{
|
||||
Nested = new TestViewModel()
|
||||
Model = new TestModel
|
||||
{
|
||||
MyProperty = "Initial value"
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
VmSource = new TestViewModel
|
||||
{
|
||||
Model = new TestModel
|
||||
{
|
||||
MyProperty = "Initial value"
|
||||
}
|
||||
};
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
VmSource,
|
||||
() => VmSource.Model.MyProperty,
|
||||
VmTarget,
|
||||
() => VmTarget.Nested.Nested.Nested.TargetProperty);
|
||||
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, VmTarget.Nested.Nested.Nested.TargetProperty);
|
||||
var newValue = DateTime.Now.Ticks.ToString();
|
||||
VmSource.Model.MyProperty = newValue;
|
||||
Assert.AreEqual(newValue, VmTarget.Nested.Nested.Nested.TargetProperty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void BindingDeepPath_DeepTargetExistingPathGraduallySettingPath_NoError()
|
||||
{
|
||||
VmSource = new TestViewModel
|
||||
{
|
||||
Model = new TestModel
|
||||
{
|
||||
MyProperty = "Initial value"
|
||||
}
|
||||
};
|
||||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
VmSource,
|
||||
() => VmSource.Model.MyProperty,
|
||||
() => VmSource.Nested.Nested.Model.MyProperty,
|
||||
VmTarget,
|
||||
() => VmTarget.Nested.Nested.Nested.TargetProperty);
|
||||
() => VmTarget.TargetProperty);
|
||||
|
||||
VmTarget.Nested = new TestViewModel();
|
||||
VmTarget.Nested.Nested = new TestViewModel();
|
||||
VmTarget.Nested.Nested.Nested = new TestViewModel();
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, VmTarget.Nested.Nested.Nested.TargetProperty);
|
||||
Assert.AreEqual(VmSource.Nested.Nested.Model.MyProperty, VmTarget.TargetProperty);
|
||||
var newValue = DateTime.Now.Ticks.ToString();
|
||||
VmSource.Model.MyProperty = newValue;
|
||||
Assert.AreEqual(newValue, VmTarget.Nested.Nested.Nested.TargetProperty);
|
||||
VmSource.Nested.Nested.Model.MyProperty = newValue;
|
||||
Assert.AreEqual(VmSource.Nested.Nested.Model.MyProperty, VmTarget.TargetProperty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -241,7 +182,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
}
|
||||
};
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
VmSource,
|
||||
() => VmSource.Model.MyProperty,
|
||||
VmTarget,
|
||||
|
@ -273,5 +214,72 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
Assert.AreEqual(newValue, VmTarget.Nested.Nested.Nested.TargetProperty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void BindingDeepPath_DeepTargetExistingPathGraduallySettingPath_NoError()
|
||||
{
|
||||
VmSource = new TestViewModel
|
||||
{
|
||||
Model = new TestModel
|
||||
{
|
||||
MyProperty = "Initial value"
|
||||
}
|
||||
};
|
||||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
_binding = new Binding<string, string>(
|
||||
VmSource,
|
||||
() => VmSource.Model.MyProperty,
|
||||
VmTarget,
|
||||
() => VmTarget.Nested.Nested.Nested.TargetProperty);
|
||||
|
||||
VmTarget.Nested = new TestViewModel
|
||||
{
|
||||
Nested = new TestViewModel
|
||||
{
|
||||
Nested = new TestViewModel()
|
||||
}
|
||||
};
|
||||
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, VmTarget.Nested.Nested.Nested.TargetProperty);
|
||||
var newValue = DateTime.Now.Ticks.ToString();
|
||||
VmSource.Model.MyProperty = newValue;
|
||||
Assert.AreEqual(newValue, VmTarget.Nested.Nested.Nested.TargetProperty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void BindingDeepPath_DeepTargetSetPath_NoError()
|
||||
{
|
||||
VmTarget = new TestViewModel
|
||||
{
|
||||
Nested = new TestViewModel
|
||||
{
|
||||
Nested = new TestViewModel
|
||||
{
|
||||
Nested = new TestViewModel()
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
VmSource = new TestViewModel
|
||||
{
|
||||
Model = new TestModel
|
||||
{
|
||||
MyProperty = "Initial value"
|
||||
}
|
||||
};
|
||||
|
||||
_binding = new Binding<string, string>(
|
||||
VmSource,
|
||||
() => VmSource.Model.MyProperty,
|
||||
VmTarget,
|
||||
() => VmTarget.Nested.Nested.Nested.TargetProperty);
|
||||
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, VmTarget.Nested.Nested.Nested.TargetProperty);
|
||||
var newValue = DateTime.Now.Ticks.ToString();
|
||||
VmSource.Model.MyProperty = newValue;
|
||||
Assert.AreEqual(newValue, VmTarget.Nested.Nested.Nested.TargetProperty);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using GalaSoft.MvvmLight.Helpers;
|
||||
using GalaSoft.MvvmLight.Test.Controls;
|
||||
using GalaSoft.MvvmLight.Test.ViewModel;
|
||||
using NUnit.Framework;
|
||||
|
||||
|
@ -9,6 +8,7 @@ using NUnit.Framework;
|
|||
using Android.App;
|
||||
using Android.Widget;
|
||||
#elif __IOS__
|
||||
using GalaSoft.MvvmLight.Test.Controls;
|
||||
#endif
|
||||
|
||||
namespace GalaSoft.MvvmLight.Test.Binding
|
||||
|
@ -17,6 +17,8 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class BindingSourceControlTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
#if ANDROID
|
||||
public EditText _source;
|
||||
private EditText _sourcePrivate;
|
||||
|
@ -66,7 +68,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
Source,
|
||||
() => Source.Text,
|
||||
VmTarget,
|
||||
|
@ -89,7 +91,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
SourcePrivate,
|
||||
() => SourcePrivate.Text,
|
||||
VmTarget,
|
||||
|
@ -112,7 +114,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
_source,
|
||||
() => _source.Text,
|
||||
VmTarget,
|
||||
|
@ -135,7 +137,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
_sourcePrivate,
|
||||
() => _sourcePrivate.Text,
|
||||
VmTarget,
|
||||
|
@ -158,7 +160,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
source,
|
||||
() => source.Text,
|
||||
VmTarget,
|
||||
|
@ -181,7 +183,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = this.SetBinding(
|
||||
_binding = this.SetBinding(
|
||||
() => Source.Text,
|
||||
() => VmTarget.TargetProperty);
|
||||
|
||||
|
@ -202,7 +204,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = this.SetBinding(
|
||||
_binding = this.SetBinding(
|
||||
() => SourcePrivate.Text,
|
||||
() => VmTarget.TargetProperty);
|
||||
|
||||
|
@ -223,7 +225,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = this.SetBinding(
|
||||
_binding = this.SetBinding(
|
||||
() => _source.Text,
|
||||
() => VmTarget.TargetProperty);
|
||||
|
||||
|
@ -244,7 +246,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = this.SetBinding(
|
||||
_binding = this.SetBinding(
|
||||
() => _sourcePrivate.Text,
|
||||
() => VmTarget.TargetProperty);
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
public class BindingSourceTest
|
||||
{
|
||||
public TestViewModel _vmSource;
|
||||
private Helpers.Binding _binding;
|
||||
private TestViewModel _vmSourcePrivate;
|
||||
|
||||
public TestViewModel VmSource
|
||||
|
@ -19,22 +20,22 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
private set;
|
||||
}
|
||||
|
||||
public TestViewModel VmTarget
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
private TestViewModel VmSourcePrivate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public TestViewModel VmTarget
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void BindingSource_NewBindingWithPublicProperty_NoError()
|
||||
public void BindingSource_NewBindingWithPrivateField_NoError()
|
||||
{
|
||||
VmSource = new TestViewModel
|
||||
_vmSourcePrivate = new TestViewModel
|
||||
{
|
||||
Model = new TestModel
|
||||
{
|
||||
|
@ -44,16 +45,16 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
VmSource,
|
||||
() => VmSource.Model.MyProperty,
|
||||
_binding = new Binding<string, string>(
|
||||
_vmSourcePrivate,
|
||||
() => _vmSourcePrivate.Model.MyProperty,
|
||||
VmTarget,
|
||||
() => VmTarget.TargetProperty);
|
||||
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, VmTarget.TargetProperty);
|
||||
Assert.AreEqual(_vmSourcePrivate.Model.MyProperty, VmTarget.TargetProperty);
|
||||
var newValue = DateTime.Now.Ticks.ToString();
|
||||
VmSource.Model.MyProperty = newValue;
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, VmTarget.TargetProperty);
|
||||
_vmSourcePrivate.Model.MyProperty = newValue;
|
||||
Assert.AreEqual(_vmSourcePrivate.Model.MyProperty, VmTarget.TargetProperty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -71,7 +72,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var vmTarget = new TestViewModel();
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vmSource,
|
||||
() => vmSource.Model.MyProperty,
|
||||
vmTarget,
|
||||
|
@ -94,7 +95,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
VmSourcePrivate,
|
||||
() => VmSourcePrivate.Model.MyProperty,
|
||||
VmTarget,
|
||||
|
@ -119,7 +120,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
_vmSource,
|
||||
() => _vmSource.Model.MyProperty,
|
||||
VmTarget,
|
||||
|
@ -132,9 +133,9 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void BindingSource_NewBindingWithPrivateField_NoError()
|
||||
public void BindingSource_NewBindingWithPublicProperty_NoError()
|
||||
{
|
||||
_vmSourcePrivate = new TestViewModel
|
||||
VmSource = new TestViewModel
|
||||
{
|
||||
Model = new TestModel
|
||||
{
|
||||
|
@ -144,16 +145,16 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_vmSourcePrivate,
|
||||
() => _vmSourcePrivate.Model.MyProperty,
|
||||
_binding = new Binding<string, string>(
|
||||
VmSource,
|
||||
() => VmSource.Model.MyProperty,
|
||||
VmTarget,
|
||||
() => VmTarget.TargetProperty);
|
||||
|
||||
Assert.AreEqual(_vmSourcePrivate.Model.MyProperty, VmTarget.TargetProperty);
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, VmTarget.TargetProperty);
|
||||
var newValue = DateTime.Now.Ticks.ToString();
|
||||
_vmSourcePrivate.Model.MyProperty = newValue;
|
||||
Assert.AreEqual(_vmSourcePrivate.Model.MyProperty, VmTarget.TargetProperty);
|
||||
VmSource.Model.MyProperty = newValue;
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, VmTarget.TargetProperty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -169,7 +170,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vmSource,
|
||||
() => vmSource.Model.MyProperty,
|
||||
VmTarget,
|
||||
|
@ -182,9 +183,9 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void BindingSource_SetBindingWithPublicProperty_NoError()
|
||||
public void BindingSource_SetBindingWithPrivateField_NoError()
|
||||
{
|
||||
VmSource = new TestViewModel
|
||||
_vmSourcePrivate = new TestViewModel
|
||||
{
|
||||
Model = new TestModel
|
||||
{
|
||||
|
@ -194,14 +195,14 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = this.SetBinding(
|
||||
() => VmSource.Model.MyProperty,
|
||||
_binding = this.SetBinding(
|
||||
() => _vmSourcePrivate.Model.MyProperty,
|
||||
() => VmTarget.TargetProperty);
|
||||
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, VmTarget.TargetProperty);
|
||||
Assert.AreEqual(_vmSourcePrivate.Model.MyProperty, VmTarget.TargetProperty);
|
||||
var newValue = DateTime.Now.Ticks.ToString();
|
||||
VmSource.Model.MyProperty = newValue;
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, VmTarget.TargetProperty);
|
||||
_vmSourcePrivate.Model.MyProperty = newValue;
|
||||
Assert.AreEqual(_vmSourcePrivate.Model.MyProperty, VmTarget.TargetProperty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -217,7 +218,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = this.SetBinding(
|
||||
_binding = this.SetBinding(
|
||||
() => VmSourcePrivate.Model.MyProperty,
|
||||
() => VmTarget.TargetProperty);
|
||||
|
||||
|
@ -240,7 +241,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = this.SetBinding(
|
||||
_binding = this.SetBinding(
|
||||
() => _vmSource.Model.MyProperty,
|
||||
() => VmTarget.TargetProperty);
|
||||
|
||||
|
@ -251,9 +252,9 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void BindingSource_SetBindingWithPrivateField_NoError()
|
||||
public void BindingSource_SetBindingWithPublicProperty_NoError()
|
||||
{
|
||||
_vmSourcePrivate = new TestViewModel
|
||||
VmSource = new TestViewModel
|
||||
{
|
||||
Model = new TestModel
|
||||
{
|
||||
|
@ -263,14 +264,14 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = this.SetBinding(
|
||||
() => _vmSourcePrivate.Model.MyProperty,
|
||||
_binding = this.SetBinding(
|
||||
() => VmSource.Model.MyProperty,
|
||||
() => VmTarget.TargetProperty);
|
||||
|
||||
Assert.AreEqual(_vmSourcePrivate.Model.MyProperty, VmTarget.TargetProperty);
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, VmTarget.TargetProperty);
|
||||
var newValue = DateTime.Now.Ticks.ToString();
|
||||
_vmSourcePrivate.Model.MyProperty = newValue;
|
||||
Assert.AreEqual(_vmSourcePrivate.Model.MyProperty, VmTarget.TargetProperty);
|
||||
VmSource.Model.MyProperty = newValue;
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, VmTarget.TargetProperty);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using GalaSoft.MvvmLight.Helpers;
|
||||
using GalaSoft.MvvmLight.Test.Controls;
|
||||
using GalaSoft.MvvmLight.Test.ViewModel;
|
||||
using NUnit.Framework;
|
||||
|
||||
|
@ -9,6 +8,7 @@ using NUnit.Framework;
|
|||
using Android.App;
|
||||
using Android.Widget;
|
||||
#elif __IOS__
|
||||
using GalaSoft.MvvmLight.Test.Controls;
|
||||
#endif
|
||||
|
||||
namespace GalaSoft.MvvmLight.Test.Binding
|
||||
|
@ -17,6 +17,8 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class BindingTargetControlTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
#if ANDROID
|
||||
public EditText _target;
|
||||
private EditText _targetPrivate;
|
||||
|
@ -72,7 +74,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
Target = new UITextViewEx();
|
||||
#endif
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
VmSource,
|
||||
() => VmSource.Model.MyProperty,
|
||||
Target,
|
||||
|
@ -101,7 +103,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
TargetPrivate = new UITextViewEx();
|
||||
#endif
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
VmSource,
|
||||
() => VmSource.Model.MyProperty,
|
||||
TargetPrivate,
|
||||
|
@ -130,7 +132,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
_target = new UITextViewEx();
|
||||
#endif
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
VmSource,
|
||||
() => VmSource.Model.MyProperty,
|
||||
_target,
|
||||
|
@ -159,7 +161,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
_targetPrivate = new UITextViewEx();
|
||||
#endif
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
VmSource,
|
||||
() => VmSource.Model.MyProperty,
|
||||
_targetPrivate,
|
||||
|
@ -188,7 +190,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var target = new UITextViewEx();
|
||||
#endif
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
VmSource,
|
||||
() => VmSource.Model.MyProperty,
|
||||
target,
|
||||
|
@ -217,7 +219,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
Target = new UITextViewEx();
|
||||
#endif
|
||||
|
||||
var binding = this.SetBinding(
|
||||
_binding = this.SetBinding(
|
||||
() => VmSource.Model.MyProperty,
|
||||
() => Target.Text);
|
||||
|
||||
|
@ -244,7 +246,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
TargetPrivate = new UITextViewEx();
|
||||
#endif
|
||||
|
||||
var binding = this.SetBinding(
|
||||
_binding = this.SetBinding(
|
||||
() => VmSource.Model.MyProperty,
|
||||
() => TargetPrivate.Text);
|
||||
|
||||
|
@ -271,7 +273,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
_target = new UITextViewEx();
|
||||
#endif
|
||||
|
||||
var binding = this.SetBinding(
|
||||
_binding = this.SetBinding(
|
||||
() => VmSource.Model.MyProperty,
|
||||
() => _target.Text);
|
||||
|
||||
|
@ -298,7 +300,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
_targetPrivate = new UITextViewEx();
|
||||
#endif
|
||||
|
||||
var binding = this.SetBinding(
|
||||
_binding = this.SetBinding(
|
||||
() => VmSource.Model.MyProperty,
|
||||
() => _targetPrivate.Text);
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
public class BindingTargetTest
|
||||
{
|
||||
public TestViewModel _vmTarget;
|
||||
private Helpers.Binding _binding;
|
||||
private TestViewModel _vmTargetPrivate;
|
||||
|
||||
public TestViewModel VmSource
|
||||
|
@ -19,20 +20,20 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
private set;
|
||||
}
|
||||
|
||||
public TestViewModel VmTarget
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
private TestViewModel VmTargetPrivate
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public TestViewModel VmTarget
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void BindingTarget_NewBindingWithPublicProperty_NoError()
|
||||
public void BindingTarget_NewBindingWithPrivateField_NoError()
|
||||
{
|
||||
VmSource = new TestViewModel
|
||||
{
|
||||
|
@ -42,18 +43,18 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
}
|
||||
};
|
||||
|
||||
VmTarget = new TestViewModel();
|
||||
_vmTargetPrivate = new TestViewModel();
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
VmSource,
|
||||
() => VmSource.Model.MyProperty,
|
||||
VmTarget,
|
||||
() => VmTarget.TargetProperty);
|
||||
_vmTargetPrivate,
|
||||
() => _vmTargetPrivate.TargetProperty);
|
||||
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, VmTarget.TargetProperty);
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, _vmTargetPrivate.TargetProperty);
|
||||
var newValue = DateTime.Now.Ticks.ToString();
|
||||
VmSource.Model.MyProperty = newValue;
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, VmTarget.TargetProperty);
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, _vmTargetPrivate.TargetProperty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -69,7 +70,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
VmTargetPrivate = new TestViewModel();
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
VmSource,
|
||||
() => VmSource.Model.MyProperty,
|
||||
VmTargetPrivate,
|
||||
|
@ -94,7 +95,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
_vmTarget = new TestViewModel();
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
VmSource,
|
||||
() => VmSource.Model.MyProperty,
|
||||
_vmTarget,
|
||||
|
@ -107,7 +108,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void BindingTarget_NewBindingWithPrivateField_NoError()
|
||||
public void BindingTarget_NewBindingWithPublicProperty_NoError()
|
||||
{
|
||||
VmSource = new TestViewModel
|
||||
{
|
||||
|
@ -117,18 +118,18 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
}
|
||||
};
|
||||
|
||||
_vmTargetPrivate = new TestViewModel();
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
VmSource,
|
||||
() => VmSource.Model.MyProperty,
|
||||
_vmTargetPrivate,
|
||||
() => _vmTargetPrivate.TargetProperty);
|
||||
VmTarget,
|
||||
() => VmTarget.TargetProperty);
|
||||
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, _vmTargetPrivate.TargetProperty);
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, VmTarget.TargetProperty);
|
||||
var newValue = DateTime.Now.Ticks.ToString();
|
||||
VmSource.Model.MyProperty = newValue;
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, _vmTargetPrivate.TargetProperty);
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, VmTarget.TargetProperty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -144,7 +145,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var vmTarget = new TestViewModel();
|
||||
|
||||
var binding = new Helpers.Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
VmSource,
|
||||
() => VmSource.Model.MyProperty,
|
||||
vmTarget,
|
||||
|
@ -157,7 +158,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void BindingTarget_SetBindingWithPublicProperty_NoError()
|
||||
public void BindingTarget_SetBindingWithPrivateField_NoError()
|
||||
{
|
||||
VmSource = new TestViewModel
|
||||
{
|
||||
|
@ -167,16 +168,16 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
}
|
||||
};
|
||||
|
||||
VmTarget = new TestViewModel();
|
||||
_vmTargetPrivate = new TestViewModel();
|
||||
|
||||
var binding = this.SetBinding(
|
||||
_binding = this.SetBinding(
|
||||
() => VmSource.Model.MyProperty,
|
||||
() => VmTarget.TargetProperty);
|
||||
() => _vmTargetPrivate.TargetProperty);
|
||||
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, VmTarget.TargetProperty);
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, _vmTargetPrivate.TargetProperty);
|
||||
var newValue = DateTime.Now.Ticks.ToString();
|
||||
VmSource.Model.MyProperty = newValue;
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, VmTarget.TargetProperty);
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, _vmTargetPrivate.TargetProperty);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -192,7 +193,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
VmTargetPrivate = new TestViewModel();
|
||||
|
||||
var binding = this.SetBinding(
|
||||
_binding = this.SetBinding(
|
||||
() => VmSource.Model.MyProperty,
|
||||
() => VmTargetPrivate.TargetProperty);
|
||||
|
||||
|
@ -215,7 +216,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
_vmTarget = new TestViewModel();
|
||||
|
||||
var binding = this.SetBinding(
|
||||
_binding = this.SetBinding(
|
||||
() => VmSource.Model.MyProperty,
|
||||
() => _vmTarget.TargetProperty);
|
||||
|
||||
|
@ -226,7 +227,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void BindingTarget_SetBindingWithPrivateField_NoError()
|
||||
public void BindingTarget_SetBindingWithPublicProperty_NoError()
|
||||
{
|
||||
VmSource = new TestViewModel
|
||||
{
|
||||
|
@ -236,16 +237,16 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
}
|
||||
};
|
||||
|
||||
_vmTargetPrivate = new TestViewModel();
|
||||
VmTarget = new TestViewModel();
|
||||
|
||||
var binding = this.SetBinding(
|
||||
_binding = this.SetBinding(
|
||||
() => VmSource.Model.MyProperty,
|
||||
() => _vmTargetPrivate.TargetProperty);
|
||||
() => VmTarget.TargetProperty);
|
||||
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, _vmTargetPrivate.TargetProperty);
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, VmTarget.TargetProperty);
|
||||
var newValue = DateTime.Now.Ticks.ToString();
|
||||
VmSource.Model.MyProperty = newValue;
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, _vmTargetPrivate.TargetProperty);
|
||||
Assert.AreEqual(VmSource.Model.MyProperty, VmTarget.TargetProperty);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using GalaSoft.MvvmLight.Helpers;
|
||||
using GalaSoft.MvvmLight.Test.Controls;
|
||||
using GalaSoft.MvvmLight.Test.ViewModel;
|
||||
using NUnit.Framework;
|
||||
|
||||
|
@ -9,6 +8,7 @@ using NUnit.Framework;
|
|||
using Android.App;
|
||||
using Android.Widget;
|
||||
#elif __IOS__
|
||||
using GalaSoft.MvvmLight.Test.Controls;
|
||||
using UIKit;
|
||||
#endif
|
||||
|
||||
|
@ -97,7 +97,9 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void Binding_MultipleLevelsOfNullWithConverter_ShouldCallConverterWithNullThenTargetNullValueButNotFallbackValue()
|
||||
public void
|
||||
Binding_MultipleLevelsOfNullWithConverter_ShouldCallConverterWithNullThenTargetNullValueButNotFallbackValue(
|
||||
)
|
||||
{
|
||||
var vmSource = new TestViewModel();
|
||||
var vmTarget = new TestViewModel();
|
||||
|
|
|
@ -2,7 +2,6 @@ using System;
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using GalaSoft.MvvmLight.Helpers;
|
||||
using GalaSoft.MvvmLight.Test.Controls;
|
||||
using GalaSoft.MvvmLight.Test.ViewModel;
|
||||
using NUnit.Framework;
|
||||
|
||||
|
@ -10,6 +9,7 @@ using NUnit.Framework;
|
|||
using Android.App;
|
||||
using Android.Widget;
|
||||
#elif __IOS__
|
||||
using GalaSoft.MvvmLight.Test.Controls;
|
||||
using UIKit;
|
||||
#endif
|
||||
|
||||
|
@ -19,6 +19,8 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class ConverterTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
public TestViewModel Vm
|
||||
{
|
||||
get;
|
||||
|
@ -117,7 +119,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var vmTarget = new TestViewModel();
|
||||
|
||||
var binding = new Binding<string, DateTime>(
|
||||
_binding = new Binding<string, DateTime>(
|
||||
vmSource,
|
||||
() => vmSource.Model.MyProperty,
|
||||
vmTarget,
|
||||
|
@ -196,7 +198,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var vmTarget = new TestViewModel();
|
||||
|
||||
var binding = new Binding<string, DateTime>(
|
||||
_binding = new Binding<string, DateTime>(
|
||||
vmSource,
|
||||
() => vmSource.Model.MyProperty,
|
||||
vmTarget,
|
||||
|
|
|
@ -12,13 +12,15 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class ObserveEventImplicitTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void Binding_OneWayFromCheckBoxToCheckBoxWithObserveEvent_BindingGetsUpdated()
|
||||
{
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
control2,
|
||||
|
@ -37,7 +39,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.Checked,
|
||||
control1,
|
||||
|
@ -60,7 +62,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
vm,
|
||||
|
@ -79,7 +81,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -99,7 +101,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -123,7 +125,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -147,7 +149,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -170,7 +172,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -190,7 +192,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new CheckBox(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
control2,
|
||||
|
@ -214,7 +216,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.Checked,
|
||||
control1,
|
||||
|
@ -243,7 +245,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
vm,
|
||||
|
@ -268,7 +270,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -293,7 +295,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -323,7 +325,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -353,7 +355,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -381,7 +383,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
|
|
@ -12,13 +12,15 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class ObserveEventLostFocusTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void Binding_OneWayFromCheckBoxToCheckBoxWithObserveEvent_BindingGetsUpdated()
|
||||
{
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
control2,
|
||||
|
@ -38,7 +40,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.Checked,
|
||||
control1,
|
||||
|
@ -62,7 +64,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
vm,
|
||||
|
@ -82,7 +84,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -106,7 +108,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -134,7 +136,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -158,7 +160,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new CheckBox(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
control2,
|
||||
|
@ -185,7 +187,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.Checked,
|
||||
control1,
|
||||
|
@ -219,7 +221,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
vm,
|
||||
|
@ -245,7 +247,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -275,7 +277,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -313,7 +315,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -347,7 +349,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -377,7 +379,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
|
|
@ -12,13 +12,15 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class ObserveEventNoArgumentTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void Binding_OneWayFromCheckBoxToCheckBoxWithObserveEvent_BindingGetsUpdated()
|
||||
{
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
control2,
|
||||
|
@ -38,7 +40,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.Checked,
|
||||
control1,
|
||||
|
@ -62,7 +64,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
vm,
|
||||
|
@ -82,7 +84,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -103,7 +105,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -128,7 +130,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -149,7 +151,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new CheckBox(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
control2,
|
||||
|
@ -175,7 +177,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.Checked,
|
||||
control1,
|
||||
|
@ -206,7 +208,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
vm,
|
||||
|
@ -232,7 +234,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -259,7 +261,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -291,7 +293,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -322,7 +324,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -351,7 +353,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
|
|
@ -12,13 +12,15 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class ObserveEventNonDefaultEventTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void Binding_OneWayFromEditTextToEditTextWithObserveEvent_BindingGetsUpdated()
|
||||
{
|
||||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -41,7 +43,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
|
|
@ -12,13 +12,15 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class ObserveEventPropertyChangedTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void Binding_OneWayFromCheckBoxToCheckBoxWithObserveEvent_BindingGetsUpdated()
|
||||
{
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
control2,
|
||||
|
@ -38,7 +40,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.Checked,
|
||||
control1,
|
||||
|
@ -62,7 +64,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
vm,
|
||||
|
@ -82,7 +84,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -103,7 +105,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -128,7 +130,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -149,7 +151,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new CheckBox(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
control2,
|
||||
|
@ -175,7 +177,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.Checked,
|
||||
control1,
|
||||
|
@ -206,7 +208,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
vm,
|
||||
|
@ -232,7 +234,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -259,7 +261,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -291,7 +293,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -322,7 +324,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -351,7 +353,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
|
|
@ -13,13 +13,15 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class ObserveEventTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void Binding_OneWayFromCheckBoxToCheckBoxWithObserveEvent_BindingGetsUpdated()
|
||||
{
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
control2,
|
||||
|
@ -39,7 +41,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.Checked,
|
||||
control1,
|
||||
|
@ -63,7 +65,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
vm,
|
||||
|
@ -83,7 +85,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -104,7 +106,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -129,7 +131,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -154,7 +156,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -177,7 +179,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -197,7 +199,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new CheckBox(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
control2,
|
||||
|
@ -223,7 +225,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.Checked,
|
||||
control1,
|
||||
|
@ -254,7 +256,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
vm,
|
||||
|
@ -280,7 +282,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -307,7 +309,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -339,7 +341,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -370,7 +372,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -399,7 +401,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
|
|
@ -13,6 +13,8 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class SetCommandTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void SetCommand_OnButtonExWithSimpleValue_NoError()
|
||||
{
|
||||
|
@ -97,14 +99,14 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var button = new Button(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vmSource,
|
||||
() => vmSource.Model.MyProperty);
|
||||
|
||||
button.SetCommand(
|
||||
"Click",
|
||||
vmTarget.SetPropertyCommand,
|
||||
binding);
|
||||
_binding);
|
||||
|
||||
Assert.IsNull(vmTarget.TargetProperty);
|
||||
button.PerformClick();
|
||||
|
@ -133,13 +135,13 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var button = new Button(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vmSource,
|
||||
() => vmSource.Model.MyProperty);
|
||||
|
||||
button.SetCommand(
|
||||
vmTarget.SetPropertyCommand,
|
||||
binding);
|
||||
_binding);
|
||||
|
||||
Assert.IsNull(vmTarget.TargetProperty);
|
||||
button.PerformClick();
|
||||
|
@ -237,14 +239,14 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var checkBox = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vmSource,
|
||||
() => vmSource.Model.MyProperty);
|
||||
|
||||
checkBox.SetCommand<string, CompoundButton.CheckedChangeEventArgs>(
|
||||
"CheckedChange",
|
||||
vmTarget.SetPropertyCommand,
|
||||
binding);
|
||||
_binding);
|
||||
|
||||
Assert.IsNull(vmTarget.TargetProperty);
|
||||
checkBox.PerformClick();
|
||||
|
@ -273,13 +275,13 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var checkBox = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vmSource,
|
||||
() => vmSource.Model.MyProperty);
|
||||
|
||||
checkBox.SetCommand<string, CompoundButton.CheckedChangeEventArgs>(
|
||||
vmTarget.SetPropertyCommand,
|
||||
binding);
|
||||
_binding);
|
||||
|
||||
Assert.IsNull(vmTarget.TargetProperty);
|
||||
checkBox.PerformClick();
|
||||
|
|
|
@ -12,13 +12,15 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class UpdateTriggerImplicitTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void Binding_OneWayFromCheckBoxToCheckBoxWithUpdateTrigger_BindingGetsUpdated()
|
||||
{
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
control2,
|
||||
|
@ -37,7 +39,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.Checked,
|
||||
control1,
|
||||
|
@ -60,7 +62,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
vm,
|
||||
|
@ -79,7 +81,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -99,7 +101,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -123,7 +125,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -147,7 +149,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -170,7 +172,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -190,7 +192,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new CheckBox(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
control2,
|
||||
|
@ -214,7 +216,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.Checked,
|
||||
control1,
|
||||
|
@ -243,7 +245,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
vm,
|
||||
|
@ -268,7 +270,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -293,7 +295,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -323,7 +325,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -353,7 +355,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -381,7 +383,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
|
|
@ -12,13 +12,15 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class UpdateTriggerLostFocusTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void Binding_OneWayFromCheckBoxToCheckBoxWithUpdateTrigger_BindingGetsUpdated()
|
||||
{
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
control2,
|
||||
|
@ -38,7 +40,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.Checked,
|
||||
control1,
|
||||
|
@ -62,7 +64,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
vm,
|
||||
|
@ -82,7 +84,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -106,7 +108,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -134,7 +136,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -158,7 +160,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new CheckBox(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
control2,
|
||||
|
@ -185,7 +187,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.Checked,
|
||||
control1,
|
||||
|
@ -219,7 +221,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
vm,
|
||||
|
@ -245,7 +247,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -275,7 +277,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -313,7 +315,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -347,7 +349,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -377,7 +379,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
|
|
@ -12,13 +12,15 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class UpdateTriggerNoArgumentTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void Binding_OneWayFromCheckBoxToCheckBoxWithUpdateTrigger_BindingGetsUpdated()
|
||||
{
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
control2,
|
||||
|
@ -38,7 +40,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.Checked,
|
||||
control1,
|
||||
|
@ -62,7 +64,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
vm,
|
||||
|
@ -82,7 +84,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -103,7 +105,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -128,7 +130,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -149,7 +151,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new CheckBox(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
control2,
|
||||
|
@ -175,7 +177,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.Checked,
|
||||
control1,
|
||||
|
@ -206,7 +208,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
vm,
|
||||
|
@ -232,7 +234,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -259,7 +261,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -291,7 +293,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -322,7 +324,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -351,7 +353,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
|
|
@ -12,13 +12,15 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class UpdateTriggerNonDefaultEventTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void Binding_OneWayFromEditTextToEditTextWithUpdateTrigger_BindingGetsUpdated()
|
||||
{
|
||||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -41,7 +43,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
|
|
@ -12,13 +12,15 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class UpdateTriggerPropertyChangedTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void Binding_OneWayFromCheckBoxToCheckBoxWithUpdateTrigger_BindingGetsUpdated()
|
||||
{
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
control2,
|
||||
|
@ -38,7 +40,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.Checked,
|
||||
control1,
|
||||
|
@ -62,7 +64,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
vm,
|
||||
|
@ -82,7 +84,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -103,7 +105,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -128,7 +130,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -149,7 +151,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new CheckBox(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
control2,
|
||||
|
@ -175,7 +177,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.Checked,
|
||||
control1,
|
||||
|
@ -206,7 +208,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
vm,
|
||||
|
@ -232,7 +234,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -259,7 +261,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -291,7 +293,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -322,7 +324,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -351,7 +353,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
|
|
@ -13,13 +13,15 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class UpdateTriggerTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void Binding_OneWayFromCheckBoxToCheckBoxWithUpdateTrigger_BindingGetsUpdated()
|
||||
{
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
control2,
|
||||
|
@ -39,7 +41,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.Checked,
|
||||
control1,
|
||||
|
@ -63,7 +65,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
vm,
|
||||
|
@ -83,7 +85,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -104,7 +106,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -129,7 +131,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -154,7 +156,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -177,7 +179,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -197,7 +199,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new CheckBox(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
control2,
|
||||
|
@ -223,7 +225,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.Checked,
|
||||
control1,
|
||||
|
@ -254,7 +256,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.Checked,
|
||||
vm,
|
||||
|
@ -280,7 +282,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -307,7 +309,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new EditText(Application.Context);
|
||||
var control2 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -339,7 +341,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -370,7 +372,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new CheckBox(Application.Context);
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -399,7 +401,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new EditText(Application.Context);
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
|
|
@ -19,5 +19,4 @@ namespace GalaSoft.MvvmLight.Test
|
|||
base.OnCreate(bundle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -6,12 +6,12 @@ using Android.App;
|
|||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("UnitTestApp1")]
|
||||
[assembly: AssemblyTitle("GalaSoft.MvvmLight.Test")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("UnitTestApp1")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyCompany("GalaSoft Laurent Bugnion @ http://www.galasoft.ch")]
|
||||
[assembly: AssemblyProduct("GalaSoft.MvvmLight.Test")]
|
||||
[assembly: AssemblyCopyright("Copyright © GalaSoft Laurent Bugnion 2009-2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
|
@ -26,5 +26,4 @@ using Android.App;
|
|||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: AssemblyVersion("5.3.0.*")]
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
using System;
|
||||
|
||||
namespace GalaSoft.MvvmLight.Test.ViewModel
|
||||
{
|
||||
public class AccountModel : ObservableObject
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using System;
|
||||
|
||||
namespace GalaSoft.MvvmLight.Test.ViewModel
|
||||
namespace GalaSoft.MvvmLight.Test.ViewModel
|
||||
{
|
||||
public class AccountViewModel : ViewModelBase
|
||||
{
|
||||
|
|
|
@ -11,13 +11,15 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class ObserveEventImplicitTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void Binding_OneWayFromCheckBoxToCheckBoxWithUpdateTrigger_BindingGetsUpdated()
|
||||
{
|
||||
var control1 = new UISwitchEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
control2,
|
||||
|
@ -36,7 +38,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.On,
|
||||
control1,
|
||||
|
@ -59,7 +61,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
vm,
|
||||
|
@ -78,7 +80,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -98,7 +100,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -122,7 +124,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -146,7 +148,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -169,7 +171,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -189,7 +191,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UISwitchEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
control2,
|
||||
|
@ -213,7 +215,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.On,
|
||||
control1,
|
||||
|
@ -242,7 +244,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
vm,
|
||||
|
@ -267,7 +269,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -292,7 +294,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -322,7 +324,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -352,7 +354,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -380,7 +382,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
|
|
@ -11,13 +11,15 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class ObserveEventNoArgumentTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void Binding_OneWayFromCheckBoxToCheckBoxWithUpdateTrigger_BindingGetsUpdated()
|
||||
{
|
||||
var control1 = new UISwitchEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
control2,
|
||||
|
@ -37,7 +39,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.On,
|
||||
control1,
|
||||
|
@ -61,7 +63,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
vm,
|
||||
|
@ -81,7 +83,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -102,7 +104,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -127,7 +129,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -152,7 +154,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -175,7 +177,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -195,7 +197,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UISwitchEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
control2,
|
||||
|
@ -221,7 +223,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.On,
|
||||
control1,
|
||||
|
@ -252,7 +254,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
vm,
|
||||
|
@ -278,7 +280,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -305,7 +307,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -337,7 +339,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -368,7 +370,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -397,7 +399,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
|
|
@ -11,13 +11,15 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class ObserveEventPropertyChangedTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void Binding_OneWayFromCheckBoxToCheckBoxWithUpdateTrigger_BindingGetsUpdated()
|
||||
{
|
||||
var control1 = new UISwitchEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
control2,
|
||||
|
@ -37,7 +39,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.On,
|
||||
control1,
|
||||
|
@ -61,7 +63,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
vm,
|
||||
|
@ -81,7 +83,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -102,7 +104,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -127,7 +129,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -152,7 +154,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -175,7 +177,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -195,7 +197,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UISwitchEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
control2,
|
||||
|
@ -221,7 +223,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.On,
|
||||
control1,
|
||||
|
@ -252,7 +254,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
vm,
|
||||
|
@ -278,7 +280,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -305,7 +307,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -337,7 +339,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -368,7 +370,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -397,7 +399,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
|
|
@ -11,13 +11,15 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class ObserveEventTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void Binding_OneWayFromCheckBoxToCheckBoxWithUpdateTrigger_BindingGetsUpdated()
|
||||
{
|
||||
var control1 = new UISwitchEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
control2,
|
||||
|
@ -37,7 +39,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.On,
|
||||
control1,
|
||||
|
@ -61,7 +63,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
vm,
|
||||
|
@ -81,7 +83,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -102,7 +104,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -127,7 +129,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -152,7 +154,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -175,7 +177,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -195,7 +197,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UISwitchEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
control2,
|
||||
|
@ -221,7 +223,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.On,
|
||||
control1,
|
||||
|
@ -252,7 +254,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
vm,
|
||||
|
@ -278,7 +280,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -305,7 +307,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -337,7 +339,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -368,7 +370,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -397,7 +399,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
|
|
@ -11,6 +11,8 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class SetCommandTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void SetCommand_OnBarButtonNoValue_NoError()
|
||||
{
|
||||
|
@ -60,14 +62,14 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control = new UIBarButtonItemEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vmSource,
|
||||
() => vmSource.Model.MyProperty);
|
||||
|
||||
control.SetCommand(
|
||||
"Clicked",
|
||||
vmTarget.SetPropertyCommand,
|
||||
binding);
|
||||
_binding);
|
||||
|
||||
Assert.IsNull(vmTarget.TargetProperty);
|
||||
control.PerformEvent();
|
||||
|
@ -96,13 +98,13 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control = new UIBarButtonItemEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vmSource,
|
||||
() => vmSource.Model.MyProperty);
|
||||
|
||||
control.SetCommand(
|
||||
vmTarget.SetPropertyCommand,
|
||||
binding);
|
||||
_binding);
|
||||
|
||||
Assert.IsNull(vmTarget.TargetProperty);
|
||||
control.PerformEvent();
|
||||
|
@ -198,14 +200,14 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control = new UIButtonEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vmSource,
|
||||
() => vmSource.Model.MyProperty);
|
||||
|
||||
control.SetCommand(
|
||||
"TouchUpInside",
|
||||
vmTarget.SetPropertyCommand,
|
||||
binding);
|
||||
_binding);
|
||||
|
||||
Assert.IsNull(vmTarget.TargetProperty);
|
||||
control.PerformEvent();
|
||||
|
@ -234,13 +236,13 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control = new UIButtonEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vmSource,
|
||||
() => vmSource.Model.MyProperty);
|
||||
|
||||
control.SetCommand(
|
||||
vmTarget.SetPropertyCommand,
|
||||
binding);
|
||||
_binding);
|
||||
|
||||
Assert.IsNull(vmTarget.TargetProperty);
|
||||
control.PerformEvent();
|
||||
|
@ -346,174 +348,5 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
control.PerformEvent();
|
||||
Assert.AreEqual(TestViewModel.ValueForCommand, castedCommand.Parameter);
|
||||
}
|
||||
|
||||
// () => vmSource.Model.MyProperty);
|
||||
// vmSource,
|
||||
|
||||
// var binding = new Binding<string, string>(
|
||||
|
||||
// var checkBox = new CheckBox(Application.Context);
|
||||
|
||||
// var vmTarget = new TestViewModel();
|
||||
// };
|
||||
// }
|
||||
// MyProperty = value
|
||||
// {
|
||||
// Model = new TestModel
|
||||
// {
|
||||
|
||||
// var vmSource = new TestViewModel
|
||||
// var value = DateTime.Now.Ticks.ToString();
|
||||
// {
|
||||
// public void SetCommand_OnCheckBoxWithBinding_ParameterShouldUpdate()
|
||||
|
||||
// [Test]
|
||||
|
||||
// checkBox.SetCommand<string, CompoundButton.CheckedChangeEventArgs>(
|
||||
// "CheckedChange",
|
||||
// vmTarget.SetPropertyCommand,
|
||||
// binding);
|
||||
|
||||
// Assert.IsNull(vmTarget.TargetProperty);
|
||||
// checkBox.PerformClick();
|
||||
// Assert.AreEqual(value, vmTarget.TargetProperty);
|
||||
|
||||
// value += "Test";
|
||||
// vmSource.Model.MyProperty = value;
|
||||
// checkBox.PerformClick();
|
||||
// Assert.AreEqual(value, vmTarget.TargetProperty);
|
||||
// }
|
||||
|
||||
// [Test]
|
||||
// public void SetCommand_OnCheckBoxWithBindingNoEventName_ParameterShouldUpdate()
|
||||
// {
|
||||
// var value = DateTime.Now.Ticks.ToString();
|
||||
|
||||
// var vmSource = new TestViewModel
|
||||
// {
|
||||
// Model = new TestModel
|
||||
// {
|
||||
// MyProperty = value
|
||||
// }
|
||||
// };
|
||||
|
||||
// var vmTarget = new TestViewModel();
|
||||
|
||||
// var checkBox = new CheckBox(Application.Context);
|
||||
|
||||
// var binding = new Binding<string, string>(
|
||||
// vmSource,
|
||||
// () => vmSource.Model.MyProperty);
|
||||
|
||||
// checkBox.SetCommand<string, CompoundButton.CheckedChangeEventArgs>(
|
||||
// vmTarget.SetPropertyCommand,
|
||||
// binding);
|
||||
|
||||
// Assert.IsNull(vmTarget.TargetProperty);
|
||||
// checkBox.PerformClick();
|
||||
// Assert.AreEqual(value, vmTarget.TargetProperty);
|
||||
|
||||
// value += "Test";
|
||||
// vmSource.Model.MyProperty = value;
|
||||
// checkBox.PerformClick();
|
||||
// Assert.AreEqual(value, vmTarget.TargetProperty);
|
||||
// }
|
||||
|
||||
// [Test]
|
||||
// public void SetCommand_OnCheckBoxWithSimpleValue_NoError()
|
||||
// {
|
||||
// var value = DateTime.Now.Ticks.ToString();
|
||||
// var vmTarget = new TestViewModel();
|
||||
|
||||
// var checkBox = new CheckBox(Application.Context);
|
||||
|
||||
// checkBox.SetCommand<string, CompoundButton.CheckedChangeEventArgs>(
|
||||
// "CheckedChange",
|
||||
// vmTarget.SetPropertyCommand,
|
||||
// value);
|
||||
|
||||
// Assert.IsNull(vmTarget.TargetProperty);
|
||||
// checkBox.PerformClick();
|
||||
// Assert.AreEqual(value, vmTarget.TargetProperty);
|
||||
// }
|
||||
|
||||
// [Test]
|
||||
// public void SetCommand_OnCheckBoxWithSimpleValueNoEventName_ClickEventShouldBeUsed()
|
||||
// {
|
||||
// var value = DateTime.Now.Ticks.ToString();
|
||||
// var vmTarget = new TestViewModel();
|
||||
|
||||
// var checkBox = new CheckBox(Application.Context);
|
||||
|
||||
// checkBox.SetCommand<string, CompoundButton.CheckedChangeEventArgs>(
|
||||
// vmTarget.SetPropertyCommand,
|
||||
// value);
|
||||
|
||||
// Assert.IsNull(vmTarget.TargetProperty);
|
||||
// checkBox.PerformClick();
|
||||
// Assert.AreEqual(value, vmTarget.TargetProperty);
|
||||
// }
|
||||
|
||||
// [Test]
|
||||
// public void SetCommand_OnCheckBoxNoValue_NoError()
|
||||
// {
|
||||
// var value = DateTime.Now.Ticks.ToString();
|
||||
// var vmTarget = new TestViewModel();
|
||||
// vmTarget.Configure(value);
|
||||
|
||||
// var checkBox = new CheckBox(Application.Context);
|
||||
|
||||
// checkBox.SetCommand<CompoundButton.CheckedChangeEventArgs>("CheckedChange", vmTarget.SetPropertyWithoutValueCommand);
|
||||
|
||||
// Assert.IsNull(vmTarget.TargetProperty);
|
||||
// checkBox.PerformClick();
|
||||
// Assert.AreEqual(value, vmTarget.TargetProperty);
|
||||
// }
|
||||
|
||||
// [Test]
|
||||
// public void SetCommand_OnCheckBoxNoValueNoEventName_ClickEventShouldBeUsed()
|
||||
// {
|
||||
// var value = DateTime.Now.Ticks.ToString();
|
||||
// var vmTarget = new TestViewModel();
|
||||
// vmTarget.Configure(value);
|
||||
|
||||
// var checkBox = new CheckBox(Application.Context);
|
||||
|
||||
// checkBox.SetCommand<CompoundButton.CheckedChangeEventArgs>(vmTarget.SetPropertyWithoutValueCommand);
|
||||
|
||||
// Assert.IsNull(vmTarget.TargetProperty);
|
||||
// checkBox.PerformClick();
|
||||
// Assert.AreEqual(value, vmTarget.TargetProperty);
|
||||
// }
|
||||
|
||||
// [Test]
|
||||
// public void SetCommand_WithICommandOnCheckBoxNoValue_NoError()
|
||||
// {
|
||||
// var vmTarget = new TestViewModel();
|
||||
// var checkBox = new CheckBox(Application.Context);
|
||||
|
||||
// checkBox.SetCommand<CompoundButton.CheckedChangeEventArgs>("CheckedChange", vmTarget.TestCommandImpl);
|
||||
|
||||
// var castedCommand = (CommandImpl)vmTarget.TestCommandImpl;
|
||||
|
||||
// Assert.IsNull(castedCommand.Parameter);
|
||||
// checkBox.PerformClick();
|
||||
// Assert.AreEqual(TestViewModel.ValueForCommand, castedCommand.Parameter);
|
||||
// }
|
||||
|
||||
// [Test]
|
||||
// public void SetCommand_WithICommandOnCheckBoxNoValueNoEventName_ClickEventShouldBeUsed()
|
||||
// {
|
||||
// var vmTarget = new TestViewModel();
|
||||
// var checkBox = new CheckBox(Application.Context);
|
||||
|
||||
// checkBox.SetCommand<CompoundButton.CheckedChangeEventArgs>(vmTarget.TestCommandImpl);
|
||||
|
||||
// var castedCommand = (CommandImpl)vmTarget.TestCommandImpl;
|
||||
|
||||
// Assert.IsNull(castedCommand.Parameter);
|
||||
// checkBox.PerformClick();
|
||||
// Assert.AreEqual(TestViewModel.ValueForCommand, castedCommand.Parameter);
|
||||
// }
|
||||
}
|
||||
}
|
|
@ -11,13 +11,15 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class UpdateTriggerImplicitTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void Binding_OneWayFromCheckBoxToCheckBoxWithUpdateTrigger_BindingGetsUpdated()
|
||||
{
|
||||
var control1 = new UISwitchEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
control2,
|
||||
|
@ -36,7 +38,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.On,
|
||||
control1,
|
||||
|
@ -59,7 +61,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
vm,
|
||||
|
@ -78,7 +80,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -98,7 +100,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -122,7 +124,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -146,7 +148,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -169,7 +171,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -189,7 +191,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UISwitchEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
control2,
|
||||
|
@ -213,7 +215,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.On,
|
||||
control1,
|
||||
|
@ -242,7 +244,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
vm,
|
||||
|
@ -267,7 +269,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -292,7 +294,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -322,7 +324,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -352,7 +354,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -380,7 +382,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
|
|
@ -11,13 +11,15 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class UpdateTriggerNoArgumentTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void Binding_OneWayFromCheckBoxToCheckBoxWithUpdateTrigger_BindingGetsUpdated()
|
||||
{
|
||||
var control1 = new UISwitchEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
control2,
|
||||
|
@ -37,7 +39,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.On,
|
||||
control1,
|
||||
|
@ -61,7 +63,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
vm,
|
||||
|
@ -81,7 +83,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -102,7 +104,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -127,7 +129,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -152,7 +154,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -175,7 +177,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -195,7 +197,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UISwitchEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
control2,
|
||||
|
@ -221,7 +223,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.On,
|
||||
control1,
|
||||
|
@ -252,7 +254,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
vm,
|
||||
|
@ -278,7 +280,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -305,7 +307,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -337,7 +339,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -368,7 +370,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -397,7 +399,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
|
|
@ -11,13 +11,15 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class UpdateTriggerPropertyChangedTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void Binding_OneWayFromCheckBoxToCheckBoxWithUpdateTrigger_BindingGetsUpdated()
|
||||
{
|
||||
var control1 = new UISwitchEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
control2,
|
||||
|
@ -37,7 +39,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.On,
|
||||
control1,
|
||||
|
@ -61,7 +63,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
vm,
|
||||
|
@ -81,7 +83,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -102,7 +104,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -127,7 +129,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -152,7 +154,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -175,7 +177,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -195,7 +197,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UISwitchEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
control2,
|
||||
|
@ -221,7 +223,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.On,
|
||||
control1,
|
||||
|
@ -252,7 +254,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
vm,
|
||||
|
@ -278,7 +280,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -305,7 +307,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -337,7 +339,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -368,7 +370,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -397,7 +399,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
|
|
@ -11,13 +11,15 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class UpdateTriggerTest
|
||||
{
|
||||
private Helpers.Binding _binding;
|
||||
|
||||
[Test]
|
||||
public void Binding_OneWayFromCheckBoxToCheckBoxWithUpdateTrigger_BindingGetsUpdated()
|
||||
{
|
||||
var control1 = new UISwitchEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
control2,
|
||||
|
@ -37,7 +39,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.On,
|
||||
control1,
|
||||
|
@ -61,7 +63,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
vm,
|
||||
|
@ -81,7 +83,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -102,7 +104,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -127,7 +129,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -152,7 +154,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -175,7 +177,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -195,7 +197,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UISwitchEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, bool>(
|
||||
_binding = new Binding<bool, bool>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
control2,
|
||||
|
@ -221,7 +223,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control2,
|
||||
() => control2.On,
|
||||
control1,
|
||||
|
@ -252,7 +254,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<bool, string>(
|
||||
_binding = new Binding<bool, string>(
|
||||
control1,
|
||||
() => control1.On,
|
||||
vm,
|
||||
|
@ -278,7 +280,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -305,7 +307,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
var control1 = new UITextViewEx();
|
||||
var control2 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
control2,
|
||||
|
@ -337,7 +339,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
control1,
|
||||
() => control1.Text,
|
||||
vm,
|
||||
|
@ -368,7 +370,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UISwitchEx();
|
||||
|
||||
var binding = new Binding<string, bool>(
|
||||
_binding = new Binding<string, bool>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
@ -397,7 +399,7 @@ namespace GalaSoft.MvvmLight.Test.Binding
|
|||
|
||||
var control1 = new UITextViewEx();
|
||||
|
||||
var binding = new Binding<string, string>(
|
||||
_binding = new Binding<string, string>(
|
||||
vm,
|
||||
() => vm.Model.MyProperty,
|
||||
control1,
|
||||
|
|
|
@ -5,12 +5,12 @@ using System.Runtime.InteropServices;
|
|||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("AppleTestApp")]
|
||||
[assembly: AssemblyTitle("GalaSoft.MvvmLight.Test")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("AppleTestApp")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2016")]
|
||||
[assembly: AssemblyCompany("GalaSoft Laurent Bugnion @ http://www.galasoft.ch")]
|
||||
[assembly: AssemblyProduct("GalaSoft.MvvmLight.Test")]
|
||||
[assembly: AssemblyCopyright("Copyright © GalaSoft Laurent Bugnion 2009-2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
@ -32,5 +32,4 @@ using System.Runtime.InteropServices;
|
|||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: AssemblyVersion("5.3.0.*")]
|
||||
|
|
|
@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("GalaSoft Laurent Bugnion @ http://www.galasoft.ch")]
|
||||
[assembly: AssemblyProduct("GalaSoft.MvvmLight.Test")]
|
||||
[assembly: AssemblyCopyright("Copyright © GalaSoft Laurent Bugnion 2009-2015")]
|
||||
[assembly: AssemblyCopyright("Copyright © GalaSoft Laurent Bugnion 2009-2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
|
@ -28,4 +28,4 @@ using System.Runtime.InteropServices;
|
|||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("5.0.2.*")]
|
||||
[assembly: AssemblyVersion("5.3.0.*")]
|
||||
|
|
Загрузка…
Ссылка в новой задаче