mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 18:08:26 +03:00
UWP: Add a ExtendedTableViewRenderer (#260)
Add a base ExtendedTableViewRenderer we can use. Signed-off-by: Alistair Francis <alistair@alistair23.me>
This commit is contained in:
parent
41efa96291
commit
592c7951df
3 changed files with 31 additions and 1 deletions
|
@ -49,7 +49,8 @@ namespace Bit.UWP
|
|||
var assembliesToInclude = new List<Assembly>()
|
||||
{
|
||||
typeof(CachedImage).GetTypeInfo().Assembly,
|
||||
typeof(CachedImageRenderer).GetTypeInfo().Assembly
|
||||
typeof(CachedImageRenderer).GetTypeInfo().Assembly,
|
||||
typeof(Controls.ExtendedTableViewRenderer).GetTypeInfo().Assembly
|
||||
};
|
||||
Xamarin.Forms.Forms.Init(e, assembliesToInclude);
|
||||
|
||||
|
|
28
src/UWP/Controls/ExtendedTableViewRenderer.cs
Normal file
28
src/UWP/Controls/ExtendedTableViewRenderer.cs
Normal file
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using System.ComponentModel;
|
||||
using Bit.App.Controls;
|
||||
using Bit.UWP.Controls;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Platform.UWP;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
||||
|
||||
[assembly: ExportRenderer(typeof(ExtendedTableView), typeof(ExtendedTableViewRenderer))]
|
||||
namespace Bit.UWP.Controls
|
||||
{
|
||||
public class ExtendedTableViewRenderer : TableViewRenderer
|
||||
{
|
||||
public override SizeRequest GetDesiredSize(double widthConstraint, double heightConstraint)
|
||||
{
|
||||
var baseSize = new Size(Control.Width, Control.Height);
|
||||
|
||||
return new SizeRequest(new Size(baseSize.Width, baseSize.Height));
|
||||
}
|
||||
|
||||
protected override void OnElementChanged(ElementChangedEventArgs<TableView> e)
|
||||
{
|
||||
base.OnElementChanged(e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -95,6 +95,7 @@
|
|||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Controls\ExtendedTableViewRenderer.cs" />
|
||||
<Compile Include="IconConverter.cs" />
|
||||
<Compile Include="MainPage.xaml.cs">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
|
|
Loading…
Reference in a new issue