Skip to content

Commit

Permalink
Add headers
Browse files Browse the repository at this point in the history
  • Loading branch information
wcoder committed Dec 18, 2018
1 parent 4a8d137 commit a623041
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 20 deletions.
5 changes: 2 additions & 3 deletions Softeq.XToolkit.WhiteLabel.Droid/ActivityBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using Softeq.XToolkit.Bindings;
using Softeq.XToolkit.Bindings.Extensions;
using Softeq.XToolkit.Common.Interfaces;
using Softeq.XToolkit.Permissions;
using Softeq.XToolkit.WhiteLabel.Droid.Navigation;
using Softeq.XToolkit.WhiteLabel.Droid.ViewComponents;
using Softeq.XToolkit.WhiteLabel.Mvvm;
Expand Down Expand Up @@ -81,7 +80,7 @@ protected ActivityBase()
{
Bindings = new List<Binding>();
_jsonSerializer = Dependencies.JsonSerializer;
_viewModel = new Lazy<TViewModel>(() =>
_viewModelLazy = new Lazy<TViewModel>(() =>
{
var backStack = Dependencies.IocContainer.Resolve<IBackStackManager>();
return backStack.GetExistingOrCreateViewModel<TViewModel>();
Expand Down Expand Up @@ -211,6 +210,6 @@ public abstract class ActivityBase<TViewModel, TInterface> : ActivityBase<TViewM
private TViewModel _viewModel;

protected override TViewModel ViewModel =>
_viewModel ?? (_viewModel = (TViewModel) Dependencies.IocContainer.Resolve<TInterface>());
_viewModel ?? (_viewModel = (TViewModel)Dependencies.IocContainer.Resolve<TInterface>());
}
}
3 changes: 3 additions & 0 deletions Softeq.XToolkit.WhiteLabel.Droid/Navigation/Constants.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Developed by Softeq Development Corporation
// http://www.softeq.com

namespace Softeq.XToolkit.WhiteLabel.Droid.Navigation
{
public static class Constants
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Developed by Softeq Development Corporation
// http://www.softeq.com

using System;
using Android.OS;
using Android.Views;
using Softeq.XToolkit.WhiteLabel.Mvvm;
Expand Down
10 changes: 5 additions & 5 deletions Softeq.XToolkit.WhiteLabel.Droid/Navigation/ViewLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public object GetView(ViewModelBase viewModel, ViewType viewType)
var targetType = GetTargetType(viewModel.GetType(), viewType);
var inst = Activator.CreateInstance(targetType);
var method = inst.GetType().GetMethod("SetExistingViewModel");
method.Invoke(inst, new[] {viewModel});
method.Invoke(inst, new[] { viewModel });
return inst;
}

Expand All @@ -37,7 +37,7 @@ public object GetView(IViewModelBase viewModel, ViewType viewType)
var targetType = GetTargetType(viewModel.GetType(), viewType);
var inst = Activator.CreateInstance(targetType);
var method = inst.GetType().GetMethod("SetExistingViewModel");
method.Invoke(inst, new[] {viewModel});
method.Invoke(inst, new[] { viewModel });
return inst;
}

Expand All @@ -47,11 +47,11 @@ public Type GetTargetType(string viewModelTypeName, ViewType viewType)
targetTypeName = targetTypeName.Replace("ViewModel", viewType.ToString());

var targeType = Type.GetType(targetTypeName)
?? AssemblySource.FindTypeByNames(new[] {targetTypeName});
?? AssemblySource.FindTypeByNames(new[] { targetTypeName });

if (targeType == null)
{
throw new DllNotFoundException("can't find target type");
throw new DllNotFoundException($"Can't find target type: {targetTypeName}");
}

return targeType;
Expand All @@ -76,7 +76,7 @@ public void TryInjectParameters(object viewModel, object parameter, string param
private PropertyInfo GetPropertyCaseInsensitive(Type type, string propertyName)
{
var typeInfo = type.GetTypeInfo();
var typeList = new List<Type> {type};
var typeList = new List<Type> { type };

if (typeInfo.IsInterface)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System.Collections.Generic;
// Developed by Softeq Development Corporation
// http://www.softeq.com

using System.Collections.Generic;
using Softeq.XToolkit.WhiteLabel.Mvvm;

namespace Softeq.XToolkit.WhiteLabel.Navigation
Expand All @@ -7,11 +10,11 @@ public interface IPlatformNavigationService
{
void NavigateToViewModel(ViewModelBase viewModelBase, bool clearBackStack,
IReadOnlyList<NavigationParameterModel> parameters);

bool CanGoBack { get; }

void Initialize(object navigation);

void GoBack();
}
}
9 changes: 6 additions & 3 deletions Softeq.XToolkit.WhiteLabel/Navigation/NavigateHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System;
// Developed by Softeq Development Corporation
// http://www.softeq.com

using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Reflection;
Expand All @@ -20,9 +23,9 @@ public NavigateHelper(PageNavigationService navigationService)

public NavigateHelper<TViewModel> WithParam<TValue>(Expression<Func<TViewModel, TValue>> property, TValue value)
{
var parameter = new NavigationParameterModel {Value = value};
var parameter = new NavigationParameterModel { Value = value };

var propertyInfo = (PropertyInfo) property.GetMemberInfo();
var propertyInfo = (PropertyInfo)property.GetMemberInfo();
parameter.PropertyInfo = PropertyInfoModel.FromProperty(propertyInfo);

_parameters.Add(parameter);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace Softeq.XToolkit.WhiteLabel.Navigation
// Developed by Softeq Development Corporation
// http://www.softeq.com

namespace Softeq.XToolkit.WhiteLabel.Navigation
{
public class NavigationParameterModel
{
Expand Down
5 changes: 3 additions & 2 deletions Softeq.XToolkit.WhiteLabel/Navigation/PageNavigation.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Developed by Softeq Development Corporation
// http://www.softeq.com

using System.Collections.Generic;
using Softeq.XToolkit.WhiteLabel.Interfaces;
using Softeq.XToolkit.WhiteLabel.Mvvm;
using Softeq.XToolkit.WhiteLabel.Threading;

namespace Softeq.XToolkit.WhiteLabel.Navigation
{
Expand Down
5 changes: 4 additions & 1 deletion Softeq.XToolkit.WhiteLabel/Navigation/PropertyInfoModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using System;
// Developed by Softeq Development Corporation
// http://www.softeq.com

using System;
using System.Reflection;

namespace Softeq.XToolkit.WhiteLabel.Navigation
Expand Down

0 comments on commit a623041

Please sign in to comment.