This file contains 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
"phoneNumbers": [ | |
{ | |
"number": "+1 555-555-5555", | |
"day": "", | |
"month": "", | |
"dayOfWeek": "", | |
"startTime": "", | |
"endTime": "", | |
"title": "Primary", | |
"international": false |
This file contains 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 CarouselIndicators : Grid | |
{ | |
private ImageSource UnselectedImageSource = null; | |
private ImageSource SelectedImageSource = null; | |
private readonly StackLayout _indicators = new StackLayout() { Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.CenterAndExpand }; | |
public CarouselIndicators() | |
{ | |
this.HorizontalOptions = LayoutOptions.CenterAndExpand; | |
this.RowDefinitions.Add(new RowDefinition() { Height = GridLength.Auto }); |
This file contains 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" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:local="clr-namespace:InfiniteListView" | |
x:Class="InfiniteListView.InfiniteListViewPage" | |
Title="Infinite Scrolling List" | |
xmlns:scroll="clr-namespace:Xamarin.Forms.Extended;assembly=Xamarin.Forms.Extended.InfiniteScrolling"> | |
<ListView | |
CachingStrategy="RecycleElement" |
This file contains 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 InfiniteListViewViewModel : INotifyPropertyChanged | |
{ | |
public InfiniteScrollCollection<DataItem> Items { get; } | |
bool _isLoadingMore; | |
bool IsLoadingMore | |
{ | |
get | |
{ | |
return _isLoadingMore; |
This file contains 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 partial class InfiniteListViewPage : ContentPage | |
{ | |
public InfiniteListViewPage() | |
{ | |
InitializeComponent(); | |
BindingContext = new InfiniteListViewViewModel(); | |
} | |
} |
This file contains 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 Test | |
{ | |
[Test] | |
public void TestCase() | |
{ | |
Assert.IsTrue(true); | |
} | |
} |
This file contains 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 DependencyServiceStub : IDependencyService | |
{ | |
readonly Dictionary<Type, object> registeredServices = new Dictionary<Type, object>(); | |
public void Register<T>(object impl) | |
{ | |
registeredServices[typeof(T)] = impl; | |
} | |
public T Get<T>() where T : class |
This file contains 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 interface IDependencyService | |
{ | |
T Get<T>() where T : class; | |
} | |
public class DependencyServiceWrapper : IDependencyService | |
{ | |
public T Get<T>() where T : class | |
{ | |
// The wrapper will simply pass everything through to the real Xamarin.Forms DependencyService class when not unit testing |
This file contains 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 UnitTestViewModel | |
{ | |
public Command LoadDataCommand { get; set; } | |
public string Data { get; set; } | |
public UnitTestViewModel() | |
{ | |
LoadDataCommand = new Command(async () => await LoadData()); | |
} |
This file contains 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 UnitTestViewModel | |
{ | |
public Command LoadDataCommand { get; set; } | |
public string Data { get; set; } | |
readonly IDependencyService _dependencyService; | |
public UnitTestViewModel() : this(new DependencyServiceWrapper()) | |
{ | |
} |
OlderNewer