ExtensionMethods -> Extensions
This commit is contained in:
Родитель
a10941e03a
Коммит
94acad7b5d
|
@ -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<TFragment>(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<TFragment>(fragment);
|
||||
}
|
||||
|
||||
public static TFragment FindFragmentByTag<TFragment>(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<TFragment>(fragment);
|
||||
}
|
||||
|
||||
private static TFragment SafeCast<TFragment>(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<IMvxViewModelLoader>();
|
||||
var viewModel = loader.LoadViewModel(request, savedState);
|
||||
if (viewModel == null) {
|
||||
MvxAndroidLog.Instance.Warn("ViewModel not loaded for {0}", request.ViewModelType.FullName);
|
||||
return;
|
||||
}
|
||||
|
||||
view.ViewModel = viewModel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<TFragment>(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<TFragment>(fragment);
|
||||
}
|
||||
|
||||
public static TFragment FindFragmentByTag<TFragment>(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<TFragment>(fragment);
|
||||
}
|
||||
|
||||
private static TFragment SafeCast<TFragment>(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<IMvxViewModelLoader>();
|
||||
var viewModel = loader.LoadViewModel(request, savedState);
|
||||
if (viewModel == null)
|
||||
{
|
||||
MvxAndroidLog.Instance.Warn("ViewModel not loaded for {0}", request.ViewModelType.FullName);
|
||||
return;
|
||||
}
|
||||
|
||||
view.ViewModel = viewModel;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using MvvmCross.Binding.ExtensionMethods;
|
||||
using MvvmCross.Binding.Extensions;
|
||||
|
||||
namespace MvvmCross.Plugin.FieldBinding
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace MvvmCross.Plugin.PictureChooser
|
||||
{
|
||||
public static class MvxPictureChooserExtensionMethods
|
||||
public static class MvxPictureChooserExtensions
|
||||
{
|
||||
public static Task<Stream> ChoosePictureFromLibraryAsync(this IMvxPictureChooserTask chooser, int maxPixelDimension, int percentQuality)
|
||||
{
|
|
@ -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)
|
||||
{
|
|
@ -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";
|
|
@ -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)
|
||||
{
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using MvvmCross.Binding.ExtensionMethods;
|
||||
using MvvmCross.Binding.Extensions;
|
||||
using MvvmCross.Converters;
|
||||
using MvvmCross.Exceptions;
|
||||
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// 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
|
||||
{
|
|
@ -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
|
||||
{
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
using System.Collections;
|
||||
|
||||
namespace MvvmCross.Binding.ExtensionMethods
|
||||
namespace MvvmCross.Binding.Extensions
|
||||
{
|
||||
public static class MvxEnumerableExtensions
|
||||
{
|
|
@ -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<string, string> ToSimpleStringPropertyDictionary(
|
||||
this IDictionary<string, object> input)
|
|
@ -6,7 +6,7 @@ using System;
|
|||
|
||||
namespace MvvmCross.Exceptions
|
||||
{
|
||||
public static class MvxExceptionExtensionMethods
|
||||
public static class MvxExceptionExtensions
|
||||
{
|
||||
public static string ToLongString(this Exception exception)
|
||||
{
|
|
@ -8,7 +8,7 @@ using System.Reflection;
|
|||
|
||||
namespace MvvmCross.IoC
|
||||
{
|
||||
public static class MvxConventionAttributeExtensionMethods
|
||||
public static class MvxConventionAttributeExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// A type is conventional if and only it is:
|
|
@ -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);
|
||||
|
|
@ -6,7 +6,7 @@ using System;
|
|||
|
||||
namespace MvvmCross.Platform.Android.Base.WeakSubscription
|
||||
{
|
||||
public static class MvxAndroidWeakSubscriptionExtensionMethods
|
||||
public static class MvxAndroidWeakSubscriptionExtensions
|
||||
{
|
||||
public static MvxJavaEventSubscription<TSource> WeakSubscribe<TSource>(this TSource source, string eventName, EventHandler eventHandler)
|
||||
where TSource : class
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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<TFragment>(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<TFragment>(fragment);
|
||||
}
|
||||
|
||||
public static TFragment FindFragmentByTag<TFragment>(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<TFragment>(fragment);
|
||||
}
|
||||
|
||||
private static TFragment SafeCast<TFragment>(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<IMvxViewModelLoader>();
|
||||
var viewModel = loader.LoadViewModel(request, savedState);
|
||||
if (viewModel == null) {
|
||||
MvxLog.Instance.Warn("ViewModel not loaded for {0}", request.ViewModelType.FullName);
|
||||
return;
|
||||
}
|
||||
|
||||
view.ViewModel = viewModel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<TFragment>(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<TFragment>(fragment);
|
||||
}
|
||||
|
||||
public static TFragment FindFragmentByTag<TFragment>(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<TFragment>(fragment);
|
||||
}
|
||||
|
||||
private static TFragment SafeCast<TFragment>(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<IMvxViewModelLoader>();
|
||||
var viewModel = loader.LoadViewModel(request, savedState);
|
||||
if (viewModel == null)
|
||||
{
|
||||
MvxLog.Instance.Warn("ViewModel not loaded for {0}", request.ViewModelType.FullName);
|
||||
return;
|
||||
}
|
||||
|
||||
view.ViewModel = viewModel;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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)
|
||||
{
|
|
@ -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);
|
||||
|
|
@ -9,7 +9,7 @@ using MvvmCross.ViewModels;
|
|||
|
||||
namespace MvvmCross.Platform.Ios.Views
|
||||
{
|
||||
public static class MvxCanCreateIosViewExtensionMethods
|
||||
public static class MvxCanCreateIosViewExtensions
|
||||
{
|
||||
public static IMvxIosView CreateViewControllerFor<TTargetViewModel>(this IMvxCanCreateIosView view,
|
||||
object parameterObject)
|
|
@ -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)
|
||||
{
|
|
@ -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)
|
||||
{
|
|
@ -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)
|
||||
{
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
@ -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)
|
||||
{
|
|
@ -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)
|
||||
{
|
|
@ -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)
|
||||
{
|
|
@ -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);
|
||||
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ using MvvmCross.ViewModels;
|
|||
|
||||
namespace MvvmCross.Platform.Tvos.Views
|
||||
{
|
||||
public static class MvxCanCreateTvosViewExtensionMethods
|
||||
public static class MvxCanCreateTvosViewExtensions
|
||||
{
|
||||
public static IMvxTvosView CreateViewControllerFor<TTargetViewModel>(this IMvxCanCreateTvosView view,
|
||||
object parameterObject)
|
|
@ -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)
|
||||
{
|
|
@ -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)
|
||||
{
|
|
@ -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)
|
||||
{
|
|
@ -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)
|
||||
{
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
|
@ -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<IMvxBundle> bundleLoader)
|
||||
{
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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<EventArgs> action)
|
||||
{
|
|
@ -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<IMvxViewModel> viewModelLoader)
|
||||
{
|
|
@ -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<PropertyChangedEventArgs> eventHandler)
|
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче