Skip to content

Instantly share code, notes, and snippets.

@dkudelko
dkudelko / ListView.cs
Created January 26, 2016 06:22
ItemList MVVM Tap Command
using System;
using System.Windows.Input;
using Xamarin.Forms;
namespace YourNS {
public class ListView : Xamarin.Forms.ListView {
public static BindableProperty ItemClickCommandProperty = BindableProperty.Create<ListView, ICommand>(x => x.ItemClickCommand, null);
@dkudelko
dkudelko / LoadMoreBottom.cs
Created February 5, 2016 13:25
Load More Items at End of ListView in Xamarin.Forms
using System;
using Xamarin.Forms;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
namespace LoadMoreBottom
{
public class App : Application
{
@dkudelko
dkudelko / CustomFontLabelRenderer.cs
Last active March 2, 2016 13:00
Xamarin Forms Android Custom Font
using Xamarin.Forms;
//https://developer.xamarin.com/guides/xamarin-forms/user-interface/text/fonts/
[assembly: ExportRenderer(typeof(Label), typeof(CustomFontLabelRenderer))]
namespace dkudelko.Mobile.Android
{
public class CustomFontLabelRenderer : LabelRenderer
{
private static readonly string[] CustomFontFamily = new [] { "FontAwesome" };
@dkudelko
dkudelko / FadeTriggerAction.cs
Created March 4, 2016 11:02
image tirgger fade
public class FadeTriggerAction : TriggerAction<VisualElement>
{
public FadeTriggerAction() {}
public int StartsFrom { set; get; }
protected override void Invoke (VisualElement visual)
{
visual.Animate("", new Animation( (d)=>{
var val = StartsFrom == 0 ? d : 1-d;
@dkudelko
dkudelko / CustomEntryRenderer_Droid.cs
Created March 21, 2016 08:25
remove a default bottom line on android entry Xamarin.Forms
using Mobile.Droid.Renderers;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
[assembly: ExportRenderer(typeof(Entry), typeof(CustomEntryRenderer_Droid))]
namespace Mobile.Droid.Renderers
{
public class CustomEntryRenderer_Droid : EntryRenderer
{
@dkudelko
dkudelko / CustomAllViewCellRendereriOS.cs
Created June 24, 2016 13:16 — forked from jessejiang0214/CustomAllViewCellRendereriOS.cs
Disable Xamarin Forms ListView select item HightLight color
using System;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
[assembly: ExportRenderer (typeof(ViewCell), typeof(MyAPP.iOS.CustomAllViewCellRendereriOS))]
namespace MyAPP.iOS
{
public class CustomAllViewCellRendereriOS : ViewCellRenderer
{
public override UIKit.UITableViewCell GetCell (Cell item, UIKit.UITableViewCell reusableCell, UIKit.UITableView tv)
@dkudelko
dkudelko / ExtendedSearchBarRenderer.cs
Created July 18, 2016 09:14 — forked from xleon/ExtendedSearchBarRenderer.cs
Xamarin.Forms renderer to hide the "Cancel" button of a SearchBar on iOS
using System;
using Xamarin.Forms.Platform.iOS;
using Xamarin.Forms;
using UIKit;
using System.Diagnostics;
[assembly: ExportRenderer(typeof(SearchBar), typeof(Namespace.iOS.Renderers.ExtendedSearchBarRenderer))]
namespace Namespace.iOS.Renderers
{
@dkudelko
dkudelko / page.xaml
Created July 28, 2016 07:44
image paralax effect
<ScrollView x:Name="scrollView" StyleId="scrollView">
<StackLayout VerticalOptions="Fill" BackgroundColor="Fuchsia">
<Image x:Name="photoImage" />
....
@dkudelko
dkudelko / Enumerator.cs
Created August 26, 2016 11:05
Enumerator.cs
var enumerator = list.GetEnumerator();
while (enumerator.MoveNext())
if (enumerator.Current.Id.Equals(customId))
{
enumerator.Current.DateModified = DateTime.Now;
//... smght else
}