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 App() | |
{ | |
MainPage = new UserInterfaces.Dashboard(); | |
} |
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 Dashboard : ContentPageBase<ViewModels.Dashboard> | |
{ | |
Grid _mainLayout; | |
// 1 | |
Image _images; | |
Label _status; | |
// 2 | |
public Dashboard() |
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 static class IObservableExtensions | |
{ | |
public static TDisposable DisposeWith<TDisposable>(this TDisposable observable, CompositeDisposable disposables) where TDisposable : class, IDisposable | |
{ | |
if (observable != null) | |
disposables?.Add(observable); | |
return observable; | |
} |
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 Dashboard : ViewModelBase<Dashboard> | |
{ | |
[DataMember] | |
public string Title | |
{ | |
get { return "My Dashboard"; } | |
} | |
// 1 | |
string _statusMessage; |
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
[Register("AppDelegate")] | |
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate | |
{ | |
public override bool FinishedLaunching(UIApplication app, NSDictionary options) | |
{ | |
global::Xamarin.Forms.Forms.Init(); | |
DependencyService.Register<Interfaces.IRendererResolver, Services.RendererResolver>(); | |
LoadApplication(new App()); |
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 RendererResolver : Interfaces.IRendererResolver | |
{ | |
MethodInfo _cellRenderer; | |
public RendererResolver() | |
{ | |
_cellRenderer = typeof(CellRenderer).GetMethod("GetRenderer", BindingFlags.Static | BindingFlags.NonPublic); | |
} | |
public object GetCellRenderer(BindableObject element) |
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
protected override void OnCreate(Bundle bundle) | |
{ | |
TabLayoutResource = Resource.Layout.Tabbar; | |
ToolbarResource = Resource.Layout.Toolbar; | |
base.OnCreate(bundle); | |
global::Xamarin.Forms.Forms.Init(this, bundle); | |
// add this line | |
DependencyService.Register<Interfaces.IRendererResolver, Services.RendererResolver>(); |
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 RendererResolver : Interfaces.IRendererResolver | |
{ | |
MethodInfo _cellRenderer; | |
public RendererResolver() | |
{ | |
_cellRenderer = typeof(CellRenderer).GetMethod("GetRenderer", BindingFlags.Static | BindingFlags.NonPublic); | |
} | |
public object GetCellRenderer(BindableObject element) |
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 IRendererResolver | |
{ | |
object GetRenderer(VisualElement element); | |
bool HasRenderer(VisualElement element); | |
object GetCellRenderer(BindableObject element); | |
bool HasCellRenderer(BindableObject element); | |
} |
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
// 1 | |
public abstract class ContentPageBase<TViewModel> : ReactiveContentPage<TViewModel> where TViewModel : ViewModels.ViewModelBase<TViewModel> | |
{ | |
// 2 | |
protected Lazy<CompositeDisposable> ControlBindings = new Lazy<CompositeDisposable>(() => new CompositeDisposable()); | |
// 3 | |
bool _controlsBound = false; | |
// 4 |
NewerOlder