This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class ViewModelBase : MvxViewModel | |
{ | |
protected void ClearStackAndShowViewModel<TViewModel>() | |
where TViewModel : ViewModelBase | |
{ | |
var presentationBundle = new MvxBundle(new Dictionary<string, string> { { PresentationBundleFlagKeys.ClearStack, "" } }); | |
ShowViewModel<TViewModel>(presentationBundle: presentationBundle); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using MonoTouch.UIKit; | |
using MonoTouch.Dialog; | |
namespace WTFDialogTest | |
{ | |
public class WTFDialogTestViewController : DialogViewController | |
{ | |
public WTFDialogTestViewController() : base(null) | |
{ | |
Root = new RootElement("WTF Dialog") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal IList<string> OpenMessageSubscriptions = new List<string>(); | |
protected bool ShowSubViewModel<TSubViewModel, TResult>(SubViewModelBase<TResult>.ParametersBase parameters, Action<TResult> onResult) | |
where TSubViewModel : SubViewModelBase<TResult> | |
{ | |
MvxSubscriptionToken token = null; | |
token = Messenger.Subscribe<SubNavigationResultMessage<TResult>>( | |
msg => | |
{ | |
if (token != null) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[NUnit.Framework.TestAttribute] | |
public void $Method$_$Scenario$_$ExpectedResult$() | |
{ | |
$END$ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TinyIoCProvider : IMvxIoCProvider | |
{ | |
private readonly TinyIoCContainer _container; | |
public TinyIoCProvider() | |
{ | |
_container = new TinyIoCContainer(); | |
} | |
public bool SupportsService<T>() where T : class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestFixture] | |
public class SubViewModelTests | |
{ | |
[Test] | |
public void RequestSubNavigate_NavigatesToChildViewModel_PassesInMessageId() | |
{ | |
var parentViewModel = new ParentViewModel(); | |
parentViewModel.GoToChildViewCommand.Execute(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestFixture] | |
public abstract class ViewModelTestsBase | |
{ | |
protected ITinyMessengerHub MessengerHub { get; private set; } | |
protected MockMvxViewDispatcher Dispatcher { get; private set; } | |
[SetUp] | |
public void SetUp() | |
{ | |
MvxOpenNetCfContainer.ClearAllSingletons(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected bool RequestSubNavigate<TViewModel, TResult>(IDictionary<string, string> parameterValues, Action<TResult> onResult) | |
where TViewModel : SubViewModelBase<TResult> | |
{ | |
parameterValues = parameterValues ?? new Dictionary<string, string>(); | |
if (parameterValues.ContainsKey("messageId")) | |
throw new ArgumentException("parameterValues cannot contain an item with the key 'messageId'"); | |
string messageId = Guid.NewGuid().ToString(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class SubViewModelBase<TResult> : ViewModelBase | |
{ | |
protected string MessageId { get; private set; } | |
protected SubViewModelBase(string messageId) | |
{ | |
MessageId = messageId; | |
} | |
protected void Cancel() |