2016-05-12 07:09:06 +03:00
|
|
|
|
using System;
|
|
|
|
|
using Xamarin.Forms;
|
2016-07-03 09:57:09 +03:00
|
|
|
|
using System.Reflection;
|
|
|
|
|
using System.Reflection.Emit;
|
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
using XLabs.Ioc;
|
|
|
|
|
using Bit.App.Abstractions;
|
2016-05-12 07:09:06 +03:00
|
|
|
|
|
|
|
|
|
namespace Bit.App.Controls
|
|
|
|
|
{
|
|
|
|
|
public class ExtendedTableView : TableView
|
|
|
|
|
{
|
2016-05-13 04:30:02 +03:00
|
|
|
|
public static readonly BindableProperty EnableScrollingProperty =
|
|
|
|
|
BindableProperty.Create(nameof(EnableScrolling), typeof(bool), typeof(ExtendedTableView), true);
|
|
|
|
|
|
|
|
|
|
public static readonly BindableProperty EnableSelectionProperty =
|
|
|
|
|
BindableProperty.Create(nameof(EnableSelection), typeof(bool), typeof(ExtendedTableView), true);
|
|
|
|
|
|
2016-05-14 08:34:42 +03:00
|
|
|
|
public static readonly BindableProperty SeparatorColorProperty =
|
|
|
|
|
BindableProperty.Create(nameof(SeparatorColor), typeof(Color), typeof(ExtendedTableView), Color.FromHex("d2d6de"));
|
|
|
|
|
|
2016-05-13 04:30:02 +03:00
|
|
|
|
public bool EnableScrolling
|
|
|
|
|
{
|
|
|
|
|
get { return (bool)GetValue(EnableScrollingProperty); }
|
|
|
|
|
set { SetValue(EnableScrollingProperty, value); }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool EnableSelection
|
|
|
|
|
{
|
|
|
|
|
get { return (bool)GetValue(EnableSelectionProperty); }
|
|
|
|
|
set { SetValue(EnableSelectionProperty, value); }
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-14 08:34:42 +03:00
|
|
|
|
public Color SeparatorColor
|
|
|
|
|
{
|
|
|
|
|
get { return (Color)GetValue(SeparatorColorProperty); }
|
|
|
|
|
set { SetValue(SeparatorColorProperty, value); }
|
|
|
|
|
}
|
|
|
|
|
|
2016-05-13 04:30:02 +03:00
|
|
|
|
public int EstimatedRowHeight { get; set; }
|
2016-07-05 05:31:15 +03:00
|
|
|
|
public bool NoHeader { get; set; }
|
|
|
|
|
public bool NoFooter { get; set; }
|
2016-07-03 09:57:09 +03:00
|
|
|
|
|
|
|
|
|
protected override SizeRequest OnSizeRequest(double widthConstraint, double heightConstraint)
|
|
|
|
|
{
|
2016-07-06 02:07:56 +03:00
|
|
|
|
if(!VerticalOptions.Expands)
|
2016-07-03 09:57:09 +03:00
|
|
|
|
{
|
|
|
|
|
var reflectionService = Resolver.Resolve<IReflectionService>();
|
|
|
|
|
var baseBaseOnSizeRequest = reflectionService.GetVisualElementOnSizeRequest(this);
|
|
|
|
|
return baseBaseOnSizeRequest(widthConstraint, heightConstraint);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return base.OnSizeRequest(widthConstraint, heightConstraint);
|
|
|
|
|
}
|
2016-05-12 07:09:06 +03:00
|
|
|
|
}
|
|
|
|
|
}
|