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
| static HttpClient Client = new HttpClient(new NativeMessageHandler()); | |
| async Task<T> GetJsonAsync<T>(string url) { | |
| T item = null; | |
| var response = await Client.SendAsync(new HttpRequestMessage(HttpMethod.Get, new Uri(url))); | |
| if (response.IsSuccessStatusCode) { | |
| var json = await response.Content.ReadAsStringAsync(); | |
| item = JsonConvert.DeserializeObject<T>(json); | |
| } | |
| return item; |
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
| namespace MyCoolApp { | |
| public class SomeClass { | |
| public SomeClass{ | |
| DependencyService.Get<INativeCookieService>().ClearCookies(); | |
| } | |
| } | |
| } | |
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 Xamarin.Forms; | |
| using Xamarin.Forms.Platform.iOS; | |
| [assembly: ExportRenderer(typeof(Entry), typeof(MyCoolApp.iOS.CustomEntryRenderer))] | |
| namespace MyCoolApp.iOS { | |
| public class CustomEntryRenderer : EntryRenderer { | |
| protected override void OnElementChanged(ElementChangedEventArgs<Entry> e) { | |
| base.OnElementChanged(e); | |
| if (this.Control != 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MyCoolApp.LoginPage"> | |
| <ContentPage.Content> | |
| <StackLayout> | |
| <Entry x:Name="usernameEntry" Placeholder="Username" /> | |
| <Entry x:Name="passwordEntry" Placeholder="Password" IsPassword="true" /> | |
| <Button x:Name="loginButton" Text="Login" Command="{Binding LoginCommand}" /> | |
| </StackLayout> | |
| </ContentPage.Content> | |
| </ContentPage> |
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 partial class App : Application { | |
| private static Locator _locator; | |
| public static Locator Locator { | |
| get { | |
| return _locator ?? (_locator = new Locator()); | |
| } | |
| } | |
| public App() { | |
| var navigationPage = new NavigationPage(new HomePage()); |