From 94acad7b5d8217d9ed75ed9054429ce381bf37d8 Mon Sep 17 00:00:00 2001 From: nmilcoff Date: Sun, 11 Feb 2018 17:38:24 -0300 Subject: [PATCH] ExtensionMethods -> Extensions --- .../Fragment/MvxFragmentExtensions.cs | 48 ++++++++++++++ .../MvxFragmentViewExtensionMethods.cs | 65 ------------------- .../V7.RecyclerView/MvxRecyclerAdapter.cs | 2 +- ...ds.cs => MvxBindablePropertyExtensions.cs} | 4 +- .../MvxBindablePropertyTargetBinding.cs | 2 +- .../FieldBinding/MvxLeafFieldSourceBinding.cs | 2 +- .../MvxLeafNotifyChangeFieldSourceBinding.cs | 2 +- .../MvxMethodSourceBindingFactoryExtension.cs | 3 +- ...hods.cs => MvxPictureChooserExtensions.cs} | 2 +- ...ionMethods.cs => MvxDelegateExtensions.cs} | 2 +- ...ethods.cs => MvxPropertyNameExtensions.cs} | 2 +- ...Methods.cs => MvxBindingModeExtensions.cs} | 4 +- .../Leaf/MvxLeafPropertyInfoSourceBinding.cs | 2 +- .../Target/MvxConvertingTargetBinding.cs | 2 +- .../Combiners/MvxBooleanValueCombiner.cs | 2 +- .../Binding/Combiners/MvxIfValueCombiner.cs | 2 +- .../IMvxEditableTextView.cs | 6 +- .../MvxBindingExtensions.cs | 6 +- .../MvxEnumerableExtensions.cs | 4 +- ... MvxSimplePropertyDictionaryExtensions.cs} | 6 +- ...onMethods.cs => MvxExceptionExtensions.cs} | 2 +- ...cs => MvxConventionAttributeExtensions.cs} | 2 +- ...ionMethods.cs => MvxDateTimeExtensions.cs} | 2 +- ...> MvxAndroidWeakSubscriptionExtensions.cs} | 2 +- .../MvxTextViewTextFormattedTargetBinding.cs | 2 +- .../Target/MvxTextViewTextTargetBinding.cs | 2 +- .../Binding/Target/MvxViewHiddenBinding.cs | 2 +- .../Binding/Target/MvxViewVisibleBinding.cs | 2 +- .../Android/Binding/Views/MvxAdapter.cs | 2 +- .../Binding/Views/MvxExpandableListAdapter.cs | 2 +- .../Views/Fragments/MvxFragmentExtensions.cs | 48 ++++++++++++++ .../MvxFragmentViewExtensionMethods.cs | 64 ------------------ .../Base/MvxIosColorExtensions.cs} | 2 +- .../Base/MvxIosDateTimeExtensions.cs} | 2 +- .../Views/MvxCanCreateIosViewExtensions.cs} | 2 +- .../Views/MvxSegueExtensions.cs} | 2 +- .../Views/MvxViewControllerExtensions.cs} | 2 +- .../Views/UIViewControllerExtensions.cs} | 2 +- .../Views/ViewExtensions.cs} | 0 .../Mac/Binding/Views/MvxTableViewSource.cs | 2 +- ...Methods.cs => MvxMacDateTimeExtensions.cs} | 2 +- ...ensionMethods.cs => MvxSegueExtensions.cs} | 2 +- ...hods.cs => MvxViewControllerExtensions.cs} | 2 +- ...onMethods.cs => MvxTvosColorExtensions.cs} | 2 +- ...ethods.cs => MvxTvosDateTimeExtensions.cs} | 2 +- .../Target/MvxUITextFieldTextTargetBinding.cs | 2 +- .../Target/MvxUIViewHiddenTargetBinding.cs | 2 +- .../Target/MvxUIViewVisibleTargetBinding.cs | 2 +- .../Binding/Views/MvxCollectionViewSource.cs | 2 +- .../Views/MvxCollectionViewSourceAnimated.cs | 2 +- .../Tvos/Binding/Views/MvxTableViewSource.cs | 2 +- ...s.cs => MvxCanCreateTvosViewExtensions.cs} | 2 +- ...ensionMethods.cs => MvxSegueExtensions.cs} | 2 +- ...hods.cs => MvxViewControllerExtensions.cs} | 2 +- ...thods.cs => UIViewControllerExtensions.cs} | 2 +- ...Methods.cs => MvxPseudoAsyncExtensions.cs} | 2 +- .../MvxDependencyPropertyTargetBinding.cs | 2 +- ....cs => MvxDependencyPropertyExtensions.cs} | 2 +- ...sionMethods.cs => MvxWindowsExtensions.cs} | 2 +- .../MvxDependencyPropertyTargetBinding.cs | 2 +- ....cs => MvxDependencyPropertyExtensions.cs} | 2 +- .../Base/MvxIosUIViewControllerExtensions.cs | 30 --------- .../Target/MvxUITextFieldTextTargetBinding.cs | 2 +- .../Target/MvxUIViewHiddenTargetBinding.cs | 2 +- .../Target/MvxUIViewVisibleTargetBinding.cs | 2 +- .../Binding/Views/MvxCollectionViewSource.cs | 2 +- .../Views/MvxCollectionViewSourceAnimated.cs | 2 +- .../iOS/Binding/Views/MvxPickerViewModel.cs | 2 +- .../iOS/Binding/Views/MvxTableViewSource.cs | 2 +- ...Methods.cs => MvxInteractionExtensions.cs} | 4 +- ...tensionMethods.cs => MvxViewExtensions.cs} | 6 +- ...ds.cs => MvxWeakSubscriptionExtensions.cs} | 2 +- .../ExtensionMethods/MakeSafeValueTest.cs | 2 +- 73 files changed, 175 insertions(+), 239 deletions(-) delete mode 100644 MvvmCross.Android.Support/Fragment/MvxFragmentViewExtensionMethods.cs rename MvvmCross.Forms/Bindings/{MvxBindablePropertyExtensionMethods.cs => MvxBindablePropertyExtensions.cs} (97%) rename MvvmCross.Plugins/PictureChooser/{MvxPictureChooserExtensionMethods.cs => MvxPictureChooserExtensions.cs} (94%) rename MvvmCross/Base/{MvxDelegateExtensionMethods.cs => MvxDelegateExtensions.cs} (92%) rename MvvmCross/Base/{MvxPropertyNameExtensionMethods.cs => MvxPropertyNameExtensions.cs} (97%) rename MvvmCross/Binding/Bindings/{MvxBindingModeExtensionMethods.cs => MvxBindingModeExtensions.cs} (95%) rename MvvmCross/Binding/{ExtensionMethods => Extensions}/IMvxEditableTextView.cs (67%) rename MvvmCross/Binding/{ExtensionMethods => Extensions}/MvxBindingExtensions.cs (95%) rename MvvmCross/Binding/{ExtensionMethods => Extensions}/MvxEnumerableExtensions.cs (98%) rename MvvmCross/Core/{MvxSimplePropertyDictionaryExtensionMethods.cs => MvxSimplePropertyDictionaryExtensions.cs} (98%) rename MvvmCross/Exceptions/{MvxExceptionExtensionMethods.cs => MvxExceptionExtensions.cs} (96%) rename MvvmCross/IoC/{MvxConventionAttributeExtensionMethods.cs => MvxConventionAttributeExtensions.cs} (97%) rename MvvmCross/Platform/Android/Base/Platform/{MvxDateTimeExtensionMethods.cs => MvxDateTimeExtensions.cs} (96%) rename MvvmCross/Platform/Android/Base/WeakSubscription/{MvxAndroidWeakSubscriptionExtensionMethods.cs => MvxAndroidWeakSubscriptionExtensions.cs} (93%) delete mode 100644 MvvmCross/Platform/Android/Views/Fragments/MvxFragmentViewExtensionMethods.cs rename MvvmCross/Platform/{iOS/Base/MvxIosColorExtensionMethods.cs => Ios/Base/MvxIosColorExtensions.cs} (96%) rename MvvmCross/Platform/{iOS/Base/MvxIosDateTimeExtensionMethods.cs => Ios/Base/MvxIosDateTimeExtensions.cs} (94%) rename MvvmCross/Platform/{iOS/Views/MvxCanCreateIosViewExtensionMethods.cs => Ios/Views/MvxCanCreateIosViewExtensions.cs} (97%) rename MvvmCross/Platform/{iOS/Views/MvxSegueExtensionMethods.cs => Ios/Views/MvxSegueExtensions.cs} (98%) rename MvvmCross/Platform/{iOS/Views/MvxViewControllerExtensionMethods.cs => Ios/Views/MvxViewControllerExtensions.cs} (96%) rename MvvmCross/Platform/{iOS/Views/UIViewControllerExtensionMethods.cs => Ios/Views/UIViewControllerExtensions.cs} (92%) rename MvvmCross/Platform/{iOS/Views/Extensions.cs => Ios/Views/ViewExtensions.cs} (100%) rename MvvmCross/Platform/Mac/ExtensionMethods/{MvxMacDateTimeExtensionMethods.cs => MvxMacDateTimeExtensions.cs} (93%) rename MvvmCross/Platform/Mac/Views/{MvxSegueExtensionMethods.cs => MvxSegueExtensions.cs} (98%) rename MvvmCross/Platform/Mac/Views/{MvxViewControllerExtensionMethods.cs => MvxViewControllerExtensions.cs} (98%) rename MvvmCross/Platform/Tvos/Base/{MvxTvosColorExtensionMethods.cs => MvxTvosColorExtensions.cs} (96%) rename MvvmCross/Platform/Tvos/Base/{MvxTvosDateTimeExtensionMethods.cs => MvxTvosDateTimeExtensions.cs} (93%) rename MvvmCross/Platform/Tvos/Views/{MvxCanCreateTvosViewExtensionMethods.cs => MvxCanCreateTvosViewExtensions.cs} (97%) rename MvvmCross/Platform/Tvos/Views/{MvxSegueExtensionMethods.cs => MvxSegueExtensions.cs} (98%) rename MvvmCross/Platform/Tvos/Views/{MvxViewControllerExtensionMethods.cs => MvxViewControllerExtensions.cs} (96%) rename MvvmCross/Platform/Tvos/Views/{UIViewControllerExtensionMethods.cs => UIViewControllerExtensions.cs} (92%) rename MvvmCross/Platform/Uap/Base/Platform/{MvxPseudoAsyncExtensionMethods.cs => MvxPseudoAsyncExtensions.cs} (95%) rename MvvmCross/Platform/Uap/Binding/{MvxDependencyPropertyExtensionMethods.cs => MvxDependencyPropertyExtensions.cs} (97%) rename MvvmCross/Platform/Uap/Views/{MvxWindowsExtensionMethods.cs => MvxWindowsExtensions.cs} (98%) rename MvvmCross/Platform/Wpf/Binding/{MvxDependencyPropertyExtensionMethods.cs => MvxDependencyPropertyExtensions.cs} (97%) delete mode 100644 MvvmCross/Platform/iOS/Base/MvxIosUIViewControllerExtensions.cs rename MvvmCross/ViewModels/{MvxInteractionExtensionMethods.cs => MvxInteractionExtensions.cs} (95%) rename MvvmCross/Views/{MvxViewExtensionMethods.cs => MvxViewExtensions.cs} (95%) rename MvvmCross/WeakSubscription/{MvxWeakSubscriptionExtensionMethods.cs => MvxWeakSubscriptionExtensions.cs} (98%) diff --git a/MvvmCross.Android.Support/Fragment/MvxFragmentExtensions.cs b/MvvmCross.Android.Support/Fragment/MvxFragmentExtensions.cs index f877671fa..e2adc6e58 100644 --- a/MvvmCross.Android.Support/Fragment/MvxFragmentExtensions.cs +++ b/MvvmCross.Android.Support/Fragment/MvxFragmentExtensions.cs @@ -6,6 +6,7 @@ using Android.Support.V4.App; using Android.Views; using MvvmCross.Droid.Support.V4.EventSource; using MvvmCross.Exceptions; +using MvvmCross.Logging; using MvvmCross.Platform.Android.Binding.BindingContext; using MvvmCross.Platform.Android.Core; using MvvmCross.Platform.Android.Views; @@ -104,5 +105,52 @@ namespace MvvmCross.Droid.Support.V4 var setupSingleton = MvxAndroidSetupSingleton.EnsureSingletonAvailable(fragment.Activity.ApplicationContext); setupSingleton.EnsureInitialized(); } + + public static TFragment FindFragmentById(this MvxFragmentActivity activity, int resourceId) + where TFragment : Fragment + { + var fragment = activity.SupportFragmentManager.FindFragmentById(resourceId); + if (fragment == null) { + MvxAndroidLog.Instance.Warn("Failed to find fragment id {0} in {1}", resourceId, activity.GetType().Name); + return default(TFragment); + } + + return SafeCast(fragment); + } + + public static TFragment FindFragmentByTag(this MvxFragmentActivity activity, string tag) + where TFragment : Fragment + { + var fragment = activity.SupportFragmentManager.FindFragmentByTag(tag); + if (fragment == null) { + MvxAndroidLog.Instance.Warn("Failed to find fragment tag {0} in {1}", tag, activity.GetType().Name); + return default(TFragment); + } + + return SafeCast(fragment); + } + + private static TFragment SafeCast(Fragment fragment) where TFragment : Fragment + { + if (!(fragment is TFragment)) { + MvxAndroidLog.Instance.Warn("Fragment type mismatch got {0} but expected {1}", fragment.GetType().FullName, + typeof(TFragment).FullName); + return default(TFragment); + } + + return (TFragment)fragment; + } + + public static void LoadViewModelFrom(this IMvxFragmentView view, MvxViewModelRequest request, IMvxBundle savedState = null) + { + var loader = Mvx.Resolve(); + var viewModel = loader.LoadViewModel(request, savedState); + if (viewModel == null) { + MvxAndroidLog.Instance.Warn("ViewModel not loaded for {0}", request.ViewModelType.FullName); + return; + } + + view.ViewModel = viewModel; + } } } diff --git a/MvvmCross.Android.Support/Fragment/MvxFragmentViewExtensionMethods.cs b/MvvmCross.Android.Support/Fragment/MvxFragmentViewExtensionMethods.cs deleted file mode 100644 index b2b96a94c..000000000 --- a/MvvmCross.Android.Support/Fragment/MvxFragmentViewExtensionMethods.cs +++ /dev/null @@ -1,65 +0,0 @@ -// 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 Android.Support.V4.App; -using MvvmCross.Logging; -using MvvmCross.Platform.Android.Views; -using MvvmCross.ViewModels; - -namespace MvvmCross.Droid.Support.V4 -{ - public static class MvxFragmentExtensionMethods - { - public static TFragment FindFragmentById(this MvxFragmentActivity activity, int resourceId) - where TFragment : Fragment - { - var fragment = activity.SupportFragmentManager.FindFragmentById(resourceId); - if (fragment == null) - { - MvxAndroidLog.Instance.Warn("Failed to find fragment id {0} in {1}", resourceId, activity.GetType().Name); - return default(TFragment); - } - - return SafeCast(fragment); - } - - public static TFragment FindFragmentByTag(this MvxFragmentActivity activity, string tag) - where TFragment : Fragment - { - var fragment = activity.SupportFragmentManager.FindFragmentByTag(tag); - if (fragment == null) - { - MvxAndroidLog.Instance.Warn("Failed to find fragment tag {0} in {1}", tag, activity.GetType().Name); - return default(TFragment); - } - - return SafeCast(fragment); - } - - private static TFragment SafeCast(Fragment fragment) where TFragment : Fragment - { - if (!(fragment is TFragment)) - { - MvxAndroidLog.Instance.Warn("Fragment type mismatch got {0} but expected {1}", fragment.GetType().FullName, - typeof(TFragment).FullName); - return default(TFragment); - } - - return (TFragment)fragment; - } - - public static void LoadViewModelFrom(this IMvxFragmentView view, MvxViewModelRequest request, IMvxBundle savedState = null) - { - var loader = Mvx.Resolve(); - var viewModel = loader.LoadViewModel(request, savedState); - if (viewModel == null) - { - MvxAndroidLog.Instance.Warn("ViewModel not loaded for {0}", request.ViewModelType.FullName); - return; - } - - view.ViewModel = viewModel; - } - } -} diff --git a/MvvmCross.Android.Support/V7.RecyclerView/MvxRecyclerAdapter.cs b/MvvmCross.Android.Support/V7.RecyclerView/MvxRecyclerAdapter.cs index f3bbdf8c4..d2e2aae3c 100644 --- a/MvvmCross.Android.Support/V7.RecyclerView/MvxRecyclerAdapter.cs +++ b/MvvmCross.Android.Support/V7.RecyclerView/MvxRecyclerAdapter.cs @@ -11,7 +11,7 @@ using Android.Runtime; using Android.Views; using MvvmCross.Binding; using MvvmCross.Binding.Attributes; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using MvvmCross.Droid.Support.V7.RecyclerView.ItemTemplates; using MvvmCross.Droid.Support.V7.RecyclerView.Model; using MvvmCross.Exceptions; diff --git a/MvvmCross.Forms/Bindings/MvxBindablePropertyExtensionMethods.cs b/MvvmCross.Forms/Bindings/MvxBindablePropertyExtensions.cs similarity index 97% rename from MvvmCross.Forms/Bindings/MvxBindablePropertyExtensionMethods.cs rename to MvvmCross.Forms/Bindings/MvxBindablePropertyExtensions.cs index 827393361..24206605b 100644 --- a/MvvmCross.Forms/Bindings/MvxBindablePropertyExtensionMethods.cs +++ b/MvvmCross.Forms/Bindings/MvxBindablePropertyExtensions.cs @@ -9,7 +9,7 @@ using Xamarin.Forms; namespace MvvmCross.Forms.Bindings { - public static class MvxBindablePropertyExtensionMethods + public static class MvxBindablePropertyExtensions { public static TypeConverter TypeConverter(this Type type) { @@ -77,4 +77,4 @@ namespace MvvmCross.Forms.Bindings return true; } } -} \ No newline at end of file +} diff --git a/MvvmCross.Forms/Bindings/Target/MvxBindablePropertyTargetBinding.cs b/MvvmCross.Forms/Bindings/Target/MvxBindablePropertyTargetBinding.cs index c89e5a34f..fda712d8c 100644 --- a/MvvmCross.Forms/Bindings/Target/MvxBindablePropertyTargetBinding.cs +++ b/MvvmCross.Forms/Bindings/Target/MvxBindablePropertyTargetBinding.cs @@ -6,7 +6,7 @@ using System; using System.ComponentModel; using MvvmCross.Binding; using MvvmCross.Binding.Bindings.Target; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using MvvmCross.WeakSubscription; using Xamarin.Forms; diff --git a/MvvmCross.Plugins/FieldBinding/MvxLeafFieldSourceBinding.cs b/MvvmCross.Plugins/FieldBinding/MvxLeafFieldSourceBinding.cs index 5ca9b38db..d0e29e3ab 100644 --- a/MvvmCross.Plugins/FieldBinding/MvxLeafFieldSourceBinding.cs +++ b/MvvmCross.Plugins/FieldBinding/MvxLeafFieldSourceBinding.cs @@ -4,7 +4,7 @@ using System; using System.Reflection; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; namespace MvvmCross.Plugin.FieldBinding { diff --git a/MvvmCross.Plugins/FieldBinding/MvxLeafNotifyChangeFieldSourceBinding.cs b/MvvmCross.Plugins/FieldBinding/MvxLeafNotifyChangeFieldSourceBinding.cs index be6687353..391cba78c 100644 --- a/MvvmCross.Plugins/FieldBinding/MvxLeafNotifyChangeFieldSourceBinding.cs +++ b/MvvmCross.Plugins/FieldBinding/MvxLeafNotifyChangeFieldSourceBinding.cs @@ -3,7 +3,7 @@ // See the LICENSE file in the project root for more information. using System; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; namespace MvvmCross.Plugin.FieldBinding { diff --git a/MvvmCross.Plugins/MethodBinding/MvxMethodSourceBindingFactoryExtension.cs b/MvvmCross.Plugins/MethodBinding/MvxMethodSourceBindingFactoryExtension.cs index bebc04655..a856d9f9d 100644 --- a/MvvmCross.Plugins/MethodBinding/MvxMethodSourceBindingFactoryExtension.cs +++ b/MvvmCross.Plugins/MethodBinding/MvxMethodSourceBindingFactoryExtension.cs @@ -57,8 +57,7 @@ namespace MvvmCross.Plugin.MethodBinding protected MethodInfo FindMethodInfo(object source, string name) { - var methodInfo = source.GetType() - .GetMethod(name); + var methodInfo = source.GetType().GetMethod(name); return methodInfo; } } diff --git a/MvvmCross.Plugins/PictureChooser/MvxPictureChooserExtensionMethods.cs b/MvvmCross.Plugins/PictureChooser/MvxPictureChooserExtensions.cs similarity index 94% rename from MvvmCross.Plugins/PictureChooser/MvxPictureChooserExtensionMethods.cs rename to MvvmCross.Plugins/PictureChooser/MvxPictureChooserExtensions.cs index f9d07d41a..af7b1b4cf 100644 --- a/MvvmCross.Plugins/PictureChooser/MvxPictureChooserExtensionMethods.cs +++ b/MvvmCross.Plugins/PictureChooser/MvxPictureChooserExtensions.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace MvvmCross.Plugin.PictureChooser { - public static class MvxPictureChooserExtensionMethods + public static class MvxPictureChooserExtensions { public static Task ChoosePictureFromLibraryAsync(this IMvxPictureChooserTask chooser, int maxPixelDimension, int percentQuality) { diff --git a/MvvmCross/Base/MvxDelegateExtensionMethods.cs b/MvvmCross/Base/MvxDelegateExtensions.cs similarity index 92% rename from MvvmCross/Base/MvxDelegateExtensionMethods.cs rename to MvvmCross/Base/MvxDelegateExtensions.cs index 35c7ca4f1..01374902e 100644 --- a/MvvmCross/Base/MvxDelegateExtensionMethods.cs +++ b/MvvmCross/Base/MvxDelegateExtensions.cs @@ -6,7 +6,7 @@ using System; namespace MvvmCross.Base { - public static class MvxDelegateExtensionMethods + public static class MvxDelegateExtensions { public static void Raise(this EventHandler eventHandler, object sender) { diff --git a/MvvmCross/Base/MvxPropertyNameExtensionMethods.cs b/MvvmCross/Base/MvxPropertyNameExtensions.cs similarity index 97% rename from MvvmCross/Base/MvxPropertyNameExtensionMethods.cs rename to MvvmCross/Base/MvxPropertyNameExtensions.cs index 9e787aa7f..a87eb2564 100644 --- a/MvvmCross/Base/MvxPropertyNameExtensionMethods.cs +++ b/MvvmCross/Base/MvxPropertyNameExtensions.cs @@ -8,7 +8,7 @@ using System.Reflection; namespace MvvmCross.Base { - public static class MvxPropertyNameExtensionMethods + public static class MvxPropertyNameExtensions { private const string WrongExpressionMessage = "Wrong expression\nshould be called with expression like\n() => PropertyName"; diff --git a/MvvmCross/Binding/Bindings/MvxBindingModeExtensionMethods.cs b/MvvmCross/Binding/Bindings/MvxBindingModeExtensions.cs similarity index 95% rename from MvvmCross/Binding/Bindings/MvxBindingModeExtensionMethods.cs rename to MvvmCross/Binding/Bindings/MvxBindingModeExtensions.cs index 56c000198..90c147d69 100644 --- a/MvvmCross/Binding/Bindings/MvxBindingModeExtensionMethods.cs +++ b/MvvmCross/Binding/Bindings/MvxBindingModeExtensions.cs @@ -1,4 +1,4 @@ -// 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. @@ -7,7 +7,7 @@ using MvvmCross.Exceptions; namespace MvvmCross.Binding.Bindings { - public static class MvxBindingModeExtensionMethods + public static class MvxBindingModeExtensions { public static MvxBindingMode IfDefault(this MvxBindingMode bindingMode, MvxBindingMode modeIfDefault) { diff --git a/MvvmCross/Binding/Bindings/Source/Leaf/MvxLeafPropertyInfoSourceBinding.cs b/MvvmCross/Binding/Bindings/Source/Leaf/MvxLeafPropertyInfoSourceBinding.cs index 18088b6d0..736c1fc5f 100644 --- a/MvvmCross/Binding/Bindings/Source/Leaf/MvxLeafPropertyInfoSourceBinding.cs +++ b/MvvmCross/Binding/Bindings/Source/Leaf/MvxLeafPropertyInfoSourceBinding.cs @@ -4,7 +4,7 @@ using System; using System.Reflection; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using MvvmCross.Converters; using MvvmCross.Exceptions; diff --git a/MvvmCross/Binding/Bindings/Target/MvxConvertingTargetBinding.cs b/MvvmCross/Binding/Bindings/Target/MvxConvertingTargetBinding.cs index 031afec1c..f5f75827e 100644 --- a/MvvmCross/Binding/Bindings/Target/MvxConvertingTargetBinding.cs +++ b/MvvmCross/Binding/Bindings/Target/MvxConvertingTargetBinding.cs @@ -3,7 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Collections.Generic; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; namespace MvvmCross.Binding.Bindings.Target { diff --git a/MvvmCross/Binding/Combiners/MvxBooleanValueCombiner.cs b/MvvmCross/Binding/Combiners/MvxBooleanValueCombiner.cs index fbd238d3a..bf9a06a31 100644 --- a/MvvmCross/Binding/Combiners/MvxBooleanValueCombiner.cs +++ b/MvvmCross/Binding/Combiners/MvxBooleanValueCombiner.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Linq; using MvvmCross.Binding.Bindings.SourceSteps; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using MvvmCross.Converters; namespace MvvmCross.Binding.Combiners diff --git a/MvvmCross/Binding/Combiners/MvxIfValueCombiner.cs b/MvvmCross/Binding/Combiners/MvxIfValueCombiner.cs index cb8a355dd..da06107b2 100644 --- a/MvvmCross/Binding/Combiners/MvxIfValueCombiner.cs +++ b/MvvmCross/Binding/Combiners/MvxIfValueCombiner.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Linq; using MvvmCross.Binding.Bindings.SourceSteps; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using MvvmCross.Converters; namespace MvvmCross.Binding.Combiners diff --git a/MvvmCross/Binding/ExtensionMethods/IMvxEditableTextView.cs b/MvvmCross/Binding/Extensions/IMvxEditableTextView.cs similarity index 67% rename from MvvmCross/Binding/ExtensionMethods/IMvxEditableTextView.cs rename to MvvmCross/Binding/Extensions/IMvxEditableTextView.cs index 98cc83074..76f5be5f6 100644 --- a/MvvmCross/Binding/ExtensionMethods/IMvxEditableTextView.cs +++ b/MvvmCross/Binding/Extensions/IMvxEditableTextView.cs @@ -1,11 +1,11 @@ -// 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. -namespace MvvmCross.Binding.ExtensionMethods +namespace MvvmCross.Binding.Extensions { public interface IMvxEditableTextView { string CurrentText { get; } } -} \ No newline at end of file +} diff --git a/MvvmCross/Binding/ExtensionMethods/MvxBindingExtensions.cs b/MvvmCross/Binding/Extensions/MvxBindingExtensions.cs similarity index 95% rename from MvvmCross/Binding/ExtensionMethods/MvxBindingExtensions.cs rename to MvvmCross/Binding/Extensions/MvxBindingExtensions.cs index 5643a6500..2a9d5c318 100644 --- a/MvvmCross/Binding/ExtensionMethods/MvxBindingExtensions.cs +++ b/MvvmCross/Binding/Extensions/MvxBindingExtensions.cs @@ -1,4 +1,4 @@ -// 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. @@ -7,7 +7,7 @@ using System.Globalization; using MvvmCross.Base; using MvvmCross.IoC; -namespace MvvmCross.Binding.ExtensionMethods +namespace MvvmCross.Binding.Extensions { public static class MvxBindingExtensions { @@ -66,4 +66,4 @@ namespace MvvmCross.Binding.ExtensionMethods return propertyType.MakeSafeValueCore(value); } } -} \ No newline at end of file +} diff --git a/MvvmCross/Binding/ExtensionMethods/MvxEnumerableExtensions.cs b/MvvmCross/Binding/Extensions/MvxEnumerableExtensions.cs similarity index 98% rename from MvvmCross/Binding/ExtensionMethods/MvxEnumerableExtensions.cs rename to MvvmCross/Binding/Extensions/MvxEnumerableExtensions.cs index a16f9a290..fda890b5b 100644 --- a/MvvmCross/Binding/ExtensionMethods/MvxEnumerableExtensions.cs +++ b/MvvmCross/Binding/Extensions/MvxEnumerableExtensions.cs @@ -4,7 +4,7 @@ using System.Collections; -namespace MvvmCross.Binding.ExtensionMethods +namespace MvvmCross.Binding.Extensions { public static class MvxEnumerableExtensions { @@ -85,4 +85,4 @@ namespace MvvmCross.Binding.ExtensionMethods return enumerator.Current; } } -} \ No newline at end of file +} diff --git a/MvvmCross/Core/MvxSimplePropertyDictionaryExtensionMethods.cs b/MvvmCross/Core/MvxSimplePropertyDictionaryExtensions.cs similarity index 98% rename from MvvmCross/Core/MvxSimplePropertyDictionaryExtensionMethods.cs rename to MvvmCross/Core/MvxSimplePropertyDictionaryExtensions.cs index 18e9e24ef..b738d60de 100644 --- a/MvvmCross/Core/MvxSimplePropertyDictionaryExtensionMethods.cs +++ b/MvvmCross/Core/MvxSimplePropertyDictionaryExtensions.cs @@ -1,4 +1,4 @@ -// 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. @@ -14,7 +14,7 @@ using MvvmCross.ViewModels; namespace MvvmCross.Core { - public static class MvxSimplePropertyDictionaryExtensionMethods + public static class MvxSimplePropertyDictionaryExtensions { public static IDictionary ToSimpleStringPropertyDictionary( this IDictionary input) @@ -167,4 +167,4 @@ namespace MvvmCross.Core } } } -} \ No newline at end of file +} diff --git a/MvvmCross/Exceptions/MvxExceptionExtensionMethods.cs b/MvvmCross/Exceptions/MvxExceptionExtensions.cs similarity index 96% rename from MvvmCross/Exceptions/MvxExceptionExtensionMethods.cs rename to MvvmCross/Exceptions/MvxExceptionExtensions.cs index 7b67ef62f..b8d164f8a 100644 --- a/MvvmCross/Exceptions/MvxExceptionExtensionMethods.cs +++ b/MvvmCross/Exceptions/MvxExceptionExtensions.cs @@ -6,7 +6,7 @@ using System; namespace MvvmCross.Exceptions { - public static class MvxExceptionExtensionMethods + public static class MvxExceptionExtensions { public static string ToLongString(this Exception exception) { diff --git a/MvvmCross/IoC/MvxConventionAttributeExtensionMethods.cs b/MvvmCross/IoC/MvxConventionAttributeExtensions.cs similarity index 97% rename from MvvmCross/IoC/MvxConventionAttributeExtensionMethods.cs rename to MvvmCross/IoC/MvxConventionAttributeExtensions.cs index c4b53e731..8ddc28e42 100644 --- a/MvvmCross/IoC/MvxConventionAttributeExtensionMethods.cs +++ b/MvvmCross/IoC/MvxConventionAttributeExtensions.cs @@ -8,7 +8,7 @@ using System.Reflection; namespace MvvmCross.IoC { - public static class MvxConventionAttributeExtensionMethods + public static class MvxConventionAttributeExtensions { /// /// A type is conventional if and only it is: diff --git a/MvvmCross/Platform/Android/Base/Platform/MvxDateTimeExtensionMethods.cs b/MvvmCross/Platform/Android/Base/Platform/MvxDateTimeExtensions.cs similarity index 96% rename from MvvmCross/Platform/Android/Base/Platform/MvxDateTimeExtensionMethods.cs rename to MvvmCross/Platform/Android/Base/Platform/MvxDateTimeExtensions.cs index 4c4d94f6a..fa64a5625 100644 --- a/MvvmCross/Platform/Android/Base/Platform/MvxDateTimeExtensionMethods.cs +++ b/MvvmCross/Platform/Android/Base/Platform/MvxDateTimeExtensions.cs @@ -6,7 +6,7 @@ using System; namespace MvvmCross.Platform.Android.Base.Platform { - public static class MvxDateTimeExtensionMethods + public static class MvxDateTimeExtensions { private static readonly DateTime UnixZeroUtc = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); diff --git a/MvvmCross/Platform/Android/Base/WeakSubscription/MvxAndroidWeakSubscriptionExtensionMethods.cs b/MvvmCross/Platform/Android/Base/WeakSubscription/MvxAndroidWeakSubscriptionExtensions.cs similarity index 93% rename from MvvmCross/Platform/Android/Base/WeakSubscription/MvxAndroidWeakSubscriptionExtensionMethods.cs rename to MvvmCross/Platform/Android/Base/WeakSubscription/MvxAndroidWeakSubscriptionExtensions.cs index 421d2be82..30ac15367 100644 --- a/MvvmCross/Platform/Android/Base/WeakSubscription/MvxAndroidWeakSubscriptionExtensionMethods.cs +++ b/MvvmCross/Platform/Android/Base/WeakSubscription/MvxAndroidWeakSubscriptionExtensions.cs @@ -6,7 +6,7 @@ using System; namespace MvvmCross.Platform.Android.Base.WeakSubscription { - public static class MvxAndroidWeakSubscriptionExtensionMethods + public static class MvxAndroidWeakSubscriptionExtensions { public static MvxJavaEventSubscription WeakSubscribe(this TSource source, string eventName, EventHandler eventHandler) where TSource : class diff --git a/MvvmCross/Platform/Android/Binding/Target/MvxTextViewTextFormattedTargetBinding.cs b/MvvmCross/Platform/Android/Binding/Target/MvxTextViewTextFormattedTargetBinding.cs index a802e5690..311babdc6 100644 --- a/MvvmCross/Platform/Android/Binding/Target/MvxTextViewTextFormattedTargetBinding.cs +++ b/MvvmCross/Platform/Android/Binding/Target/MvxTextViewTextFormattedTargetBinding.cs @@ -6,7 +6,7 @@ using System; using Android.Text; using Android.Widget; using MvvmCross.Binding; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using MvvmCross.Platform.Android.Base.WeakSubscription; namespace MvvmCross.Platform.Android.Binding.Target diff --git a/MvvmCross/Platform/Android/Binding/Target/MvxTextViewTextTargetBinding.cs b/MvvmCross/Platform/Android/Binding/Target/MvxTextViewTextTargetBinding.cs index 1fc6ecc45..b16b3cb0b 100644 --- a/MvvmCross/Platform/Android/Binding/Target/MvxTextViewTextTargetBinding.cs +++ b/MvvmCross/Platform/Android/Binding/Target/MvxTextViewTextTargetBinding.cs @@ -6,7 +6,7 @@ using System; using Android.Text; using Android.Widget; using MvvmCross.Binding; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using MvvmCross.Platform.Android.Base.WeakSubscription; namespace MvvmCross.Platform.Android.Binding.Target diff --git a/MvvmCross/Platform/Android/Binding/Target/MvxViewHiddenBinding.cs b/MvvmCross/Platform/Android/Binding/Target/MvxViewHiddenBinding.cs index 7292b7f1d..4e067f19c 100644 --- a/MvvmCross/Platform/Android/Binding/Target/MvxViewHiddenBinding.cs +++ b/MvvmCross/Platform/Android/Binding/Target/MvxViewHiddenBinding.cs @@ -3,7 +3,7 @@ // See the LICENSE file in the project root for more information. using Android.Views; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; namespace MvvmCross.Platform.Android.Binding.Target { diff --git a/MvvmCross/Platform/Android/Binding/Target/MvxViewVisibleBinding.cs b/MvvmCross/Platform/Android/Binding/Target/MvxViewVisibleBinding.cs index 85bccf3c6..831337098 100644 --- a/MvvmCross/Platform/Android/Binding/Target/MvxViewVisibleBinding.cs +++ b/MvvmCross/Platform/Android/Binding/Target/MvxViewVisibleBinding.cs @@ -3,7 +3,7 @@ // See the LICENSE file in the project root for more information. using Android.Views; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; namespace MvvmCross.Platform.Android.Binding.Target { diff --git a/MvvmCross/Platform/Android/Binding/Views/MvxAdapter.cs b/MvvmCross/Platform/Android/Binding/Views/MvxAdapter.cs index 2a624eeab..aaf13125a 100644 --- a/MvvmCross/Platform/Android/Binding/Views/MvxAdapter.cs +++ b/MvvmCross/Platform/Android/Binding/Views/MvxAdapter.cs @@ -15,7 +15,7 @@ using MvvmCross.Exceptions; using MvvmCross.Logging; using MvvmCross.Binding; using MvvmCross.Binding.Attributes; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using MvvmCross.Platform.Android.Binding.BindingContext; using MvvmCross.WeakSubscription; using Object = Java.Lang.Object; diff --git a/MvvmCross/Platform/Android/Binding/Views/MvxExpandableListAdapter.cs b/MvvmCross/Platform/Android/Binding/Views/MvxExpandableListAdapter.cs index d893f755a..659ba13e6 100644 --- a/MvvmCross/Platform/Android/Binding/Views/MvxExpandableListAdapter.cs +++ b/MvvmCross/Platform/Android/Binding/Views/MvxExpandableListAdapter.cs @@ -8,7 +8,7 @@ using Android.Content; using Android.Runtime; using Android.Views; using Android.Widget; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using MvvmCross.Platform.Android.Binding.BindingContext; using Object = Java.Lang.Object; diff --git a/MvvmCross/Platform/Android/Views/Fragments/MvxFragmentExtensions.cs b/MvvmCross/Platform/Android/Views/Fragments/MvxFragmentExtensions.cs index 040320801..ac138098a 100644 --- a/MvvmCross/Platform/Android/Views/Fragments/MvxFragmentExtensions.cs +++ b/MvvmCross/Platform/Android/Views/Fragments/MvxFragmentExtensions.cs @@ -5,6 +5,7 @@ using Android.App; using Android.Views; using MvvmCross.Exceptions; +using MvvmCross.Logging; using MvvmCross.Platform.Android.Binding.BindingContext; using MvvmCross.Platform.Android.Core; using MvvmCross.ViewModels; @@ -102,5 +103,52 @@ namespace MvvmCross.Platform.Android.Views.Fragments var setupSingleton = MvxAndroidSetupSingleton.EnsureSingletonAvailable(fragment.Activity.ApplicationContext); setupSingleton.EnsureInitialized(); } + + public static TFragment FindFragmentById(this MvxActivity activity, int resourceId) + where TFragment : Fragment + { + var fragment = activity.FragmentManager.FindFragmentById(resourceId); + if (fragment == null) { + MvxLog.Instance.Warn("Failed to find fragment id {0} in {1}", resourceId, activity.GetType().Name); + return default(TFragment); + } + + return SafeCast(fragment); + } + + public static TFragment FindFragmentByTag(this MvxActivity activity, string tag) + where TFragment : Fragment + { + var fragment = activity.FragmentManager.FindFragmentByTag(tag); + if (fragment == null) { + MvxLog.Instance.Warn("Failed to find fragment tag {0} in {1}", tag, activity.GetType().Name); + return default(TFragment); + } + + return SafeCast(fragment); + } + + private static TFragment SafeCast(Fragment fragment) where TFragment : Fragment + { + if (!(fragment is TFragment)) { + MvxLog.Instance.Warn("Fragment type mismatch got {0} but expected {1}", fragment.GetType().FullName, + typeof(TFragment).FullName); + return default(TFragment); + } + + return (TFragment)fragment; + } + + public static void LoadViewModelFrom(this Android.Views.IMvxFragmentView view, MvxViewModelRequest request, IMvxBundle savedState = null) + { + var loader = Mvx.Resolve(); + var viewModel = loader.LoadViewModel(request, savedState); + if (viewModel == null) { + MvxLog.Instance.Warn("ViewModel not loaded for {0}", request.ViewModelType.FullName); + return; + } + + view.ViewModel = viewModel; + } } } diff --git a/MvvmCross/Platform/Android/Views/Fragments/MvxFragmentViewExtensionMethods.cs b/MvvmCross/Platform/Android/Views/Fragments/MvxFragmentViewExtensionMethods.cs deleted file mode 100644 index ae579c5ac..000000000 --- a/MvvmCross/Platform/Android/Views/Fragments/MvxFragmentViewExtensionMethods.cs +++ /dev/null @@ -1,64 +0,0 @@ -// 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 Android.App; -using MvvmCross.Logging; -using MvvmCross.ViewModels; - -namespace MvvmCross.Platform.Android.Views.Fragments -{ - public static class MvxFragmentExtensionMethods - { - public static TFragment FindFragmentById(this MvxActivity activity, int resourceId) - where TFragment : Fragment - { - var fragment = activity.FragmentManager.FindFragmentById(resourceId); - if (fragment == null) - { - MvxLog.Instance.Warn("Failed to find fragment id {0} in {1}", resourceId, activity.GetType().Name); - return default(TFragment); - } - - return SafeCast(fragment); - } - - public static TFragment FindFragmentByTag(this MvxActivity activity, string tag) - where TFragment : Fragment - { - var fragment = activity.FragmentManager.FindFragmentByTag(tag); - if (fragment == null) - { - MvxLog.Instance.Warn("Failed to find fragment tag {0} in {1}", tag, activity.GetType().Name); - return default(TFragment); - } - - return SafeCast(fragment); - } - - private static TFragment SafeCast(Fragment fragment) where TFragment : Fragment - { - if (!(fragment is TFragment)) - { - MvxLog.Instance.Warn("Fragment type mismatch got {0} but expected {1}", fragment.GetType().FullName, - typeof(TFragment).FullName); - return default(TFragment); - } - - return (TFragment)fragment; - } - - public static void LoadViewModelFrom(this Android.Views.IMvxFragmentView view, MvxViewModelRequest request, IMvxBundle savedState = null) - { - var loader = Mvx.Resolve(); - var viewModel = loader.LoadViewModel(request, savedState); - if (viewModel == null) - { - MvxLog.Instance.Warn("ViewModel not loaded for {0}", request.ViewModelType.FullName); - return; - } - - view.ViewModel = viewModel; - } - } -} diff --git a/MvvmCross/Platform/iOS/Base/MvxIosColorExtensionMethods.cs b/MvvmCross/Platform/Ios/Base/MvxIosColorExtensions.cs similarity index 96% rename from MvvmCross/Platform/iOS/Base/MvxIosColorExtensionMethods.cs rename to MvvmCross/Platform/Ios/Base/MvxIosColorExtensions.cs index bdb3e6f3b..11605c7a9 100644 --- a/MvvmCross/Platform/iOS/Base/MvxIosColorExtensionMethods.cs +++ b/MvvmCross/Platform/Ios/Base/MvxIosColorExtensions.cs @@ -7,7 +7,7 @@ using UIKit; namespace MvvmCross.Platform.Ios.Base { - public static class MvxIosColorExtensionMethods + public static class MvxIosColorExtensions { public static UIColor ColorFromInt(this uint rgbValue) { diff --git a/MvvmCross/Platform/iOS/Base/MvxIosDateTimeExtensionMethods.cs b/MvvmCross/Platform/Ios/Base/MvxIosDateTimeExtensions.cs similarity index 94% rename from MvvmCross/Platform/iOS/Base/MvxIosDateTimeExtensionMethods.cs rename to MvvmCross/Platform/Ios/Base/MvxIosDateTimeExtensions.cs index e7f0dd232..83638b3df 100644 --- a/MvvmCross/Platform/iOS/Base/MvxIosDateTimeExtensionMethods.cs +++ b/MvvmCross/Platform/Ios/Base/MvxIosDateTimeExtensions.cs @@ -7,7 +7,7 @@ using Foundation; namespace MvvmCross.Platform.Ios.Base { - public static class MvxIosDateTimeExtensionMethods + public static class MvxIosDateTimeExtensions { private static readonly DateTime ReferenceNSDateTime = new DateTime(2001, 1, 1, 0, 0, 0, DateTimeKind.Utc); diff --git a/MvvmCross/Platform/iOS/Views/MvxCanCreateIosViewExtensionMethods.cs b/MvvmCross/Platform/Ios/Views/MvxCanCreateIosViewExtensions.cs similarity index 97% rename from MvvmCross/Platform/iOS/Views/MvxCanCreateIosViewExtensionMethods.cs rename to MvvmCross/Platform/Ios/Views/MvxCanCreateIosViewExtensions.cs index d8e40a583..27344e331 100644 --- a/MvvmCross/Platform/iOS/Views/MvxCanCreateIosViewExtensionMethods.cs +++ b/MvvmCross/Platform/Ios/Views/MvxCanCreateIosViewExtensions.cs @@ -9,7 +9,7 @@ using MvvmCross.ViewModels; namespace MvvmCross.Platform.Ios.Views { - public static class MvxCanCreateIosViewExtensionMethods + public static class MvxCanCreateIosViewExtensions { public static IMvxIosView CreateViewControllerFor(this IMvxCanCreateIosView view, object parameterObject) diff --git a/MvvmCross/Platform/iOS/Views/MvxSegueExtensionMethods.cs b/MvvmCross/Platform/Ios/Views/MvxSegueExtensions.cs similarity index 98% rename from MvvmCross/Platform/iOS/Views/MvxSegueExtensionMethods.cs rename to MvvmCross/Platform/Ios/Views/MvxSegueExtensions.cs index d1d966a9a..15935d07c 100644 --- a/MvvmCross/Platform/iOS/Views/MvxSegueExtensionMethods.cs +++ b/MvvmCross/Platform/Ios/Views/MvxSegueExtensions.cs @@ -15,7 +15,7 @@ using UIKit; namespace MvvmCross.Platform.Ios.Views { - internal static class MvxSegueExtensionMethods + internal static class MvxSegueExtensions { internal static Type GetViewModelType(this IMvxView view) { diff --git a/MvvmCross/Platform/iOS/Views/MvxViewControllerExtensionMethods.cs b/MvvmCross/Platform/Ios/Views/MvxViewControllerExtensions.cs similarity index 96% rename from MvvmCross/Platform/iOS/Views/MvxViewControllerExtensionMethods.cs rename to MvvmCross/Platform/Ios/Views/MvxViewControllerExtensions.cs index eda2cc86e..28c958d5b 100644 --- a/MvvmCross/Platform/iOS/Views/MvxViewControllerExtensionMethods.cs +++ b/MvvmCross/Platform/Ios/Views/MvxViewControllerExtensions.cs @@ -9,7 +9,7 @@ using MvvmCross.Views; namespace MvvmCross.Platform.Ios.Views { - public static class MvxViewControllerExtensionMethods + public static class MvxViewControllerExtensions { public static void OnViewCreate(this IMvxIosView iosView) { diff --git a/MvvmCross/Platform/iOS/Views/UIViewControllerExtensionMethods.cs b/MvvmCross/Platform/Ios/Views/UIViewControllerExtensions.cs similarity index 92% rename from MvvmCross/Platform/iOS/Views/UIViewControllerExtensionMethods.cs rename to MvvmCross/Platform/Ios/Views/UIViewControllerExtensions.cs index 890a48574..46c1155de 100644 --- a/MvvmCross/Platform/iOS/Views/UIViewControllerExtensionMethods.cs +++ b/MvvmCross/Platform/Ios/Views/UIViewControllerExtensions.cs @@ -7,7 +7,7 @@ using UIKit; namespace MvvmCross.Platform.Ios.Views { - public static class UIViewControllerExtensionMethods + public static class UIViewControllerExtensions { public static IMvxIosView GetIMvxIosView(this UIViewController viewController) { diff --git a/MvvmCross/Platform/iOS/Views/Extensions.cs b/MvvmCross/Platform/Ios/Views/ViewExtensions.cs similarity index 100% rename from MvvmCross/Platform/iOS/Views/Extensions.cs rename to MvvmCross/Platform/Ios/Views/ViewExtensions.cs diff --git a/MvvmCross/Platform/Mac/Binding/Views/MvxTableViewSource.cs b/MvvmCross/Platform/Mac/Binding/Views/MvxTableViewSource.cs index f8818ec52..f17e07067 100644 --- a/MvvmCross/Platform/Mac/Binding/Views/MvxTableViewSource.cs +++ b/MvvmCross/Platform/Mac/Binding/Views/MvxTableViewSource.cs @@ -12,7 +12,7 @@ using Foundation; using MvvmCross.Base; using MvvmCross.Binding.Attributes; using MvvmCross.Binding.BindingContext; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using MvvmCross.WeakSubscription; namespace MvvmCross.Platform.Mac.Binding.Views diff --git a/MvvmCross/Platform/Mac/ExtensionMethods/MvxMacDateTimeExtensionMethods.cs b/MvvmCross/Platform/Mac/ExtensionMethods/MvxMacDateTimeExtensions.cs similarity index 93% rename from MvvmCross/Platform/Mac/ExtensionMethods/MvxMacDateTimeExtensionMethods.cs rename to MvvmCross/Platform/Mac/ExtensionMethods/MvxMacDateTimeExtensions.cs index f2f9f4dac..176602118 100644 --- a/MvvmCross/Platform/Mac/ExtensionMethods/MvxMacDateTimeExtensionMethods.cs +++ b/MvvmCross/Platform/Mac/ExtensionMethods/MvxMacDateTimeExtensions.cs @@ -7,7 +7,7 @@ using Foundation; namespace MvvmCross.Platform.Mac.ExtensionMethods { - public static class MvxMacDateTimeExtensionMethods + public static class MvxMacDateTimeExtensions { private static readonly DateTime ReferenceNSDateTime = new DateTime(2001, 1, 1, 0, 0, 0, DateTimeKind.Utc); diff --git a/MvvmCross/Platform/Mac/Views/MvxSegueExtensionMethods.cs b/MvvmCross/Platform/Mac/Views/MvxSegueExtensions.cs similarity index 98% rename from MvvmCross/Platform/Mac/Views/MvxSegueExtensionMethods.cs rename to MvvmCross/Platform/Mac/Views/MvxSegueExtensions.cs index a60eacab4..fef27e69d 100644 --- a/MvvmCross/Platform/Mac/Views/MvxSegueExtensionMethods.cs +++ b/MvvmCross/Platform/Mac/Views/MvxSegueExtensions.cs @@ -15,7 +15,7 @@ using MvvmCross.Views; namespace MvvmCross.Platform.Mac.Views { - internal static class MvxSegueExtensionMethods + internal static class MvxSegueExtensions { internal static Type GetViewModelType(this IMvxView view) { diff --git a/MvvmCross/Platform/Mac/Views/MvxViewControllerExtensionMethods.cs b/MvvmCross/Platform/Mac/Views/MvxViewControllerExtensions.cs similarity index 98% rename from MvvmCross/Platform/Mac/Views/MvxViewControllerExtensionMethods.cs rename to MvvmCross/Platform/Mac/Views/MvxViewControllerExtensions.cs index 464b1ac51..9a9ee17b3 100644 --- a/MvvmCross/Platform/Mac/Views/MvxViewControllerExtensionMethods.cs +++ b/MvvmCross/Platform/Mac/Views/MvxViewControllerExtensions.cs @@ -12,7 +12,7 @@ using MvvmCross.Views; namespace MvvmCross.Platform.Mac.Views { - public static class MvxViewControllerExtensionMethods + public static class MvxViewControllerExtensions { public static void OnViewCreate(this IMvxMacView macView) { diff --git a/MvvmCross/Platform/Tvos/Base/MvxTvosColorExtensionMethods.cs b/MvvmCross/Platform/Tvos/Base/MvxTvosColorExtensions.cs similarity index 96% rename from MvvmCross/Platform/Tvos/Base/MvxTvosColorExtensionMethods.cs rename to MvvmCross/Platform/Tvos/Base/MvxTvosColorExtensions.cs index fdcc4e459..9a081eccf 100644 --- a/MvvmCross/Platform/Tvos/Base/MvxTvosColorExtensionMethods.cs +++ b/MvvmCross/Platform/Tvos/Base/MvxTvosColorExtensions.cs @@ -7,7 +7,7 @@ using UIKit; namespace MvvmCross.Platform.Tvos.Base { - public static class MvxTvosColorExtensionMethods + public static class MvxTvosColorExtensions { public static UIColor ColorFromInt(this uint rgbValue) { diff --git a/MvvmCross/Platform/Tvos/Base/MvxTvosDateTimeExtensionMethods.cs b/MvvmCross/Platform/Tvos/Base/MvxTvosDateTimeExtensions.cs similarity index 93% rename from MvvmCross/Platform/Tvos/Base/MvxTvosDateTimeExtensionMethods.cs rename to MvvmCross/Platform/Tvos/Base/MvxTvosDateTimeExtensions.cs index 64b9a4d7e..c8b77ee9c 100644 --- a/MvvmCross/Platform/Tvos/Base/MvxTvosDateTimeExtensionMethods.cs +++ b/MvvmCross/Platform/Tvos/Base/MvxTvosDateTimeExtensions.cs @@ -7,7 +7,7 @@ using Foundation; namespace MvvmCross.Platform.Tvos.Base { - public static class MvxTvosDateTimeExtensionMethods + public static class MvxTvosDateTimeExtensions { private static readonly DateTime ReferenceNSDateTime = new DateTime(2001, 1, 1, 0, 0, 0, DateTimeKind.Utc); diff --git a/MvvmCross/Platform/Tvos/Binding/Target/MvxUITextFieldTextTargetBinding.cs b/MvvmCross/Platform/Tvos/Binding/Target/MvxUITextFieldTextTargetBinding.cs index fc1c8a7bc..3dde379ca 100644 --- a/MvvmCross/Platform/Tvos/Binding/Target/MvxUITextFieldTextTargetBinding.cs +++ b/MvvmCross/Platform/Tvos/Binding/Target/MvxUITextFieldTextTargetBinding.cs @@ -5,7 +5,7 @@ using System; using MvvmCross.Binding; using MvvmCross.Binding.Bindings.Target; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using UIKit; namespace MvvmCross.Platform.Tvos.Binding.Target diff --git a/MvvmCross/Platform/Tvos/Binding/Target/MvxUIViewHiddenTargetBinding.cs b/MvvmCross/Platform/Tvos/Binding/Target/MvxUIViewHiddenTargetBinding.cs index 1870818fe..775ba5ccd 100644 --- a/MvvmCross/Platform/Tvos/Binding/Target/MvxUIViewHiddenTargetBinding.cs +++ b/MvvmCross/Platform/Tvos/Binding/Target/MvxUIViewHiddenTargetBinding.cs @@ -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.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using UIKit; namespace MvvmCross.Platform.Tvos.Binding.Target diff --git a/MvvmCross/Platform/Tvos/Binding/Target/MvxUIViewVisibleTargetBinding.cs b/MvvmCross/Platform/Tvos/Binding/Target/MvxUIViewVisibleTargetBinding.cs index 2f35a5a87..0f0d7313a 100644 --- a/MvvmCross/Platform/Tvos/Binding/Target/MvxUIViewVisibleTargetBinding.cs +++ b/MvvmCross/Platform/Tvos/Binding/Target/MvxUIViewVisibleTargetBinding.cs @@ -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.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using UIKit; namespace MvvmCross.Platform.Tvos.Binding.Target diff --git a/MvvmCross/Platform/Tvos/Binding/Views/MvxCollectionViewSource.cs b/MvvmCross/Platform/Tvos/Binding/Views/MvxCollectionViewSource.cs index 96a23f446..88b17bcd2 100644 --- a/MvvmCross/Platform/Tvos/Binding/Views/MvxCollectionViewSource.cs +++ b/MvvmCross/Platform/Tvos/Binding/Views/MvxCollectionViewSource.cs @@ -8,7 +8,7 @@ using System.Collections.Specialized; using System.Threading.Tasks; using Foundation; using MvvmCross.Binding.Attributes; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using MvvmCross.WeakSubscription; using UIKit; diff --git a/MvvmCross/Platform/Tvos/Binding/Views/MvxCollectionViewSourceAnimated.cs b/MvvmCross/Platform/Tvos/Binding/Views/MvxCollectionViewSourceAnimated.cs index 10aab8259..7db0fca56 100644 --- a/MvvmCross/Platform/Tvos/Binding/Views/MvxCollectionViewSourceAnimated.cs +++ b/MvvmCross/Platform/Tvos/Binding/Views/MvxCollectionViewSourceAnimated.cs @@ -10,7 +10,7 @@ using System.Linq; using System.Threading.Tasks; using Foundation; using MvvmCross.Logging; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using UIKit; namespace MvvmCross.Platform.Tvos.Binding.Views diff --git a/MvvmCross/Platform/Tvos/Binding/Views/MvxTableViewSource.cs b/MvvmCross/Platform/Tvos/Binding/Views/MvxTableViewSource.cs index 31224c8db..d6824667a 100644 --- a/MvvmCross/Platform/Tvos/Binding/Views/MvxTableViewSource.cs +++ b/MvvmCross/Platform/Tvos/Binding/Views/MvxTableViewSource.cs @@ -8,7 +8,7 @@ using System.Collections.Specialized; using Foundation; using MvvmCross.Logging; using MvvmCross.Binding.Attributes; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using MvvmCross.WeakSubscription; using UIKit; diff --git a/MvvmCross/Platform/Tvos/Views/MvxCanCreateTvosViewExtensionMethods.cs b/MvvmCross/Platform/Tvos/Views/MvxCanCreateTvosViewExtensions.cs similarity index 97% rename from MvvmCross/Platform/Tvos/Views/MvxCanCreateTvosViewExtensionMethods.cs rename to MvvmCross/Platform/Tvos/Views/MvxCanCreateTvosViewExtensions.cs index 73ddc64b9..2eefcff97 100644 --- a/MvvmCross/Platform/Tvos/Views/MvxCanCreateTvosViewExtensionMethods.cs +++ b/MvvmCross/Platform/Tvos/Views/MvxCanCreateTvosViewExtensions.cs @@ -9,7 +9,7 @@ using MvvmCross.ViewModels; namespace MvvmCross.Platform.Tvos.Views { - public static class MvxCanCreateTvosViewExtensionMethods + public static class MvxCanCreateTvosViewExtensions { public static IMvxTvosView CreateViewControllerFor(this IMvxCanCreateTvosView view, object parameterObject) diff --git a/MvvmCross/Platform/Tvos/Views/MvxSegueExtensionMethods.cs b/MvvmCross/Platform/Tvos/Views/MvxSegueExtensions.cs similarity index 98% rename from MvvmCross/Platform/Tvos/Views/MvxSegueExtensionMethods.cs rename to MvvmCross/Platform/Tvos/Views/MvxSegueExtensions.cs index 601dad334..dc799e2e2 100644 --- a/MvvmCross/Platform/Tvos/Views/MvxSegueExtensionMethods.cs +++ b/MvvmCross/Platform/Tvos/Views/MvxSegueExtensions.cs @@ -15,7 +15,7 @@ using MvvmCross.Views; namespace MvvmCross.Platform.Tvos.Views { - internal static class MvxSegueExtensionMethods + internal static class MvxSegueExtensions { internal static Type GetViewModelType(this IMvxView view) { diff --git a/MvvmCross/Platform/Tvos/Views/MvxViewControllerExtensionMethods.cs b/MvvmCross/Platform/Tvos/Views/MvxViewControllerExtensions.cs similarity index 96% rename from MvvmCross/Platform/Tvos/Views/MvxViewControllerExtensionMethods.cs rename to MvvmCross/Platform/Tvos/Views/MvxViewControllerExtensions.cs index dae898f28..cf1804d90 100644 --- a/MvvmCross/Platform/Tvos/Views/MvxViewControllerExtensionMethods.cs +++ b/MvvmCross/Platform/Tvos/Views/MvxViewControllerExtensions.cs @@ -9,7 +9,7 @@ using MvvmCross.Views; namespace MvvmCross.Platform.Tvos.Views { - public static class MvxViewControllerExtensionMethods + public static class MvxViewControllerExtensions { public static void OnViewCreate(this IMvxTvosView tvOSView) { diff --git a/MvvmCross/Platform/Tvos/Views/UIViewControllerExtensionMethods.cs b/MvvmCross/Platform/Tvos/Views/UIViewControllerExtensions.cs similarity index 92% rename from MvvmCross/Platform/Tvos/Views/UIViewControllerExtensionMethods.cs rename to MvvmCross/Platform/Tvos/Views/UIViewControllerExtensions.cs index ee188fe0c..d5db69ec6 100644 --- a/MvvmCross/Platform/Tvos/Views/UIViewControllerExtensionMethods.cs +++ b/MvvmCross/Platform/Tvos/Views/UIViewControllerExtensions.cs @@ -7,7 +7,7 @@ using UIKit; namespace MvvmCross.Platform.Tvos.Views { - public static class UIViewControllerExtensionMethods + public static class UIViewControllerExtensions { public static IMvxTvosView GetIMvxTvosView(this UIViewController viewController) { diff --git a/MvvmCross/Platform/Uap/Base/Platform/MvxPseudoAsyncExtensionMethods.cs b/MvvmCross/Platform/Uap/Base/Platform/MvxPseudoAsyncExtensions.cs similarity index 95% rename from MvvmCross/Platform/Uap/Base/Platform/MvxPseudoAsyncExtensionMethods.cs rename to MvvmCross/Platform/Uap/Base/Platform/MvxPseudoAsyncExtensions.cs index 00281ad41..09423a41d 100644 --- a/MvvmCross/Platform/Uap/Base/Platform/MvxPseudoAsyncExtensionMethods.cs +++ b/MvvmCross/Platform/Uap/Base/Platform/MvxPseudoAsyncExtensions.cs @@ -7,7 +7,7 @@ using Windows.Foundation; namespace MvvmCross.Platform.Uap.Base.Platform { - public static class MvxPseudoAsyncExtensionMethods + public static class MvxPseudoAsyncExtensions { public static void Await(this IAsyncAction operation) { diff --git a/MvvmCross/Platform/Uap/Binding/MvxBinding/Target/MvxDependencyPropertyTargetBinding.cs b/MvvmCross/Platform/Uap/Binding/MvxBinding/Target/MvxDependencyPropertyTargetBinding.cs index 3655dd84d..a1ca46d09 100644 --- a/MvvmCross/Platform/Uap/Binding/MvxBinding/Target/MvxDependencyPropertyTargetBinding.cs +++ b/MvvmCross/Platform/Uap/Binding/MvxBinding/Target/MvxDependencyPropertyTargetBinding.cs @@ -7,7 +7,7 @@ using Windows.UI.Xaml; using Windows.UI.Xaml.Media; using MvvmCross.Binding; using MvvmCross.Binding.Bindings.Target; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; namespace MvvmCross.Platform.Uap.Binding.MvxBinding.Target { diff --git a/MvvmCross/Platform/Uap/Binding/MvxDependencyPropertyExtensionMethods.cs b/MvvmCross/Platform/Uap/Binding/MvxDependencyPropertyExtensions.cs similarity index 97% rename from MvvmCross/Platform/Uap/Binding/MvxDependencyPropertyExtensionMethods.cs rename to MvvmCross/Platform/Uap/Binding/MvxDependencyPropertyExtensions.cs index 8e1aa631e..444f25f09 100644 --- a/MvvmCross/Platform/Uap/Binding/MvxDependencyPropertyExtensionMethods.cs +++ b/MvvmCross/Platform/Uap/Binding/MvxDependencyPropertyExtensions.cs @@ -8,7 +8,7 @@ using Windows.UI.Xaml; namespace MvvmCross.Platform.Uap.Binding { - public static class MvxDependencyPropertyExtensionMethods + public static class MvxDependencyPropertyExtensions { public static PropertyInfo FindActualProperty(this Type type, string name) { diff --git a/MvvmCross/Platform/Uap/Views/MvxWindowsExtensionMethods.cs b/MvvmCross/Platform/Uap/Views/MvxWindowsExtensions.cs similarity index 98% rename from MvvmCross/Platform/Uap/Views/MvxWindowsExtensionMethods.cs rename to MvvmCross/Platform/Uap/Views/MvxWindowsExtensions.cs index 0756b5fe2..0beea150e 100644 --- a/MvvmCross/Platform/Uap/Views/MvxWindowsExtensionMethods.cs +++ b/MvvmCross/Platform/Uap/Views/MvxWindowsExtensions.cs @@ -11,7 +11,7 @@ using MvvmCross.ViewModels; namespace MvvmCross.Platform.Uap.Views { - public static class MvxWindowsExtensionMethods + public static class MvxWindowsExtensions { public static void OnViewCreate(this IMvxWindowsView storeView, string requestText, Func bundleLoader) { diff --git a/MvvmCross/Platform/Wpf/Binding/MvxBinding/Target/MvxDependencyPropertyTargetBinding.cs b/MvvmCross/Platform/Wpf/Binding/MvxBinding/Target/MvxDependencyPropertyTargetBinding.cs index e65ba53ec..f74cd3da1 100644 --- a/MvvmCross/Platform/Wpf/Binding/MvxBinding/Target/MvxDependencyPropertyTargetBinding.cs +++ b/MvvmCross/Platform/Wpf/Binding/MvxBinding/Target/MvxDependencyPropertyTargetBinding.cs @@ -8,7 +8,7 @@ using System.Windows; using System.Windows.Media; using MvvmCross.Binding; using MvvmCross.Binding.Bindings.Target; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; namespace MvvmCross.Platform.Wpf.Binding.MvxBinding.Target { diff --git a/MvvmCross/Platform/Wpf/Binding/MvxDependencyPropertyExtensionMethods.cs b/MvvmCross/Platform/Wpf/Binding/MvxDependencyPropertyExtensions.cs similarity index 97% rename from MvvmCross/Platform/Wpf/Binding/MvxDependencyPropertyExtensionMethods.cs rename to MvvmCross/Platform/Wpf/Binding/MvxDependencyPropertyExtensions.cs index a72319ba5..a1abfb3c1 100644 --- a/MvvmCross/Platform/Wpf/Binding/MvxDependencyPropertyExtensionMethods.cs +++ b/MvvmCross/Platform/Wpf/Binding/MvxDependencyPropertyExtensions.cs @@ -10,7 +10,7 @@ using System.Windows; namespace MvvmCross.Platform.Wpf.Binding { - public static class MvxDependencyPropertyExtensionMethods + public static class MvxDependencyPropertyExtensions { public static TypeConverter TypeConverter(this Type type) { diff --git a/MvvmCross/Platform/iOS/Base/MvxIosUIViewControllerExtensions.cs b/MvvmCross/Platform/iOS/Base/MvxIosUIViewControllerExtensions.cs deleted file mode 100644 index 0796ad967..000000000 --- a/MvvmCross/Platform/iOS/Base/MvxIosUIViewControllerExtensions.cs +++ /dev/null @@ -1,30 +0,0 @@ -// 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 UIKit; - -namespace MvvmCross.Platform.Ios.Base -{ - public static class MvxIosUIViewControllerExtensions - { - public static bool IsVisible(this UIViewController controller) - { - // based from answer to http://stackoverflow.com/questions/2777438/how-to-tell-if-uiviewcontrollers-view-is-visible - // would ideally prefer to use ViewWillAppear in the controller code - but UINavigationController doesn't pass on - // these messages correctly - if (!controller.IsViewLoaded) - return false; - - var uiNavigationParent = controller.ParentViewController as UINavigationController; - if (uiNavigationParent == null) - { - return controller.View.Window != null; - } - else - { - return Equals(uiNavigationParent.VisibleViewController, controller); - } - } - } -} diff --git a/MvvmCross/Platform/iOS/Binding/Target/MvxUITextFieldTextTargetBinding.cs b/MvvmCross/Platform/iOS/Binding/Target/MvxUITextFieldTextTargetBinding.cs index 5a3edc636..ad958b040 100644 --- a/MvvmCross/Platform/iOS/Binding/Target/MvxUITextFieldTextTargetBinding.cs +++ b/MvvmCross/Platform/iOS/Binding/Target/MvxUITextFieldTextTargetBinding.cs @@ -5,7 +5,7 @@ using System; using MvvmCross.Binding; using MvvmCross.Binding.Bindings.Target; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using MvvmCross.WeakSubscription; using UIKit; diff --git a/MvvmCross/Platform/iOS/Binding/Target/MvxUIViewHiddenTargetBinding.cs b/MvvmCross/Platform/iOS/Binding/Target/MvxUIViewHiddenTargetBinding.cs index 369d1e690..7d01c3da8 100644 --- a/MvvmCross/Platform/iOS/Binding/Target/MvxUIViewHiddenTargetBinding.cs +++ b/MvvmCross/Platform/iOS/Binding/Target/MvxUIViewHiddenTargetBinding.cs @@ -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.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using UIKit; namespace MvvmCross.Platform.Ios.Binding.Target diff --git a/MvvmCross/Platform/iOS/Binding/Target/MvxUIViewVisibleTargetBinding.cs b/MvvmCross/Platform/iOS/Binding/Target/MvxUIViewVisibleTargetBinding.cs index 52587549b..de6144d34 100644 --- a/MvvmCross/Platform/iOS/Binding/Target/MvxUIViewVisibleTargetBinding.cs +++ b/MvvmCross/Platform/iOS/Binding/Target/MvxUIViewVisibleTargetBinding.cs @@ -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.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using UIKit; namespace MvvmCross.Platform.Ios.Binding.Target diff --git a/MvvmCross/Platform/iOS/Binding/Views/MvxCollectionViewSource.cs b/MvvmCross/Platform/iOS/Binding/Views/MvxCollectionViewSource.cs index dddb37b0f..510cb2cdb 100644 --- a/MvvmCross/Platform/iOS/Binding/Views/MvxCollectionViewSource.cs +++ b/MvvmCross/Platform/iOS/Binding/Views/MvxCollectionViewSource.cs @@ -8,7 +8,7 @@ using System.Collections.Specialized; using System.Threading.Tasks; using Foundation; using MvvmCross.Binding.Attributes; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using MvvmCross.WeakSubscription; using UIKit; diff --git a/MvvmCross/Platform/iOS/Binding/Views/MvxCollectionViewSourceAnimated.cs b/MvvmCross/Platform/iOS/Binding/Views/MvxCollectionViewSourceAnimated.cs index 79956ed22..766f62852 100644 --- a/MvvmCross/Platform/iOS/Binding/Views/MvxCollectionViewSourceAnimated.cs +++ b/MvvmCross/Platform/iOS/Binding/Views/MvxCollectionViewSourceAnimated.cs @@ -10,7 +10,7 @@ using System.Linq; using System.Threading.Tasks; using Foundation; using MvvmCross.Logging; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using UIKit; namespace MvvmCross.Platform.Ios.Binding.Views diff --git a/MvvmCross/Platform/iOS/Binding/Views/MvxPickerViewModel.cs b/MvvmCross/Platform/iOS/Binding/Views/MvxPickerViewModel.cs index 198f05d64..04f4f9ae3 100644 --- a/MvvmCross/Platform/iOS/Binding/Views/MvxPickerViewModel.cs +++ b/MvvmCross/Platform/iOS/Binding/Views/MvxPickerViewModel.cs @@ -8,7 +8,7 @@ using System.Collections.Specialized; using System.Windows.Input; using MvvmCross.Logging; using MvvmCross.Binding.Attributes; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using MvvmCross.WeakSubscription; using UIKit; diff --git a/MvvmCross/Platform/iOS/Binding/Views/MvxTableViewSource.cs b/MvvmCross/Platform/iOS/Binding/Views/MvxTableViewSource.cs index 712eb8cb4..9412bb251 100644 --- a/MvvmCross/Platform/iOS/Binding/Views/MvxTableViewSource.cs +++ b/MvvmCross/Platform/iOS/Binding/Views/MvxTableViewSource.cs @@ -8,7 +8,7 @@ using System.Collections.Specialized; using Foundation; using MvvmCross.Logging; using MvvmCross.Binding.Attributes; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using MvvmCross.WeakSubscription; using UIKit; diff --git a/MvvmCross/ViewModels/MvxInteractionExtensionMethods.cs b/MvvmCross/ViewModels/MvxInteractionExtensions.cs similarity index 95% rename from MvvmCross/ViewModels/MvxInteractionExtensionMethods.cs rename to MvvmCross/ViewModels/MvxInteractionExtensions.cs index 52d20b672..f8fa8c65c 100644 --- a/MvvmCross/ViewModels/MvxInteractionExtensionMethods.cs +++ b/MvvmCross/ViewModels/MvxInteractionExtensions.cs @@ -8,7 +8,7 @@ using MvvmCross.WeakSubscription; namespace MvvmCross.ViewModels { - public static class MvxInteractionExtensionMethods + public static class MvxInteractionExtensions { public static IDisposable WeakSubscribe(this IMvxInteraction interaction, EventHandler action) { @@ -28,4 +28,4 @@ namespace MvvmCross.ViewModels return interaction.WeakSubscribe(wrappedAction); } } -} \ No newline at end of file +} diff --git a/MvvmCross/Views/MvxViewExtensionMethods.cs b/MvvmCross/Views/MvxViewExtensions.cs similarity index 95% rename from MvvmCross/Views/MvxViewExtensionMethods.cs rename to MvvmCross/Views/MvxViewExtensions.cs index fc2abebe4..6c7c395f3 100644 --- a/MvvmCross/Views/MvxViewExtensionMethods.cs +++ b/MvvmCross/Views/MvxViewExtensions.cs @@ -1,4 +1,4 @@ -// 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. @@ -9,7 +9,7 @@ using MvvmCross.ViewModels; namespace MvvmCross.Views { - public static class MvxViewExtensionMethods + public static class MvxViewExtensions { public static void OnViewCreate(this IMvxView view, Func viewModelLoader) { @@ -75,4 +75,4 @@ namespace MvvmCross.Views return viewModel.SaveStateBundle(); } } -} \ No newline at end of file +} diff --git a/MvvmCross/WeakSubscription/MvxWeakSubscriptionExtensionMethods.cs b/MvvmCross/WeakSubscription/MvxWeakSubscriptionExtensions.cs similarity index 98% rename from MvvmCross/WeakSubscription/MvxWeakSubscriptionExtensionMethods.cs rename to MvvmCross/WeakSubscription/MvxWeakSubscriptionExtensions.cs index e1ea3a7f2..9ca1e9651 100644 --- a/MvvmCross/WeakSubscription/MvxWeakSubscriptionExtensionMethods.cs +++ b/MvvmCross/WeakSubscription/MvxWeakSubscriptionExtensions.cs @@ -12,7 +12,7 @@ using MvvmCross.Base; namespace MvvmCross.WeakSubscription { - public static class MvxWeakSubscriptionExtensionMethods + public static class MvxWeakSubscriptionExtensions { public static MvxNotifyPropertyChangedEventSubscription WeakSubscribe(this INotifyPropertyChanged source, EventHandler eventHandler) diff --git a/UnitTests/MvvmCross.UnitTest/Binding/ExtensionMethods/MakeSafeValueTest.cs b/UnitTests/MvvmCross.UnitTest/Binding/ExtensionMethods/MakeSafeValueTest.cs index 2e71c7ec9..90af58e34 100644 --- a/UnitTests/MvvmCross.UnitTest/Binding/ExtensionMethods/MakeSafeValueTest.cs +++ b/UnitTests/MvvmCross.UnitTest/Binding/ExtensionMethods/MakeSafeValueTest.cs @@ -4,7 +4,7 @@ using System; using MvvmCross.Binding.Binders; -using MvvmCross.Binding.ExtensionMethods; +using MvvmCross.Binding.Extensions; using MvvmCross.Converters; using MvvmCross.Test; using Xunit;