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
import Foundation | |
class Circle : Shape{ | |
func draw() { | |
print("Inside \(self.dynamicType)::draw() method.") | |
} | |
} |
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
IEnumerable<PropertyInfo> pInfos = (xListView as ItemsView<Cell>).GetType().GetRuntimeProperties(); | |
var templatedItems = pInfos.FirstOrDefault(info => info.Name == "TemplatedItems"); | |
if (templatedItems != null) | |
{ | |
var cells = templatedItems.GetValue(xListView); | |
Xamarin.Forms.ITemplatedItemsList<Xamarin.Forms.Cell> listCell = cells as Xamarin.Forms.ITemplatedItemsList<Xamarin.Forms.Cell>; | |
ViewCell currentCell = listCell[position] as ViewCell; | |
currentCell.View.BackgroundColor = Color.White; | |
foreach (ViewCell cell in cells as Xamarin.Forms.ITemplatedItemsList<Xamarin.Forms.Cell>) |
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
namespace namespaces | |
{ | |
public class BaseViewModel : ObservableObject | |
{ | |
} | |
} |
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
<StackLayout> | |
<ListView x:Name="xCatalogList" ItemsSource="{Binding Items}" VerticalOptions="FillAndExpand" HasUnevenRows="true" ItemSelected="Handle_ItemSelected"> | |
<ListView.ItemTemplate> | |
<DataTemplate> | |
<ViewCell> | |
<StackLayout Padding="10"> | |
<Label Text="{Binding Text}" LineBreakMode="NoWrap" Style="{DynamicResource ListItemTextStyle}" FontSize="16" /> | |
<Label Text="{Binding Description}" LineBreakMode="NoWrap" Style="{DynamicResource ListItemDetailTextStyle}" FontSize="13" /> | |
</StackLayout> | |
</ViewCell> |
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
switch (Device.RuntimePlatform) | |
{ | |
case Device.iOS: | |
itemsPage = new NavigationPage(new ItemsPage()) | |
{ | |
Title = "Items" | |
}; | |
aboutPage = new NavigationPage(new AboutPage()) | |
{ |
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" | |
x:Class="twoWayBinding.SwitchPage" | |
Title="Switch Panel" | |
xmlns:local="clr-namespace:twoWayBinding;assembly=twoWayBinding"> | |
<ContentPage.Content> | |
<ListView x:Name="listView" SeparatorVisibility="None" ItemsSource="{x:Static local:HomeViewModel.lights}"> | |
<ListView.ItemTemplate> | |
<DataTemplate> |
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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Net; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Threading.Tasks; | |
using Newtonsoft.Json; | |
namespace yournamespaces |
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
<uses-sdk android:minSdkVersion="19" /> | |
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | |
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | |
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> | |
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" /> | |
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | |
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<application android:label="YourLabel" android:largeHeap="true"> | |
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="YOUR_API_KEY" /> |
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
<ListView x:Name="xListview" ItemsSource="{Binding Items}" SeparatorVisibility="None" VerticalOptions="FillAndExpand" HasUnevenRows="true" ItemSelected="Handle_ItemSelected"> | |
<ListView.ItemTemplate> | |
<DataTemplate> | |
<ViewCell> | |
<Grid BackgroundColor="Red" HeightRequest="100" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"> | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition Width="50" /> | |
<ColumnDefinition Width="*" /> | |
</Grid.ColumnDefinitions> | |
<StackLayout Grid.Column="0" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"> |
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
//On constructor | |
xCatalogList.ItemSelected += (senders, e) => { | |
if (e.SelectedItem == null) return; | |
((ListView)senders).SelectedItem = null; | |
}; | |
async void Handle_ItemSelected(object sender, Xamarin.Forms.SelectedItemChangedEventArgs e) | |
{ | |
if (e.SelectedItem == null) return; |
OlderNewer