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
| _sourceCache.Edit((update) => | |
| { | |
| update.AddOrUpdate(new Restaurant(name, "Casual", "Fast Food", "US")); | |
| }); |
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 System; | |
| using System.Collections.ObjectModel; | |
| using System.Reactive.Linq; | |
| using DynamicData; | |
| using System.Collections.Generic; | |
| using System.Threading.Tasks; | |
| namespace DynamicDataGroupingSample | |
| { | |
| public class MainViewModel : IDisposable |
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
| <ListView ItemsSource="{Binding Restaurants}"> | |
| <ListView.ItemTemplate> | |
| <DataTemplate x:DataType="local:Restaurant"> | |
| <TextCell Text="{Binding Name}" | |
| Detail="{Binding Type}"/> | |
| </DataTemplate> | |
| </ListView.ItemTemplate> | |
| </ListView> |
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
| _cleanUp = _sourceCache.Connect() | |
| .RefCount() | |
| .Bind(out _restaurants) | |
| .DisposeMany() | |
| .Subscribe(); |
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 System; | |
| namespace DynamicDataGroupingSample | |
| { | |
| public class Restaurant | |
| { | |
| public Restaurant(string name, string category, string type, string country) | |
| { | |
| Id = Guid.NewGuid().ToString(); | |
| Name = name; | |
| Category = category; |
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
| _sourceCache.AddOrUpdate(new List<Restaurant>() | |
| { | |
| new Restaurant("Yao","Casual","Asian Fusion","Dominican Republic"), | |
| new Restaurant("Chef Pepper","Casual","International","Dominican Republic"), | |
| new Restaurant("Bottega Fratelli","Formal","International","Dominican Republic"), | |
| new Restaurant("McDonalds","Fast Food","Burgers","United States"), | |
| new Restaurant("Burger King","Fast Food","Burgers","United States"), | |
| new Restaurant("Sushi Nation","Casual","Sushi","Venezuela"), | |
| new Restaurant("Pollo Victorina","Fast Food","Chicken","Dominican Republic"), | |
| new Restaurant("Pollo Rey","Fast Food","Chicken","Dominican Republic"), |
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 ReadOnlyObservableCollection<Restaurant> Restaurants => _restaurants; | |
| private readonly ReadOnlyObservableCollection<Restaurant> _restaurants; |
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
| private SourceCache<Restaurant, string> _sourceCache = new SourceCache<Restaurant, string>(x => x.Id); |
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
| <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
| xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
| x:Class="LoginPage"> | |
| <StackLayout> | |
| <Button TextColor="Red" x:Name="login" Text="Register" BackgroundColor="Beige" BorderColor="Pink" Command="{Binding LoginCommand}" /> | |
| <Button x:Name="registerBtn" TextColor="Firebrick" Text="Login" BackgroundColor="Firebrick" BorderColor="Green" Command="{Binding RegisterCommand}"/> | |
| <Image Source="user" HorizontalOptions="End"> | |
| <Image.GestureRecognizers> | |
| <TapGestureRecognizer Tapped="UserTapped"/> | |
| </Image.GestureRecognizers> |
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
| <Style x:Key="HeaderLabelStyle" TargetType="Label"> | |
| <Setter Property="FontAttributes" Value="Bold" /> | |
| <Setter Property="Padding" Value="10" /> | |
| <Setter Property="TextColor" Value="Gray" /> | |
| </Style> |