Merge remote-tracking branch 'MvvmCross/develop' into new-plugin-architecture
This commit is contained in:
Коммит
1d6099c34e
|
@ -41,11 +41,6 @@ namespace MvvmCross.Droid.Support.V4
|
|||
|
||||
public List<MvxViewPagerFragmentInfo> FragmentsInfo { get; }
|
||||
|
||||
protected string FragmentJavaName(Type fragmentType)
|
||||
{
|
||||
return Class.FromType(fragmentType).Name;
|
||||
}
|
||||
|
||||
public override Fragment GetItem(int position, Fragment.SavedState fragmentSavedState = null)
|
||||
{
|
||||
var fragInfo = FragmentsInfo.ElementAt(position);
|
||||
|
|
|
@ -5,19 +5,19 @@
|
|||
using Android.Content;
|
||||
using MvvmCross.Binding;
|
||||
using MvvmCross.Binding.Bindings.Target.Construction;
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Localization;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using MvvmCross.Forms.Core;
|
||||
using MvvmCross.Forms.Platform.Android.Bindings;
|
||||
using MvvmCross.Forms.Platform.Android.Views;
|
||||
using MvvmCross.Platform.Android.Core;
|
||||
using MvvmCross.Platform.Android.Presenters;
|
||||
using MvvmCross.Platform.Android.Views;
|
||||
using MvvmCross.Plugin;
|
||||
using MvvmCross.ViewModels;
|
||||
using MvvmCross.Platform.Android;
|
||||
using MvvmCross.Forms.Presenters;
|
||||
using MvvmCross.Forms.Platform.Android.Presenters;
|
||||
|
||||
namespace MvvmCross.Forms.Platform.Android.Core
|
||||
{
|
||||
|
|
|
@ -3,16 +3,16 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Droid.Support.V7.AppCompat;
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Presenters;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using MvvmCross.Forms.Core;
|
||||
using MvvmCross.Platform.Android.Views;
|
||||
using MvvmCross.ViewModels;
|
||||
using MvvmCross.Forms.Platform.Android.Views;
|
||||
|
||||
|
||||
namespace MvvmCross.Forms.Platform.Android.Views
|
||||
namespace MvvmCross.Forms.Platform.Android.Presenters
|
||||
{
|
||||
public class MvxFormsAndroidViewPresenter
|
||||
: MvxAppCompatViewPresenter, IMvxFormsViewPresenter
|
|
@ -10,7 +10,7 @@ using MvvmCross.Base;
|
|||
using MvvmCross.Platform.Android.Views.Base;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
|
||||
namespace MvvmCross.Forms.Platform.Android.Views.EventSource
|
||||
namespace MvvmCross.Forms.Platform.Android.Views.Base
|
||||
{
|
||||
public abstract class MvxEventSourceFormsAppCompatActivity
|
||||
: FormsAppCompatActivity, IMvxEventSourceActivity
|
|
@ -10,7 +10,7 @@ using MvvmCross.Base;
|
|||
using MvvmCross.Platform.Android.Views.Base;
|
||||
using Xamarin.Forms.Platform.Android;
|
||||
|
||||
namespace MvvmCross.Forms.Platform.Android.Views.EventSource
|
||||
namespace MvvmCross.Forms.Platform.Android.Views.Base
|
||||
{
|
||||
public abstract class MvxEventSourceFormsApplicationActivity
|
||||
: FormsApplicationActivity, IMvxEventSourceActivity
|
|
@ -10,8 +10,8 @@ using Android.Views;
|
|||
using MvvmCross.Binding.BindingContext;
|
||||
using MvvmCross.Droid.Support.V7.AppCompat;
|
||||
using MvvmCross.Forms.Core;
|
||||
using MvvmCross.Forms.Platform.Android.Views.EventSource;
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Platform.Android.Views.Base;
|
||||
using MvvmCross.Forms.Presenters;
|
||||
using MvvmCross.Platform.Android.Binding.BindingContext;
|
||||
using MvvmCross.Platform.Android.Binding.Views;
|
||||
using MvvmCross.Platform.Android.Core;
|
||||
|
|
|
@ -8,8 +8,8 @@ using Android.OS;
|
|||
using Android.Views;
|
||||
using MvvmCross.Binding.BindingContext;
|
||||
using MvvmCross.Forms.Core;
|
||||
using MvvmCross.Forms.Platform.Android.Views.EventSource;
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Platform.Android.Views.Base;
|
||||
using MvvmCross.Forms.Presenters;
|
||||
using MvvmCross.Platform.Android.Binding.BindingContext;
|
||||
using MvvmCross.Platform.Android.Binding.Views;
|
||||
using MvvmCross.Platform.Android.Core;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
using System;
|
||||
using MvvmCross.Core;
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Presenters;
|
||||
using MvvmCross.Platform.Mac.Core;
|
||||
using Xamarin.Forms.Platform.MacOS;
|
||||
|
||||
|
|
|
@ -4,18 +4,18 @@
|
|||
|
||||
using MvvmCross.Binding;
|
||||
using MvvmCross.Binding.Bindings.Target.Construction;
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Localization;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using AppKit;
|
||||
using MvvmCross.Forms.Core;
|
||||
using MvvmCross.Forms.Platform.Mac.Bindings;
|
||||
using MvvmCross.Forms.Platform.Mac.Views;
|
||||
using MvvmCross.Platform.Mac.Core;
|
||||
using MvvmCross.Platform.Mac.Presenters;
|
||||
using MvvmCross.Plugin;
|
||||
using MvvmCross.ViewModels;
|
||||
using MvvmCross.Forms.Platform.Mac.Presenters;
|
||||
using MvvmCross.Forms.Presenters;
|
||||
|
||||
namespace MvvmCross.Forms.Platform.Mac.Core
|
||||
{
|
||||
|
|
|
@ -5,12 +5,12 @@
|
|||
using System;
|
||||
using AppKit;
|
||||
using MvvmCross.Forms.Core;
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Presenters;
|
||||
using MvvmCross.Logging;
|
||||
using MvvmCross.Platform.Mac.Presenters;
|
||||
using MvvmCross.ViewModels;
|
||||
|
||||
namespace MvvmCross.Forms.Platform.Mac.Views
|
||||
namespace MvvmCross.Forms.Platform.Mac.Presenters
|
||||
{
|
||||
public class MvxFormsMacViewPresenter
|
||||
: MvxMacViewPresenter
|
|
@ -4,13 +4,13 @@
|
|||
|
||||
using MvvmCross.Binding;
|
||||
using MvvmCross.Binding.Bindings.Target.Construction;
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Presenters;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using Windows.ApplicationModel.Activation;
|
||||
using MvvmCross.Forms.Core;
|
||||
using MvvmCross.Forms.Platform.Uap.Bindings;
|
||||
using MvvmCross.Forms.Platform.Uap.Views;
|
||||
using MvvmCross.Forms.Platform.Uap.Presenters;
|
||||
using MvvmCross.Platform.Uap.Core;
|
||||
using MvvmCross.Platform.Uap.Views;
|
||||
using MvvmCross.Plugin;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// The .NET Foundation licenses this file to you under the MS-PL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Presenters;
|
||||
using System;
|
||||
using MvvmCross.Forms.Core;
|
||||
using MvvmCross.Logging;
|
||||
|
@ -10,7 +10,7 @@ using MvvmCross.Platform.Uap.Presenters;
|
|||
using MvvmCross.Platform.Uap.Views;
|
||||
using MvvmCross.ViewModels;
|
||||
|
||||
namespace MvvmCross.Forms.Platform.Uap.Views
|
||||
namespace MvvmCross.Forms.Platform.Uap.Presenters
|
||||
{
|
||||
public class MvxFormsUwpViewPresenter
|
||||
: MvxWindowsViewPresenter
|
|
@ -5,7 +5,7 @@
|
|||
using System;
|
||||
using Foundation;
|
||||
using MvvmCross.Core;
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Presenters;
|
||||
using MvvmCross.Platform.Ios.Core;
|
||||
using UIKit;
|
||||
using Xamarin.Forms.Platform.iOS;
|
||||
|
|
|
@ -4,18 +4,18 @@
|
|||
|
||||
using MvvmCross.Binding;
|
||||
using MvvmCross.Binding.Bindings.Target.Construction;
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Presenters;
|
||||
using MvvmCross.Localization;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using MvvmCross.Forms.Core;
|
||||
using MvvmCross.Forms.Platform.iOS.Bindings;
|
||||
using MvvmCross.Forms.Platform.iOS.Views;
|
||||
using MvvmCross.Platform.Ios.Core;
|
||||
using MvvmCross.Platform.Ios.Presenters;
|
||||
using MvvmCross.Plugin;
|
||||
using MvvmCross.ViewModels;
|
||||
using UIKit;
|
||||
using MvvmCross.Forms.Platform.iOS.Presenters;
|
||||
|
||||
namespace MvvmCross.Forms.Platform.iOS.Core
|
||||
{
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
|
||||
using System;
|
||||
using MvvmCross.Forms.Core;
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Presenters;
|
||||
using MvvmCross.Logging;
|
||||
using MvvmCross.Platform.Ios.Presenters;
|
||||
using MvvmCross.ViewModels;
|
||||
using UIKit;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace MvvmCross.Forms.Platform.iOS.Views
|
||||
namespace MvvmCross.Forms.Platform.iOS.Presenters
|
||||
{
|
||||
public class MvxFormsIosViewPresenter
|
||||
: MvxIosViewPresenter
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
using System;
|
||||
|
||||
namespace MvvmCross.Forms.Views.Attributes
|
||||
namespace MvvmCross.Forms.Presenters.Attributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class MvxCarouselPagePresentationAttribute : MvxPagePresentationAttribute
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
using System;
|
||||
|
||||
namespace MvvmCross.Forms.Views.Attributes
|
||||
namespace MvvmCross.Forms.Presenters.Attributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class MvxContentPagePresentationAttribute : MvxPagePresentationAttribute
|
||||
|
@ -13,4 +13,4 @@ namespace MvvmCross.Forms.Views.Attributes
|
|||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MS-PL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace MvvmCross.Forms.Views.Attributes
|
||||
namespace MvvmCross.Forms.Presenters.Attributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class MvxMasterDetailPagePresentationAttribute : MvxPagePresentationAttribute
|
||||
|
@ -31,4 +31,4 @@ namespace MvvmCross.Forms.Views.Attributes
|
|||
Master,
|
||||
Detail
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MS-PL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace MvvmCross.Forms.Views.Attributes
|
||||
namespace MvvmCross.Forms.Presenters.Attributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class MvxModalPresentationAttribute : MvxPagePresentationAttribute
|
||||
|
@ -13,4 +13,4 @@ namespace MvvmCross.Forms.Views.Attributes
|
|||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MS-PL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace MvvmCross.Forms.Views.Attributes
|
||||
namespace MvvmCross.Forms.Presenters.Attributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class MvxNavigationPagePresentationAttribute : MvxPagePresentationAttribute
|
||||
|
@ -13,4 +13,4 @@ namespace MvvmCross.Forms.Views.Attributes
|
|||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@
|
|||
using System;
|
||||
using MvvmCross.Presenters;
|
||||
|
||||
namespace MvvmCross.Forms.Views.Attributes
|
||||
namespace MvvmCross.Forms.Presenters.Attributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public abstract class MvxPagePresentationAttribute : MvxBasePresentationAttribute
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
using System;
|
||||
|
||||
namespace MvvmCross.Forms.Views.Attributes
|
||||
namespace MvvmCross.Forms.Presenters.Attributes
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class MvxTabbedPagePresentationAttribute : MvxPagePresentationAttribute
|
||||
|
@ -22,4 +22,4 @@ namespace MvvmCross.Forms.Views.Attributes
|
|||
Root,
|
||||
Tab
|
||||
}
|
||||
}
|
||||
}
|
|
@ -8,7 +8,7 @@ using MvvmCross.ViewModels;
|
|||
using MvvmCross.Presenters;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace MvvmCross.Forms.Views
|
||||
namespace MvvmCross.Forms.Presenters
|
||||
{
|
||||
public interface IMvxFormsPagePresenter : IMvxAttributeViewPresenter
|
||||
{
|
|
@ -6,7 +6,7 @@ using System;
|
|||
using MvvmCross.Forms.Core;
|
||||
using MvvmCross.Presenters;
|
||||
|
||||
namespace MvvmCross.Forms.Views
|
||||
namespace MvvmCross.Forms.Presenters
|
||||
{
|
||||
public interface IMvxFormsViewPresenter : IMvxAttributeViewPresenter
|
||||
{
|
|
@ -8,14 +8,15 @@ using System.Reflection;
|
|||
using System.Threading.Tasks;
|
||||
using MvvmCross.Exceptions;
|
||||
using MvvmCross.Forms.Core;
|
||||
using MvvmCross.Forms.Views.Attributes;
|
||||
using MvvmCross.Forms.Presenters.Attributes;
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Logging;
|
||||
using MvvmCross.Presenters;
|
||||
using MvvmCross.ViewModels;
|
||||
using MvvmCross.ViewModels.Hints;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace MvvmCross.Forms.Views
|
||||
namespace MvvmCross.Forms.Presenters
|
||||
{
|
||||
//Handles common Forms Presenter code
|
||||
public class MvxFormsPagePresenter :
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
using System;
|
||||
|
||||
namespace MvvmCross.Forms.Views.EventSource
|
||||
namespace MvvmCross.Forms.Views.Base
|
||||
{
|
||||
public interface IMvxEventSourceCell : IMvxEventSourceElement
|
||||
{
|
||||
|
@ -14,4 +14,4 @@ namespace MvvmCross.Forms.Views.EventSource
|
|||
|
||||
event EventHandler TappedCalled;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
using System;
|
||||
|
||||
namespace MvvmCross.Forms.Views.EventSource
|
||||
namespace MvvmCross.Forms.Views.Base
|
||||
{
|
||||
public interface IMvxEventSourceElement
|
||||
{
|
||||
|
@ -12,4 +12,4 @@ namespace MvvmCross.Forms.Views.EventSource
|
|||
|
||||
event EventHandler ParentSetCalled;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
using System;
|
||||
|
||||
namespace MvvmCross.Forms.Views.EventSource
|
||||
namespace MvvmCross.Forms.Views.Base
|
||||
{
|
||||
public interface IMvxEventSourcePage : IMvxEventSourceElement
|
||||
{
|
||||
|
@ -12,4 +12,4 @@ namespace MvvmCross.Forms.Views.EventSource
|
|||
|
||||
event EventHandler DisappearingCalled;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,7 +6,7 @@ using System;
|
|||
using MvvmCross.Base;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace MvvmCross.Forms.Views.EventSource
|
||||
namespace MvvmCross.Forms.Views.Base
|
||||
{
|
||||
public class MvxEventSourceCarouselPage : CarouselPage, IMvxEventSourcePage
|
||||
{
|
|
@ -6,7 +6,7 @@ using System;
|
|||
using MvvmCross.Base;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace MvvmCross.Forms.Views.EventSource
|
||||
namespace MvvmCross.Forms.Views.Base
|
||||
{
|
||||
public class MvxEventSourceContentPage : ContentPage, IMvxEventSourcePage
|
||||
{
|
|
@ -6,7 +6,7 @@ using System;
|
|||
using MvvmCross.Base;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace MvvmCross.Forms.Views.EventSource
|
||||
namespace MvvmCross.Forms.Views.Base
|
||||
{
|
||||
public class MvxEventSourceContentView : ContentView, IMvxEventSourceElement
|
||||
{
|
|
@ -6,7 +6,7 @@ using System;
|
|||
using MvvmCross.Base;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace MvvmCross.Forms.Views.EventSource
|
||||
namespace MvvmCross.Forms.Views.Base
|
||||
{
|
||||
public class MvxEventSourceEntryCell : EntryCell, IMvxEventSourceCell
|
||||
{
|
|
@ -6,7 +6,7 @@ using System;
|
|||
using MvvmCross.Base;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace MvvmCross.Forms.Views.EventSource
|
||||
namespace MvvmCross.Forms.Views.Base
|
||||
{
|
||||
public class MvxEventSourceImageCell : ImageCell, IMvxEventSourceCell
|
||||
{
|
|
@ -6,7 +6,7 @@ using System;
|
|||
using MvvmCross.Base;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace MvvmCross.Forms.Views.EventSource
|
||||
namespace MvvmCross.Forms.Views.Base
|
||||
{
|
||||
public class MvxEventSourceMasterDetailPage : MasterDetailPage, IMvxEventSourcePage
|
||||
{
|
|
@ -6,7 +6,7 @@ using System;
|
|||
using MvvmCross.Base;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace MvvmCross.Forms.Views.EventSource
|
||||
namespace MvvmCross.Forms.Views.Base
|
||||
{
|
||||
public class MvxEventSourceNavigationPage : NavigationPage, IMvxEventSourcePage
|
||||
{
|
|
@ -6,7 +6,7 @@ using System;
|
|||
using MvvmCross.Base;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace MvvmCross.Forms.Views.EventSource
|
||||
namespace MvvmCross.Forms.Views.Base
|
||||
{
|
||||
public class MvxEventSourcePage : Page, IMvxEventSourcePage
|
||||
{
|
|
@ -6,7 +6,7 @@ using System;
|
|||
using MvvmCross.Base;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace MvvmCross.Forms.Views.EventSource
|
||||
namespace MvvmCross.Forms.Views.Base
|
||||
{
|
||||
public class MvxEventSourceSwitchCell : SwitchCell, IMvxEventSourceCell
|
||||
{
|
|
@ -6,7 +6,7 @@ using System;
|
|||
using MvvmCross.Base;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace MvvmCross.Forms.Views.EventSource
|
||||
namespace MvvmCross.Forms.Views.Base
|
||||
{
|
||||
public class MvxEventSourceTabbedPage : TabbedPage, IMvxEventSourcePage
|
||||
{
|
|
@ -6,7 +6,7 @@ using System;
|
|||
using MvvmCross.Base;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace MvvmCross.Forms.Views.EventSource
|
||||
namespace MvvmCross.Forms.Views.Base
|
||||
{
|
||||
public class MvxEventSourceTextCell : TextCell, IMvxEventSourceCell
|
||||
{
|
|
@ -6,7 +6,7 @@ using System;
|
|||
using MvvmCross.Base;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace MvvmCross.Forms.Views.EventSource
|
||||
namespace MvvmCross.Forms.Views.Base
|
||||
{
|
||||
public class MvxEventSourceViewCell : ViewCell, IMvxEventSourceCell
|
||||
{
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using MvvmCross.Forms.Views.EventSource;
|
||||
using MvvmCross.Forms.Views.Base;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace MvvmCross.Forms.Views
|
||||
|
@ -50,4 +50,4 @@ namespace MvvmCross.Forms.Views
|
|||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using MvvmCross.Forms.Views.EventSource;
|
||||
using MvvmCross.Forms.Views.Base;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace MvvmCross.Forms.Views
|
||||
|
@ -35,4 +35,4 @@ namespace MvvmCross.Forms.Views
|
|||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using MvvmCross.Forms.Views.EventSource;
|
||||
using MvvmCross.Forms.Views.Base;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace MvvmCross.Forms.Views
|
||||
|
@ -45,4 +45,4 @@ namespace MvvmCross.Forms.Views
|
|||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Binding.BindingContext;
|
||||
using MvvmCross.Forms.Views.EventSource;
|
||||
using MvvmCross.Forms.Views.Base;
|
||||
using MvvmCross.ViewModels;
|
||||
|
||||
namespace MvvmCross.Forms.Views
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using MvvmCross.Forms.Views.EventSource;
|
||||
using MvvmCross.Forms.Views.Base;
|
||||
|
||||
namespace MvvmCross.Forms.Views
|
||||
{
|
||||
|
@ -23,4 +23,4 @@ namespace MvvmCross.Forms.Views
|
|||
base.HandleAppearingCalled(sender, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Binding.BindingContext;
|
||||
using MvvmCross.Forms.Views.EventSource;
|
||||
using MvvmCross.Forms.Views.Base;
|
||||
using MvvmCross.ViewModels;
|
||||
|
||||
namespace MvvmCross.Forms.Views
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Binding.BindingContext;
|
||||
using MvvmCross.Forms.Views.EventSource;
|
||||
using MvvmCross.Forms.Views.Base;
|
||||
using MvvmCross.ViewModels;
|
||||
|
||||
namespace MvvmCross.Forms.Views
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using MvvmCross.Forms.Views.EventSource;
|
||||
using MvvmCross.Forms.Views.Base;
|
||||
|
||||
namespace MvvmCross.Forms.Views
|
||||
{
|
||||
|
@ -23,4 +23,4 @@ namespace MvvmCross.Forms.Views
|
|||
base.HandleBindingContextChangedCalled(sender, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Exceptions;
|
||||
using MvvmCross.Forms.Views.EventSource;
|
||||
using MvvmCross.Forms.Views.Base;
|
||||
using MvvmCross.Logging;
|
||||
using MvvmCross.ViewModels;
|
||||
using MvvmCross.Views;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Binding.BindingContext;
|
||||
using MvvmCross.Forms.Views.EventSource;
|
||||
using MvvmCross.Forms.Views.Base;
|
||||
using MvvmCross.ViewModels;
|
||||
|
||||
namespace MvvmCross.Forms.Views
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Binding.BindingContext;
|
||||
using MvvmCross.Forms.Views.EventSource;
|
||||
using MvvmCross.Forms.Views.Base;
|
||||
using MvvmCross.ViewModels;
|
||||
|
||||
namespace MvvmCross.Forms.Views
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Binding.BindingContext;
|
||||
using MvvmCross.Forms.Views.EventSource;
|
||||
using MvvmCross.Forms.Views.Base;
|
||||
using MvvmCross.ViewModels;
|
||||
|
||||
namespace MvvmCross.Forms.Views
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Binding.BindingContext;
|
||||
using MvvmCross.Forms.Views.EventSource;
|
||||
using MvvmCross.Forms.Views.Base;
|
||||
using MvvmCross.ViewModels;
|
||||
using Xamarin.Forms;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Binding.BindingContext;
|
||||
using MvvmCross.Forms.Views.EventSource;
|
||||
using MvvmCross.Forms.Views.Base;
|
||||
using MvvmCross.ViewModels;
|
||||
|
||||
namespace MvvmCross.Forms.Views
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using MvvmCross.Forms.Views.EventSource;
|
||||
using MvvmCross.Forms.Views.Base;
|
||||
|
||||
namespace MvvmCross.Forms.Views
|
||||
{
|
||||
|
@ -23,4 +23,4 @@ namespace MvvmCross.Forms.Views
|
|||
base.HandleAppearingCalled(sender, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Binding.BindingContext;
|
||||
using MvvmCross.Forms.Views.EventSource;
|
||||
using MvvmCross.Forms.Views.Base;
|
||||
using MvvmCross.ViewModels;
|
||||
|
||||
namespace MvvmCross.Forms.Views
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Binding.BindingContext;
|
||||
using MvvmCross.Forms.Views.EventSource;
|
||||
using MvvmCross.Forms.Views.Base;
|
||||
using MvvmCross.ViewModels;
|
||||
|
||||
namespace MvvmCross.Forms.Views
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Binding.BindingContext;
|
||||
using MvvmCross.Forms.Views.EventSource;
|
||||
using MvvmCross.Forms.Views.Base;
|
||||
using MvvmCross.ViewModels;
|
||||
|
||||
namespace MvvmCross.Forms.Views
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Binding.BindingContext;
|
||||
using MvvmCross.Forms.Views.EventSource;
|
||||
using MvvmCross.Forms.Views.Base;
|
||||
using MvvmCross.ViewModels;
|
||||
|
||||
namespace MvvmCross.Forms.Views
|
||||
|
|
|
@ -16,15 +16,10 @@ namespace MvvmCross.Plugin.Visibility
|
|||
bool hide = parameter.ConvertToBooleanCore();
|
||||
switch (base.Convert(value, parameter, culture))
|
||||
{
|
||||
case MvxVisibility.Visible:
|
||||
if (hide)
|
||||
{
|
||||
return MvxVisibility.Hidden;
|
||||
}
|
||||
else
|
||||
{
|
||||
return MvxVisibility.Collapsed;
|
||||
}
|
||||
case MvxVisibility.Visible when hide:
|
||||
return MvxVisibility.Hidden;
|
||||
case MvxVisibility.Visible when !hide:
|
||||
return MvxVisibility.Collapsed;
|
||||
default:
|
||||
return MvxVisibility.Visible;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// The .NET Foundation licenses this file to you under the MS-PL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
|
||||
using MvvmCross.UI;
|
||||
|
||||
namespace MvvmCross.Plugin.Visibility.Platform.Console
|
||||
|
@ -10,13 +9,9 @@ namespace MvvmCross.Plugin.Visibility.Platform.Console
|
|||
[Preserve(AllMembers = true)]
|
||||
public class MvxConsoleVisibility : IMvxNativeVisibility
|
||||
{
|
||||
#region Implementation of IMvxNativeVisibility
|
||||
|
||||
public object ToNative(MvxVisibility visibility)
|
||||
{
|
||||
return visibility == MvxVisibility.Visible;
|
||||
}
|
||||
|
||||
#endregion Implementation of IMvxNativeVisibility
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,20 +4,17 @@
|
|||
|
||||
|
||||
using MvvmCross.UI;
|
||||
using UapVisibility = Windows.UI.Xaml.Visibility;
|
||||
|
||||
namespace MvvmCross.Plugin.Visibility.Platform.Uap
|
||||
{
|
||||
public class MvxWinRTVisibility : IMvxNativeVisibility
|
||||
{
|
||||
#region Implementation of IMvxNativeVisibility
|
||||
|
||||
public object ToNative(MvxVisibility visibility)
|
||||
{
|
||||
return visibility == MvxVisibility.Visible
|
||||
? Windows.UI.Xaml.Visibility.Visible
|
||||
: Windows.UI.Xaml.Visibility.Collapsed;
|
||||
? UapVisibility.Visible
|
||||
: UapVisibility.Collapsed;
|
||||
}
|
||||
|
||||
#endregion Implementation of IMvxNativeVisibility
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,22 +2,18 @@
|
|||
// The .NET Foundation licenses this file to you under the MS-PL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
|
||||
using MvvmCross.UI;
|
||||
using WpfVisibility = System.Windows.Visibility;
|
||||
|
||||
namespace MvvmCross.Plugin.Visibility.Platform.Wpf
|
||||
{
|
||||
public class MvxWpfVisibility : IMvxNativeVisibility
|
||||
{
|
||||
#region Implementation of IMvxNativeVisibility
|
||||
|
||||
public object ToNative(MvxVisibility visibility)
|
||||
{
|
||||
return visibility == MvxVisibility.Visible
|
||||
? System.Windows.Visibility.Visible
|
||||
: System.Windows.Visibility.Collapsed;
|
||||
? WpfVisibility.Visible
|
||||
: WpfVisibility.Collapsed;
|
||||
}
|
||||
|
||||
#endregion Implementation of IMvxNativeVisibility
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
// The .NET Foundation licenses this file to you under the MS-PL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
|
||||
using MvvmCross.UI;
|
||||
|
||||
namespace MvvmCross.Plugin.Visibility.Platform.iOS
|
||||
|
@ -10,13 +9,9 @@ namespace MvvmCross.Plugin.Visibility.Platform.iOS
|
|||
[Preserve(AllMembers = true)]
|
||||
public class MvxIosVisibility : IMvxNativeVisibility
|
||||
{
|
||||
#region Implementation of IMvxNativeVisibility
|
||||
|
||||
public object ToNative(MvxVisibility visibility)
|
||||
{
|
||||
return visibility;
|
||||
}
|
||||
|
||||
#endregion Implementation of IMvxNativeVisibility
|
||||
}
|
||||
}
|
||||
|
|
|
@ -135,6 +135,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Playground.Uwp", "Projects\
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Playground.Wpf", "Projects\Playground\Playground.Wpf\Playground.Wpf.csproj", "{88FD9F4C-2A82-4919-91F4-AFB2999F6394}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvvmCross.Plugins.Visibility.UnitTest", "UnitTests\Plugins.Visibility\MvvmCross.Plugins.Visibility.UnitTest.csproj", "{B5581657-2A45-4FE7-AFC9-96EA06188582}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
|
||||
|
@ -3264,6 +3266,62 @@ Global
|
|||
{88FD9F4C-2A82-4919-91F4-AFB2999F6394}.Release|x64.Build.0 = Release|Any CPU
|
||||
{88FD9F4C-2A82-4919-91F4-AFB2999F6394}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{88FD9F4C-2A82-4919-91F4-AFB2999F6394}.Release|x86.Build.0 = Release|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Ad-Hoc|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Ad-Hoc|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.AppStore|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.AppStore|ARM.ActiveCfg = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.AppStore|ARM.Build.0 = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.AppStore|iPhone.Build.0 = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.AppStore|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.AppStore|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.AppStore|x64.ActiveCfg = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.AppStore|x64.Build.0 = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.AppStore|x86.ActiveCfg = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.AppStore|x86.Build.0 = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Release|ARM.Build.0 = Release|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Release|x64.Build.0 = Release|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -3322,6 +3380,7 @@ Global
|
|||
{875FE27C-165C-46B4-BA05-7C1B047057F4} = {5339E878-07CE-4A32-9BE3-C3C86388D6DE}
|
||||
{AE22A4A5-8014-4A51-A237-4029D42F990F} = {5339E878-07CE-4A32-9BE3-C3C86388D6DE}
|
||||
{88FD9F4C-2A82-4919-91F4-AFB2999F6394} = {5339E878-07CE-4A32-9BE3-C3C86388D6DE}
|
||||
{B5581657-2A45-4FE7-AFC9-96EA06188582} = {9EA04A6A-1367-4316-A6E9-A5173A060475}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {56FC36CA-7AC1-4C41-A846-C6C8D7FE0403}
|
||||
|
|
|
@ -19,7 +19,6 @@ namespace Playground.Droid.Views
|
|||
[Register(nameof(SplitMasterView))]
|
||||
public class SplitMasterView : MvxFragment<SplitMasterViewModel>, NavigationView.IOnNavigationItemSelectedListener
|
||||
{
|
||||
private NavigationView navigationView;
|
||||
private IMenuItem previousMenuItem;
|
||||
|
||||
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Views.Attributes;
|
||||
using MvvmCross.Forms.Presenters.Attributes;
|
||||
using Playground.Core.ViewModels;
|
||||
|
||||
namespace Playground.Forms.UI.Pages
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Views.Attributes;
|
||||
using MvvmCross.Forms.Presenters.Attributes;
|
||||
using Playground.Core.ViewModels;
|
||||
|
||||
namespace Playground.Forms.UI.Pages
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Views.Attributes;
|
||||
using MvvmCross.Forms.Presenters.Attributes;
|
||||
using Playground.Core.ViewModels;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Views.Attributes;
|
||||
using MvvmCross.Forms.Presenters.Attributes;
|
||||
using Playground.Core.ViewModels;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Views.Attributes;
|
||||
using MvvmCross.Forms.Presenters.Attributes;
|
||||
using Playground.Core.ViewModels;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Views.Attributes;
|
||||
using MvvmCross.Forms.Presenters.Attributes;
|
||||
using Playground.Core.ViewModels;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Views.Attributes;
|
||||
using MvvmCross.Forms.Presenters.Attributes;
|
||||
using Playground.Core.ViewModels;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Views.Attributes;
|
||||
using MvvmCross.Forms.Presenters.Attributes;
|
||||
using Playground.Core.ViewModels;
|
||||
|
||||
namespace Playground.Forms.UI.Pages
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Views.Attributes;
|
||||
using MvvmCross.Forms.Presenters.Attributes;
|
||||
using Playground.Core.ViewModels;
|
||||
|
||||
namespace Playground.Forms.UI.Pages
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Views.Attributes;
|
||||
using MvvmCross.Forms.Presenters.Attributes;
|
||||
using Playground.Core.ViewModels;
|
||||
|
||||
namespace Playground.Forms.UI.Pages
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Views.Attributes;
|
||||
using MvvmCross.Forms.Presenters.Attributes;
|
||||
using Playground.Core.ViewModels;
|
||||
|
||||
namespace Playground.Forms.UI.Pages
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Views.Attributes;
|
||||
using MvvmCross.Forms.Presenters.Attributes;
|
||||
using Playground.Core.ViewModels;
|
||||
|
||||
namespace Playground.Forms.UI.Pages
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Views.Attributes;
|
||||
using MvvmCross.Forms.Presenters.Attributes;
|
||||
using Playground.Core.ViewModels;
|
||||
|
||||
namespace Playground.Forms.UI.Pages
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Views.Attributes;
|
||||
using MvvmCross.Forms.Presenters.Attributes;
|
||||
using Playground.Core.ViewModels;
|
||||
|
||||
namespace Playground.Forms.UI.Pages
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
using System;
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Views.Attributes;
|
||||
using MvvmCross.Forms.Presenters.Attributes;
|
||||
using Playground.Core.ViewModels;
|
||||
using Xamarin.Forms;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Views.Attributes;
|
||||
using MvvmCross.Forms.Presenters.Attributes;
|
||||
using Playground.Core.ViewModels;
|
||||
|
||||
namespace Playground.Forms.UI.Pages
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Views.Attributes;
|
||||
using MvvmCross.Forms.Presenters.Attributes;
|
||||
using Playground.Core.ViewModels;
|
||||
|
||||
namespace Playground.Forms.UI.Pages
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Views.Attributes;
|
||||
using MvvmCross.Forms.Presenters.Attributes;
|
||||
using Playground.Core.ViewModels;
|
||||
|
||||
namespace Playground.Forms.UI.Pages
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Views.Attributes;
|
||||
using MvvmCross.Forms.Presenters.Attributes;
|
||||
using Playground.Core.ViewModels;
|
||||
|
||||
namespace Playground.Forms.UI.Pages
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Forms.Views;
|
||||
using MvvmCross.Forms.Views.Attributes;
|
||||
using MvvmCross.Forms.Presenters.Attributes;
|
||||
using Playground.Core.ViewModels;
|
||||
|
||||
namespace Playground.Forms.UI.Pages
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MS-PL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using MvvmCross.Exceptions;
|
||||
using Xunit;
|
||||
|
||||
namespace MvvmCross.UnitTest.Base.Exceptions
|
||||
{
|
||||
public class MvxExceptionTest
|
||||
{
|
||||
[Fact]
|
||||
public void MvxWrap_Is_MvxException()
|
||||
{
|
||||
var ex = new Exception("hello");
|
||||
var wrapped = ex.MvxWrap();
|
||||
|
||||
Assert.IsType<MvxException>(wrapped);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MvxWrap_Is_Thrown_As_MvxException()
|
||||
{
|
||||
var ex = new Exception("hello");
|
||||
var wrapped = ex.MvxWrap();
|
||||
|
||||
Assert.Throws<MvxException>(() => Throw(wrapped));
|
||||
|
||||
void Throw(Exception e)
|
||||
{
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MvxWrap_Has_InnerException()
|
||||
{
|
||||
var ex = new Exception("hello");
|
||||
var wrapped = ex.MvxWrap();
|
||||
|
||||
Assert.NotNull(wrapped.InnerException);
|
||||
Assert.Equal(ex, wrapped.InnerException);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MvxWrap_Wraps_Only_One_Level()
|
||||
{
|
||||
var ex = new Exception("hello");
|
||||
var wrapped = ex.MvxWrap();
|
||||
|
||||
for (var i = 0; i < 10; i++)
|
||||
wrapped = wrapped.MvxWrap();
|
||||
|
||||
Assert.Equal(ex, wrapped.InnerException);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -345,7 +345,7 @@ namespace MvvmCross.UnitTest.Base
|
|||
Mvx.TryResolve<IOG<C2>>(out toResolve);
|
||||
|
||||
Assert.NotNull(toResolve);
|
||||
Assert.True(toResolve.GetType().GetTypeInfo().ImplementedInterfaces.Any(i => i == typeof(IOG<C2>)));
|
||||
Assert.Contains(toResolve.GetType().GetTypeInfo().ImplementedInterfaces, i => i == typeof(IOG<C2>));
|
||||
Assert.True(toResolve.GetType() == typeof(OG<C2>));
|
||||
}
|
||||
|
||||
|
@ -361,7 +361,7 @@ namespace MvvmCross.UnitTest.Base
|
|||
Mvx.TryResolve<IOG<C2>>(out toResolve);
|
||||
|
||||
Assert.NotNull(toResolve);
|
||||
Assert.True(toResolve.GetType().GetTypeInfo().ImplementedInterfaces.Any(i => i == typeof(IOG<C2>)));
|
||||
Assert.Contains(toResolve.GetType().GetTypeInfo().ImplementedInterfaces, i => i == typeof(IOG<C2>));
|
||||
Assert.True(toResolve.GetType() == typeof(OG<C2>));
|
||||
}
|
||||
|
||||
|
@ -377,7 +377,7 @@ namespace MvvmCross.UnitTest.Base
|
|||
Mvx.TryResolve<IOG2<C2,C>>(out toResolve);
|
||||
|
||||
Assert.NotNull(toResolve);
|
||||
Assert.True(toResolve.GetType().GetTypeInfo().ImplementedInterfaces.Any(i => i == typeof(IOG2<C2, C>)));
|
||||
Assert.Contains(toResolve.GetType().GetTypeInfo().ImplementedInterfaces, i => i == typeof(IOG2<C2, C>));
|
||||
Assert.True(toResolve.GetType() == typeof(OG2<C2, C>));
|
||||
}
|
||||
|
||||
|
@ -393,7 +393,7 @@ namespace MvvmCross.UnitTest.Base
|
|||
Mvx.TryResolve<IOG2<C2, C>>(out toResolve);
|
||||
|
||||
Assert.NotNull(toResolve);
|
||||
Assert.True(toResolve.GetType().GetTypeInfo().ImplementedInterfaces.Any(i => i == typeof(IOG2<C2, C>)));
|
||||
Assert.Contains(toResolve.GetType().GetTypeInfo().ImplementedInterfaces, i => i == typeof(IOG2<C2, C>));
|
||||
Assert.True(toResolve.GetType() == typeof(OG2<C2, C>));
|
||||
}
|
||||
|
||||
|
@ -424,9 +424,9 @@ namespace MvvmCross.UnitTest.Base
|
|||
Mvx.TryResolve<IHasOGParameter>(out toResolve);
|
||||
|
||||
Assert.NotNull(toResolve);
|
||||
Assert.True(toResolve.GetType().GetTypeInfo().ImplementedInterfaces.Any(i => i == typeof(IHasOGParameter)));
|
||||
Assert.Contains(toResolve.GetType().GetTypeInfo().ImplementedInterfaces, i => i == typeof(IHasOGParameter));
|
||||
Assert.True(toResolve.GetType() == typeof(HasOGParameter));
|
||||
Assert.True(toResolve.OpenGeneric.GetType().GetTypeInfo().ImplementedInterfaces.Any(i => i == typeof(IOG<C>)));
|
||||
Assert.Contains(toResolve.OpenGeneric.GetType().GetTypeInfo().ImplementedInterfaces, i => i == typeof(IOG<C>));
|
||||
Assert.True(toResolve.OpenGeneric.GetType() == typeof(OG<C>));
|
||||
}
|
||||
|
||||
|
|
|
@ -100,6 +100,13 @@ namespace MvvmCross.UnitTest.Base
|
|||
{
|
||||
return ReadTextUntilWhitespaceOr(items);
|
||||
}
|
||||
|
||||
public bool CallIsValidFirstCharacterOfCSharpName(char character)
|
||||
{
|
||||
return IsValidFirstCharacterOfCSharpName(character);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -328,5 +335,60 @@ namespace MvvmCross.UnitTest.Base
|
|||
Assert.True(exceptionThrown);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Reset_Resets_FullText_And_Index()
|
||||
{
|
||||
var parser = new Parser();
|
||||
parser.CallReset("derp");
|
||||
|
||||
Assert.Equal(0, parser.GetCurrentIndex());
|
||||
Assert.Equal("derp", parser.GetFullText());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData('a')]
|
||||
[InlineData('b')]
|
||||
[InlineData('c')]
|
||||
[InlineData('d')]
|
||||
[InlineData('e')]
|
||||
[InlineData('f')]
|
||||
[InlineData('g')]
|
||||
[InlineData('_')]
|
||||
[InlineData('Z')]
|
||||
[InlineData('Æ')]
|
||||
[InlineData('ø')]
|
||||
[InlineData('ä')]
|
||||
[InlineData('µ')]
|
||||
public void TestIsValidFirstCharacterOfCSharpName_OK(char character)
|
||||
{
|
||||
var parser = new Parser();
|
||||
var result = parser.CallIsValidFirstCharacterOfCSharpName(character);
|
||||
Assert.True(result);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData('1')]
|
||||
[InlineData(' ')]
|
||||
[InlineData('-')]
|
||||
[InlineData('\\')]
|
||||
[InlineData('^')]
|
||||
[InlineData('%')]
|
||||
[InlineData('$')]
|
||||
[InlineData('#')]
|
||||
[InlineData('@')]
|
||||
[InlineData('!')]
|
||||
[InlineData('&')]
|
||||
[InlineData('*')]
|
||||
[InlineData('(')]
|
||||
[InlineData(')')]
|
||||
[InlineData('+')]
|
||||
[InlineData('=')]
|
||||
public void TestIsValidFirstCharacterOfCSharpName_Fail(char character)
|
||||
{
|
||||
var parser = new Parser();
|
||||
var result = parser.CallIsValidFirstCharacterOfCSharpName(character);
|
||||
Assert.False(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -277,7 +277,7 @@ namespace MvvmCross.UnitTest.Binding.Binders
|
|||
|
||||
source.DoubleProperty1 = doubleProperty = 11.11;
|
||||
|
||||
Assert.Equal(1, changes.Count);
|
||||
Assert.Single(changes);
|
||||
Assert.Equal($"{doubleProperty}It was missing", changes[0]);
|
||||
|
||||
value = sourceStep.GetValue();
|
||||
|
@ -343,7 +343,7 @@ namespace MvvmCross.UnitTest.Binding.Binders
|
|||
|
||||
source.DoubleProperty1 = doubleProperty = 11.11;
|
||||
|
||||
Assert.Equal(1, changes.Count);
|
||||
Assert.Single(changes);
|
||||
Assert.Equal($"It was missing{doubleProperty}", changes[0]);
|
||||
|
||||
value = sourceStep.GetValue();
|
||||
|
@ -407,7 +407,7 @@ namespace MvvmCross.UnitTest.Binding.Binders
|
|||
|
||||
source.DoubleProperty1 = 11.11;
|
||||
|
||||
Assert.Equal(1, changes.Count);
|
||||
Assert.Single(changes);
|
||||
Assert.Equal(34.56, changes[0]);
|
||||
|
||||
value = sourceStep.GetValue();
|
||||
|
@ -449,7 +449,7 @@ namespace MvvmCross.UnitTest.Binding.Binders
|
|||
|
||||
source.Collection[0] = "Changed to 17";
|
||||
|
||||
Assert.Equal(1, changes.Count);
|
||||
Assert.Single(changes);
|
||||
Assert.Equal("Changed to 17", changes[0]);
|
||||
|
||||
value = sourceStep.GetValue();
|
||||
|
@ -462,11 +462,11 @@ namespace MvvmCross.UnitTest.Binding.Binders
|
|||
|
||||
source.Collection[0] = "Changed again 19";
|
||||
|
||||
Assert.Equal(1, changes.Count);
|
||||
Assert.Single(changes);
|
||||
|
||||
sourceStep.DataContext = source;
|
||||
|
||||
Assert.Equal(1, changes.Count);
|
||||
Assert.Single(changes);
|
||||
|
||||
value = sourceStep.GetValue();
|
||||
Assert.Equal("Changed again 19", value);
|
||||
|
@ -550,7 +550,7 @@ namespace MvvmCross.UnitTest.Binding.Binders
|
|||
|
||||
source.Property1 = "Changed to 17";
|
||||
|
||||
Assert.Equal(1, changes.Count);
|
||||
Assert.Single(changes);
|
||||
Assert.Equal("Changed to 17", changes[0]);
|
||||
|
||||
value = sourceStep.GetValue();
|
||||
|
@ -563,11 +563,11 @@ namespace MvvmCross.UnitTest.Binding.Binders
|
|||
|
||||
source.Property1 = "Changed again 19";
|
||||
|
||||
Assert.Equal(1, changes.Count);
|
||||
Assert.Single(changes);
|
||||
|
||||
sourceStep.DataContext = source;
|
||||
|
||||
Assert.Equal(1, changes.Count);
|
||||
Assert.Single(changes);
|
||||
|
||||
value = sourceStep.GetValue();
|
||||
Assert.Equal("Changed again 19", value);
|
||||
|
@ -750,7 +750,7 @@ namespace MvvmCross.UnitTest.Binding.Binders
|
|||
|
||||
source.SubSource.SubProperty1 = "Changed to 17";
|
||||
|
||||
Assert.Equal(1, changes.Count);
|
||||
Assert.Single(changes);
|
||||
Assert.Equal("Changed to 17", changes[0]);
|
||||
|
||||
value = sourceStep.GetValue();
|
||||
|
|
|
@ -49,7 +49,7 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
{
|
||||
Assert.Equal(1, mockTarget.SubscribeToEventsCalled);
|
||||
|
||||
Assert.Equal(1, mockTarget.Values.Count);
|
||||
Assert.Single(mockTarget.Values);
|
||||
Assert.Equal("TryGetValueValue", mockTarget.Values[0]);
|
||||
|
||||
mockSource.TryGetValueValue = "SecondValue";
|
||||
|
@ -62,9 +62,9 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
Assert.Equal(3, mockTarget.Values.Count);
|
||||
Assert.Equal("ThirdValue", mockTarget.Values[2]);
|
||||
|
||||
Assert.Equal(0, mockSource.ValuesSet.Count);
|
||||
Assert.Empty(mockSource.ValuesSet);
|
||||
mockTarget.FireValueChanged(new MvxTargetChangedEventArgs("FromTarget1"));
|
||||
Assert.Equal(1, mockSource.ValuesSet.Count);
|
||||
Assert.Single(mockSource.ValuesSet);
|
||||
Assert.Equal("FromTarget1", mockSource.ValuesSet[0]);
|
||||
mockTarget.FireValueChanged(new MvxTargetChangedEventArgs("FromTarget2"));
|
||||
Assert.Equal(2, mockSource.ValuesSet.Count);
|
||||
|
@ -127,7 +127,7 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
{
|
||||
Assert.Equal(0, mockTarget.SubscribeToEventsCalled);
|
||||
|
||||
Assert.Equal(1, mockTarget.Values.Count);
|
||||
Assert.Single(mockTarget.Values);
|
||||
Assert.Equal("TryGetValueValue", mockTarget.Values[0]);
|
||||
|
||||
mockSource.TryGetValueValue = "SecondValue";
|
||||
|
@ -140,11 +140,11 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
Assert.Equal(3, mockTarget.Values.Count);
|
||||
Assert.Equal("ThirdValue", mockTarget.Values[2]);
|
||||
|
||||
Assert.Equal(0, mockSource.ValuesSet.Count);
|
||||
Assert.Empty(mockSource.ValuesSet);
|
||||
mockTarget.FireValueChanged(new MvxTargetChangedEventArgs("FromTarget1"));
|
||||
Assert.Equal(0, mockSource.ValuesSet.Count);
|
||||
Assert.Empty(mockSource.ValuesSet);
|
||||
mockTarget.FireValueChanged(new MvxTargetChangedEventArgs("FromTarget2"));
|
||||
Assert.Equal(0, mockSource.ValuesSet.Count);
|
||||
Assert.Empty(mockSource.ValuesSet);
|
||||
|
||||
Assert.Equal(0, mockSource.DisposeCalled);
|
||||
Assert.Equal(0, mockTarget.DisposeCalled);
|
||||
|
@ -169,9 +169,9 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
Assert.Equal("NewValue", mockTarget.Values[5]);
|
||||
|
||||
mockTarget.FireValueChanged(new MvxTargetChangedEventArgs("FromTarget1"));
|
||||
Assert.Equal(0, mockSource.ValuesSet.Count);
|
||||
Assert.Empty(mockSource.ValuesSet);
|
||||
mockTarget.FireValueChanged(new MvxTargetChangedEventArgs("FromTarget2"));
|
||||
Assert.Equal(0, mockSource.ValuesSet.Count);
|
||||
Assert.Empty(mockSource.ValuesSet);
|
||||
|
||||
binding.Dispose();
|
||||
Assert.Equal(3, mockSource.DisposeCalled);
|
||||
|
@ -200,19 +200,19 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
{
|
||||
Assert.Equal(1, mockTarget.SubscribeToEventsCalled);
|
||||
|
||||
Assert.Equal(0, mockTarget.Values.Count);
|
||||
Assert.Empty(mockTarget.Values);
|
||||
|
||||
mockSource.TryGetValueValue = "SecondValue";
|
||||
mockSource.FireSourceChanged();
|
||||
Assert.Equal(0, mockTarget.Values.Count);
|
||||
Assert.Empty(mockTarget.Values);
|
||||
|
||||
mockSource.TryGetValueValue = "ThirdValue";
|
||||
mockSource.FireSourceChanged();
|
||||
Assert.Equal(0, mockTarget.Values.Count);
|
||||
Assert.Empty(mockTarget.Values);
|
||||
|
||||
Assert.Equal(0, mockSource.ValuesSet.Count);
|
||||
Assert.Empty(mockSource.ValuesSet);
|
||||
mockTarget.FireValueChanged(new MvxTargetChangedEventArgs("FromTarget1"));
|
||||
Assert.Equal(1, mockSource.ValuesSet.Count);
|
||||
Assert.Single(mockSource.ValuesSet);
|
||||
Assert.Equal("FromTarget1", mockSource.ValuesSet[0]);
|
||||
mockTarget.FireValueChanged(new MvxTargetChangedEventArgs("FromTarget2"));
|
||||
Assert.Equal(2, mockSource.ValuesSet.Count);
|
||||
|
@ -225,17 +225,17 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
Assert.Equal(1, mockSource.DisposeCalled);
|
||||
Assert.Equal(0, mockTarget.DisposeCalled);
|
||||
|
||||
Assert.Equal(0, mockTarget.Values.Count);
|
||||
Assert.Empty(mockTarget.Values);
|
||||
|
||||
binding.DataContext = new { ignored = 13 };
|
||||
Assert.Equal(2, mockSource.DisposeCalled);
|
||||
Assert.Equal(0, mockTarget.DisposeCalled);
|
||||
|
||||
Assert.Equal(0, mockTarget.Values.Count);
|
||||
Assert.Empty(mockTarget.Values);
|
||||
|
||||
mockSource.TryGetValueValue = "NewValue";
|
||||
mockSource.FireSourceChanged();
|
||||
Assert.Equal(0, mockTarget.Values.Count);
|
||||
Assert.Empty(mockTarget.Values);
|
||||
|
||||
mockTarget.FireValueChanged(new MvxTargetChangedEventArgs("FromTarget1"));
|
||||
Assert.Equal(3, mockSource.ValuesSet.Count);
|
||||
|
@ -271,22 +271,22 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
{
|
||||
Assert.Equal(0, mockTarget.SubscribeToEventsCalled);
|
||||
|
||||
Assert.Equal(1, mockTarget.Values.Count);
|
||||
Assert.Single(mockTarget.Values);
|
||||
Assert.Equal("TryGetValueValue", mockTarget.Values[0]);
|
||||
|
||||
mockSource.TryGetValueValue = "SecondValue";
|
||||
mockSource.FireSourceChanged();
|
||||
Assert.Equal(1, mockTarget.Values.Count);
|
||||
Assert.Single(mockTarget.Values);
|
||||
|
||||
mockSource.TryGetValueValue = "ThirdValue";
|
||||
mockSource.FireSourceChanged();
|
||||
Assert.Equal(1, mockTarget.Values.Count);
|
||||
Assert.Single(mockTarget.Values);
|
||||
|
||||
Assert.Equal(0, mockSource.ValuesSet.Count);
|
||||
Assert.Empty(mockSource.ValuesSet);
|
||||
mockTarget.FireValueChanged(new MvxTargetChangedEventArgs("FromTarget1"));
|
||||
Assert.Equal(0, mockSource.ValuesSet.Count);
|
||||
Assert.Empty(mockSource.ValuesSet);
|
||||
mockTarget.FireValueChanged(new MvxTargetChangedEventArgs("FromTarget2"));
|
||||
Assert.Equal(0, mockSource.ValuesSet.Count);
|
||||
Assert.Empty(mockSource.ValuesSet);
|
||||
|
||||
Assert.Equal(0, mockSource.DisposeCalled);
|
||||
Assert.Equal(0, mockTarget.DisposeCalled);
|
||||
|
@ -310,9 +310,9 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
Assert.Equal(3, mockTarget.Values.Count);
|
||||
|
||||
mockTarget.FireValueChanged(new MvxTargetChangedEventArgs("FromTarget1"));
|
||||
Assert.Equal(0, mockSource.ValuesSet.Count);
|
||||
Assert.Empty(mockSource.ValuesSet);
|
||||
mockTarget.FireValueChanged(new MvxTargetChangedEventArgs("FromTarget2"));
|
||||
Assert.Equal(0, mockSource.ValuesSet.Count);
|
||||
Assert.Empty(mockSource.ValuesSet);
|
||||
|
||||
binding.Dispose();
|
||||
Assert.Equal(3, mockSource.DisposeCalled);
|
||||
|
|
|
@ -41,9 +41,9 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
var parameter = new { Ignored = 12 };
|
||||
var binding = TestSetupCommon(mockValueConverter, parameter, typeof(object), out mockSource, out mockTarget);
|
||||
|
||||
Assert.Equal(1, mockTarget.Values.Count);
|
||||
Assert.Single(mockTarget.Values);
|
||||
Assert.Equal("Test ConversionResult", mockTarget.Values[0]);
|
||||
Assert.Equal(1, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Single(mockValueConverter.ConversionsRequested);
|
||||
Assert.Equal("TryGetValueValue", mockValueConverter.ConversionsRequested[0]);
|
||||
}
|
||||
|
||||
|
@ -59,9 +59,9 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
var parameter = new { Ignored = 12 };
|
||||
var binding = TestSetupCommon(mockValueConverter, parameter, typeof(object), out mockSource, out mockTarget);
|
||||
|
||||
Assert.Equal(1, mockTarget.Values.Count);
|
||||
Assert.Single(mockTarget.Values);
|
||||
Assert.Equal("Test ConversionResult", mockTarget.Values[0]);
|
||||
Assert.Equal(1, mockValueConverter.ConversionParameters.Count);
|
||||
Assert.Single(mockValueConverter.ConversionParameters);
|
||||
Assert.Equal(parameter, mockValueConverter.ConversionParameters[0]);
|
||||
}
|
||||
|
||||
|
@ -80,9 +80,9 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
var valueChanged = new { Hello = 34 };
|
||||
mockTarget.FireValueChanged(new MvxTargetChangedEventArgs(valueChanged));
|
||||
|
||||
Assert.Equal(1, mockSource.ValuesSet.Count);
|
||||
Assert.Single(mockSource.ValuesSet);
|
||||
Assert.Equal("Test ConversionBackResult", mockSource.ValuesSet[0]);
|
||||
Assert.Equal(1, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Single(mockValueConverter.ConversionsBackRequested);
|
||||
Assert.Equal(valueChanged, mockValueConverter.ConversionsBackRequested[0]);
|
||||
}
|
||||
|
||||
|
@ -101,9 +101,9 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
var valueChanged = new { Hello = 34 };
|
||||
mockTarget.FireValueChanged(new MvxTargetChangedEventArgs(valueChanged));
|
||||
|
||||
Assert.Equal(1, mockSource.ValuesSet.Count);
|
||||
Assert.Single(mockSource.ValuesSet);
|
||||
Assert.Equal("Test ConversionBackResult", mockSource.ValuesSet[0]);
|
||||
Assert.Equal(1, mockValueConverter.ConversionBackParameters.Count);
|
||||
Assert.Single(mockValueConverter.ConversionBackParameters);
|
||||
Assert.Equal(parameter, mockValueConverter.ConversionBackParameters[0]);
|
||||
}
|
||||
|
||||
|
@ -142,7 +142,7 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
mockSource.SourceType = aType.GetType();
|
||||
mockTarget.FireValueChanged(new MvxTargetChangedEventArgs("Ignored"));
|
||||
|
||||
Assert.Equal(1, mockValueConverter.ConversionBackTypes.Count);
|
||||
Assert.Single(mockValueConverter.ConversionBackTypes);
|
||||
Assert.Equal(aType.GetType(), mockValueConverter.ConversionBackTypes[0]);
|
||||
}
|
||||
|
||||
|
@ -159,10 +159,10 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
var fallback = new { Fred = "Not Barney" };
|
||||
var binding = TestSetupCommon(mockValueConverter, parameter, fallback, typeof(object), out mockSource, out mockTarget);
|
||||
|
||||
Assert.Equal(1, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Single(mockValueConverter.ConversionsRequested);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(1, mockTarget.Values.Count);
|
||||
Assert.Single(mockTarget.Values);
|
||||
Assert.Equal(fallback, mockTarget.Values[0]);
|
||||
}
|
||||
|
||||
|
@ -179,17 +179,17 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
var fallback = new { Fred = "Not Barney" };
|
||||
var binding = TestSetupCommon(mockValueConverter, parameter, fallback, typeof(object), out mockSource, out mockTarget);
|
||||
|
||||
Assert.Equal(1, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Single(mockValueConverter.ConversionsRequested);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(1, mockTarget.Values.Count);
|
||||
Assert.Single(mockTarget.Values);
|
||||
Assert.Equal("A test value", mockTarget.Values[0]);
|
||||
|
||||
mockSource.TryGetValueResult = false;
|
||||
mockSource.FireSourceChanged();
|
||||
|
||||
Assert.Equal(1, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Single(mockValueConverter.ConversionsRequested);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(2, mockTarget.Values.Count);
|
||||
Assert.Equal(fallback, mockTarget.Values[1]);
|
||||
|
@ -208,17 +208,17 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
object fallback = null;
|
||||
var binding = TestSetupCommon(mockValueConverter, parameter, fallback, typeof(object), out mockSource, out mockTarget);
|
||||
|
||||
Assert.Equal(1, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Single(mockValueConverter.ConversionsRequested);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(1, mockTarget.Values.Count);
|
||||
Assert.Single(mockTarget.Values);
|
||||
Assert.Null(mockTarget.Values[0]);
|
||||
|
||||
mockSource.TryGetValueValue = "Fred";
|
||||
mockSource.FireSourceChanged();
|
||||
|
||||
Assert.Equal(2, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(2, mockTarget.Values.Count);
|
||||
Assert.Null(mockTarget.Values[1]);
|
||||
|
@ -227,7 +227,7 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
mockSource.FireSourceChanged();
|
||||
|
||||
Assert.Equal(3, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(3, mockTarget.Values.Count);
|
||||
Assert.Null(mockTarget.Values[2]);
|
||||
|
@ -246,17 +246,17 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
object fallback = null;
|
||||
var binding = TestSetupCommon(mockValueConverter, parameter, fallback, typeof(int), out mockSource, out mockTarget);
|
||||
|
||||
Assert.Equal(1, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Single(mockValueConverter.ConversionsRequested);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(1, mockTarget.Values.Count);
|
||||
Assert.Single(mockTarget.Values);
|
||||
Assert.Equal(0, mockTarget.Values[0]);
|
||||
|
||||
mockSource.TryGetValueValue = "Fred";
|
||||
mockSource.FireSourceChanged();
|
||||
|
||||
Assert.Equal(2, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(2, mockTarget.Values.Count);
|
||||
Assert.Equal(0, mockTarget.Values[1]);
|
||||
|
@ -265,7 +265,7 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
mockSource.FireSourceChanged();
|
||||
|
||||
Assert.Equal(3, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(3, mockTarget.Values.Count);
|
||||
Assert.Equal(0, mockTarget.Values[2]);
|
||||
|
@ -284,17 +284,17 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
object fallback = null;
|
||||
var binding = TestSetupCommon(mockValueConverter, parameter, fallback, typeof(int?), out mockSource, out mockTarget);
|
||||
|
||||
Assert.Equal(1, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Single(mockValueConverter.ConversionsRequested);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(1, mockTarget.Values.Count);
|
||||
Assert.Single(mockTarget.Values);
|
||||
Assert.Null(mockTarget.Values[0]);
|
||||
|
||||
mockSource.TryGetValueValue = "Fred";
|
||||
mockSource.FireSourceChanged();
|
||||
|
||||
Assert.Equal(2, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(2, mockTarget.Values.Count);
|
||||
Assert.Null(mockTarget.Values[1]);
|
||||
|
@ -303,7 +303,7 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
mockSource.FireSourceChanged();
|
||||
|
||||
Assert.Equal(3, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(3, mockTarget.Values.Count);
|
||||
Assert.Null(mockTarget.Values[2]);
|
||||
|
@ -322,17 +322,17 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
object fallback = null;
|
||||
var binding = TestSetupCommon(mockValueConverter, parameter, fallback, typeof(object), out mockSource, out mockTarget);
|
||||
|
||||
Assert.Equal(1, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Single(mockValueConverter.ConversionsRequested);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(1, mockTarget.Values.Count);
|
||||
Assert.Single(mockTarget.Values);
|
||||
Assert.Equal("A test value", mockTarget.Values[0]);
|
||||
|
||||
mockSource.TryGetValueResult = false;
|
||||
mockSource.FireSourceChanged();
|
||||
|
||||
Assert.Equal(1, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Single(mockValueConverter.ConversionsRequested);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(2, mockTarget.Values.Count);
|
||||
Assert.Null(mockTarget.Values[1]);
|
||||
|
@ -340,8 +340,8 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
mockSource.TryGetValueResult = false;
|
||||
mockSource.FireSourceChanged();
|
||||
|
||||
Assert.Equal(1, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Single(mockValueConverter.ConversionsRequested);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(3, mockTarget.Values.Count);
|
||||
Assert.Null(mockTarget.Values[2]);
|
||||
|
@ -351,7 +351,7 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
mockSource.FireSourceChanged();
|
||||
|
||||
Assert.Equal(2, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(4, mockTarget.Values.Count);
|
||||
Assert.Equal("A test value", mockTarget.Values[3]);
|
||||
|
@ -370,17 +370,17 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
object fallback = null;
|
||||
var binding = TestSetupCommon(mockValueConverter, parameter, fallback, typeof(int), out mockSource, out mockTarget);
|
||||
|
||||
Assert.Equal(1, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Single(mockValueConverter.ConversionsRequested);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(1, mockTarget.Values.Count);
|
||||
Assert.Single(mockTarget.Values);
|
||||
Assert.Equal("A test value", mockTarget.Values[0]);
|
||||
|
||||
mockSource.TryGetValueResult = false;
|
||||
mockSource.FireSourceChanged();
|
||||
|
||||
Assert.Equal(1, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Single(mockValueConverter.ConversionsRequested);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(2, mockTarget.Values.Count);
|
||||
Assert.Equal(0, mockTarget.Values[1]);
|
||||
|
@ -388,8 +388,8 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
mockSource.TryGetValueResult = false;
|
||||
mockSource.FireSourceChanged();
|
||||
|
||||
Assert.Equal(1, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Single(mockValueConverter.ConversionsRequested);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(3, mockTarget.Values.Count);
|
||||
Assert.Equal(0, mockTarget.Values[2]);
|
||||
|
@ -397,8 +397,8 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
mockSource.TryGetValueResult = false;
|
||||
mockSource.FireSourceChanged();
|
||||
|
||||
Assert.Equal(1, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Single(mockValueConverter.ConversionsRequested);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(4, mockTarget.Values.Count);
|
||||
Assert.Equal(0, mockTarget.Values[3]);
|
||||
|
@ -417,17 +417,17 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
object fallback = null;
|
||||
var binding = TestSetupCommon(mockValueConverter, parameter, fallback, typeof(int?), out mockSource, out mockTarget);
|
||||
|
||||
Assert.Equal(1, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Single(mockValueConverter.ConversionsRequested);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(1, mockTarget.Values.Count);
|
||||
Assert.Single(mockTarget.Values);
|
||||
Assert.Equal("A test value", mockTarget.Values[0]);
|
||||
|
||||
mockSource.TryGetValueResult = false;
|
||||
mockSource.FireSourceChanged();
|
||||
|
||||
Assert.Equal(1, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Single(mockValueConverter.ConversionsRequested);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(2, mockTarget.Values.Count);
|
||||
Assert.Null(mockTarget.Values[1]);
|
||||
|
@ -435,8 +435,8 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
mockSource.TryGetValueResult = false;
|
||||
mockSource.FireSourceChanged();
|
||||
|
||||
Assert.Equal(1, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Single(mockValueConverter.ConversionsRequested);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(3, mockTarget.Values.Count);
|
||||
Assert.Null(mockTarget.Values[2]);
|
||||
|
@ -444,8 +444,8 @@ namespace MvvmCross.UnitTest.Binding.Bindings
|
|||
mockSource.TryGetValueResult = false;
|
||||
mockSource.FireSourceChanged();
|
||||
|
||||
Assert.Equal(1, mockValueConverter.ConversionsRequested.Count);
|
||||
Assert.Equal(0, mockValueConverter.ConversionsBackRequested.Count);
|
||||
Assert.Single(mockValueConverter.ConversionsRequested);
|
||||
Assert.Empty(mockValueConverter.ConversionsBackRequested);
|
||||
|
||||
Assert.Equal(4, mockTarget.Values.Count);
|
||||
Assert.Null(mockTarget.Values[3]);
|
||||
|
|
|
@ -456,7 +456,7 @@ namespace MvvmCross.UnitTest.Binding.ExpressionParse
|
|||
|
||||
action(testTarget);
|
||||
|
||||
Assert.Equal(1, callbacksSeen.Count);
|
||||
Assert.Single(callbacksSeen);
|
||||
var callback = callbacksSeen[0];
|
||||
var expectedTarget = findTargetObjectFunc(testTarget);
|
||||
Assert.Equal(expectedTarget, callback.Target);
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace MvvmCross.UnitTest.Binding.Parse.Binding.Lang
|
|||
MvxSerializableBindingSpecification result;
|
||||
var parsed = language.TryParseBindingSpecification(testPair.Key, out result);
|
||||
Assert.True(parsed, "Failed to parse " + testPair.Key);
|
||||
Assert.Equal(1, result.Count);
|
||||
Assert.Single(result);
|
||||
var keyAndDescription = testPair.Value.First();
|
||||
var resultKeyAndDescription = result.First();
|
||||
var expectedDescription = new MvxSerializableBindingDescription()
|
||||
|
|
|
@ -476,30 +476,16 @@ namespace MvvmCross.UnitTest.Binding.Parse.Binding.Swiss
|
|||
PerformTest(text, expected);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestFunctionalValueConverterWithNullInTheName()
|
||||
{
|
||||
TestFunctionalValueConverterWithKEYWORDInTheName("Null");
|
||||
TestFunctionalValueConverterWithKEYWORDInTheName("null");
|
||||
TestFunctionalValueConverterWithKEYWORDInTheName("NULL");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestFunctionalValueConverterWithTrueInTheName()
|
||||
{
|
||||
TestFunctionalValueConverterWithKEYWORDInTheName("True");
|
||||
TestFunctionalValueConverterWithKEYWORDInTheName("true");
|
||||
TestFunctionalValueConverterWithKEYWORDInTheName("TRUE");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestFunctionalValueConverterWithFalseInTheName()
|
||||
{
|
||||
TestFunctionalValueConverterWithKEYWORDInTheName("False");
|
||||
TestFunctionalValueConverterWithKEYWORDInTheName("false");
|
||||
TestFunctionalValueConverterWithKEYWORDInTheName("FALSE");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("Null")]
|
||||
[InlineData("null")]
|
||||
[InlineData("NULL")]
|
||||
[InlineData("True")]
|
||||
[InlineData("true")]
|
||||
[InlineData("TRUE")]
|
||||
[InlineData("False")]
|
||||
[InlineData("false")]
|
||||
[InlineData("FALSE")]
|
||||
public void TestFunctionalValueConverterWithKEYWORDInTheName(string keyword)
|
||||
{
|
||||
var text = "Target " + keyword + "This(Foo, 'Hello World')";
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
// MvxColorValueConverterTest.cs
|
||||
// (c) Copyright Cirrious Ltd. http://www.cirrious.com
|
||||
// MvvmCross is licensed using Microsoft Public License (Ms-PL)
|
||||
// Contributions and inspirations noted in readme.md and license.txt
|
||||
//
|
||||
// Project Lead - Stuart Lodge, @slodge, me@slodge.com
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MS-PL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Test;
|
||||
using Xunit;
|
||||
|
|
|
@ -350,19 +350,19 @@ namespace MvvmCross.Plugins.Messenger.UnitTest
|
|||
Assert.Null(messenger.GetSubscriptionTagsFor<MvxSubscriberChangeMessage>()[0]);
|
||||
Assert.Equal(3, messenger.GetSubscriptionTagsFor<TestMessage>().Count);
|
||||
Assert.Equal(2, messenger.GetSubscriptionTagsFor<TestMessage>().Where(x => x == testTag1).Count());
|
||||
Assert.Equal(1, messenger.GetSubscriptionTagsFor<TestMessage>().Where(x => x == testTag2).Count());
|
||||
Assert.Single(messenger.GetSubscriptionTagsFor<TestMessage>().Where(x => x == testTag2));
|
||||
messenger.Unsubscribe<TestMessage>(token);
|
||||
Assert.Equal(1, messenger.GetSubscriptionTagsFor<MvxSubscriberChangeMessage>().Count);
|
||||
Assert.Null(messenger.GetSubscriptionTagsFor<MvxSubscriberChangeMessage>()[0]);
|
||||
Assert.Equal(2, messenger.GetSubscriptionTagsFor<TestMessage>().Count);
|
||||
Assert.Equal(1, messenger.GetSubscriptionTagsFor<TestMessage>().Where(x => x == testTag1).Count());
|
||||
Assert.Equal(1, messenger.GetSubscriptionTagsFor<TestMessage>().Where(x => x == testTag2).Count());
|
||||
Assert.Single(messenger.GetSubscriptionTagsFor<TestMessage>().Where(x => x == testTag1));
|
||||
Assert.Single(messenger.GetSubscriptionTagsFor<TestMessage>().Where(x => x == testTag2));
|
||||
messenger.Unsubscribe<TestMessage>(token2);
|
||||
Assert.Equal(1, messenger.GetSubscriptionTagsFor<MvxSubscriberChangeMessage>().Count);
|
||||
Assert.Null(messenger.GetSubscriptionTagsFor<MvxSubscriberChangeMessage>()[0]);
|
||||
Assert.Equal(1, messenger.GetSubscriptionTagsFor<TestMessage>().Count);
|
||||
Assert.Equal(0, messenger.GetSubscriptionTagsFor<TestMessage>().Where(x => x == testTag1).Count());
|
||||
Assert.Equal(1, messenger.GetSubscriptionTagsFor<TestMessage>().Where(x => x == testTag2).Count());
|
||||
Assert.Empty(messenger.GetSubscriptionTagsFor<TestMessage>().Where(x => x == testTag1));
|
||||
Assert.Single(messenger.GetSubscriptionTagsFor<TestMessage>().Where(x => x == testTag2));
|
||||
messenger.Unsubscribe<TestMessage>(token3);
|
||||
Assert.Equal(1, messenger.GetSubscriptionTagsFor<MvxSubscriberChangeMessage>().Count);
|
||||
Assert.Null(messenger.GetSubscriptionTagsFor<MvxSubscriberChangeMessage>()[0]);
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace MvvmCross.Plugins.Network.UnitTest
|
|||
Assert.NotNull(theResponse.Result);
|
||||
Assert.Equal(HttpStatusCode.OK, theResponse.StatusCode);
|
||||
Assert.True(theResponse.Result.items.Count == 10);
|
||||
Assert.True(theResponse.Result.items[0].ToString().Contains("MonoTouch"));
|
||||
Assert.Contains("MonoTouch", theResponse.Result.items[0].ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
<AssemblyName>MvvmCross.Plugins.Visibility.UnitTest</AssemblyName>
|
||||
<RootNamespace>MvvmCross.Plugins.Visibility.UnitTest</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
|
||||
<PackageReference Include="Moq" Version="4.8.1" />
|
||||
<PackageReference Include="xunit" Version="2.3.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
|
||||
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\MvvmCross.Plugins\Visibility\MvvmCross.Plugin.Visibility.csproj" />
|
||||
<ProjectReference Include="..\..\MvvmCross.Test\MvvmCross.Test.csproj" />
|
||||
<ProjectReference Include="..\..\MvvmCross\MvvmCross.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />
|
||||
</Project>
|
|
@ -0,0 +1,17 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MS-PL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using MvvmCross.Test;
|
||||
using Xunit;
|
||||
|
||||
namespace MvvmCross.Plugins.Visibility.UnitTest
|
||||
{
|
||||
[CollectionDefinition("Visibility")]
|
||||
public class VisibilityCollection : ICollectionFixture<MvxTestFixture>
|
||||
{
|
||||
// This class has no code, and is never created. Its purpose is simply
|
||||
// to be the place to apply [CollectionDefinition] and all the
|
||||
// ICollectionFixture<> interfaces.
|
||||
}
|
||||
}
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче