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"?> | |
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:orientation="vertical" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent"> | |
| <include | |
| android:id="@+id/toolbar" | |
| layout="@layout/toolbar" /> | |
| <FrameLayout | |
| android:layout_width="fill_parent" |
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="ImageSearch.Shared.View.DetailsPage" | |
| Title="{Binding SelectedImage.Title}"> | |
| <ContentPage.Content> | |
| <ScrollView HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"> | |
| <StackLayout Padding="10"> | |
| <Image | |
| HeightRequest="200" |
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 string GetIPAddressQuick() | |
| { | |
| var interfaces = NetworkInterface.NetworkInterfaces; | |
| IPAddress ipAddr; | |
| try | |
| { | |
| bool hasMore = true; | |
| int count = 0; | |
| while (hasMore) |
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
| Device.OnPlatform( | |
| iOS: () => MainPage.BackgroundColor = Color.Black, | |
| Android: () => MainPage.BackgroundColor = Color.Red, | |
| WinPhone: () => MainPage.BackgroundColor = Color.Orange, | |
| Default: () => MainPage.BackgroundColor = Color.Transparent); |
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
| <!--Old XAML On Platform--> | |
| <StackLayout> | |
| <StackLayout.Padding> | |
| <OnPlatform x:TypeArguments="Thickness" | |
| Android="0, 0, 0, 0" | |
| WinPhone="0, 0, 0, 0" | |
| iOS="0, 20, 0, 0"/> | |
| </StackLayout.Padding> | |
| </StackLayout> |
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
| if(Device.RuntimePlatform == Device.iOS) | |
| { | |
| //iOS stuff | |
| } | |
| else if(Device.RuntimePlatform == Device.Android) | |
| { | |
| } |
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.Generic; | |
| using System.Threading.Tasks; | |
| using Plugin.Connectivity.Abstractions; | |
| namespace UnitTestProject.Tests.Mock | |
| { | |
| public class MockConnectivity : IConnectivity | |
| { | |
| public bool IsConnected => true; |
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 class MyClass | |
| { | |
| public int Math(int x, int y) | |
| { | |
| if (!Connectivity.Instance.IsConnected) | |
| return x + y + x; | |
| return x + y; | |
| } | |
| } |
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 Connectivity | |
| { | |
| static IConnectivity connectivity; | |
| public static IConnectivity Instance | |
| { | |
| get | |
| { | |
| return connectivity ?? (connectivity = CrossConnectivity.Current); | |
| } | |
| set |
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 Settings | |
| { | |
| ISettings AppSettings | |
| { | |
| get | |
| { | |
| return CrossSettings.Current; | |
| } | |
| } |