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 static class CustomerFeelingSheet { | |
public static Task<CustomerFeeling> ShowRatingDialogAsync(UIViewController parent) { | |
var taskCompletionSource = new TaskCompletionSource<CustomerFeeling>(); | |
var alert = UIAlertController.Create("howDoYouFeel".T(), null, UIAlertControllerStyle.ActionSheet); | |
alert.AddAction(UIAlertAction.Create("likeIt".T(), UIAlertActionStyle.Default, | |
a => taskCompletionSource.SetResult(CustomerFeeling.LikeIt))); | |
alert.AddAction(UIAlertAction.Create("couldBeBetter".T(), UIAlertActionStyle.Default, | |
a => taskCompletionSource.SetResult(CustomerFeeling.CouldBeBetter))); |
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
var instance = FermiContainer.DefaultInstance; | |
IsInstanceOf<IFermiContainer>(instance); | |
Assert.AreSame(instance, FermiContainer.DefaultInstance); |
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
[Test] | |
public void Register_EvenMoreComplexClass_CanBeResolved() { | |
m_fermiContainer.Register<IEvenMoreComplex, EvenMoreComplex>(); | |
m_fermiContainer.Register<ICalculator, Calculator>(); | |
m_fermiContainer.Register<IComplex, ComplexClass>(); | |
m_fermiContainer.Register<ClassWithoutInterface>(); | |
var complexInstance = m_fermiContainer.Resolve<IEvenMoreComplex>(); | |
IsInstanceOf<IEvenMoreComplex>(complexInstance); |
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
var calculator = new Calculator(); | |
m_fermiContainer.Register<ICalculator, Calculator>(() => calculator); | |
var calculator2 = m_fermiContainer.Resolve<ICalculator>(); | |
Assert.AreSame(calculator, calculator2); |
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
var calculator = fermiContainer.Singleton<ICalculator>(); | |
var calculator2 = fermiContainer.Singleton<ICalculator>(); | |
Assert.AreSame(calculator, calculator2); |
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
var calculator = fermiContainer.Resolve<ICalculator>(); | |
Assert.IsInstanceOf<Calculator>(calculator); | |
var calculator2 = fermiContainer.Resolve<ICalculator>(); | |
Assert.AreNotSame(calculator, calculator2); |
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
IFermiContainer fermiContainer = new FermiContainer(); | |
fermiContainer.Register<ICalculator, Calculator>(); | |
fermiContainer.Register<ClassWithOutAnInterface>(); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<ContentPage | |
xmlns="http://xamarin.com/schemas/2014/forms" | |
x:Class="PersonalTrainer.Views.DayDetailsPage" | |
Title="{Binding Day}" > | |
<TableView VerticalOptions="FillAndExpand" Intent="Form"> | |
<TableView.Root> | |
<TableRoot> | |
<TableSection Title="Time spent"> | |
<ViewCell Tapped="HandleTapped"> |
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
... | |
browser.Dock = DockStyle.Fill; | |
browser.Size = Size; | |
... | |
Controls.Add(browser); |
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
... | |
browser.Dock = DockStyle.Fill; | |
... | |
Controls.Add(browser); |