mirror of
https://github.com/bitwarden/mobile
synced 2025-12-15 07:43:37 +00: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:
committed by
Kyle Spearrin
parent
41efa96291
commit
592c7951df
@@ -49,7 +49,8 @@ namespace Bit.UWP
|
|||||||
var assembliesToInclude = new List<Assembly>()
|
var assembliesToInclude = new List<Assembly>()
|
||||||
{
|
{
|
||||||
typeof(CachedImage).GetTypeInfo().Assembly,
|
typeof(CachedImage).GetTypeInfo().Assembly,
|
||||||
typeof(CachedImageRenderer).GetTypeInfo().Assembly
|
typeof(CachedImageRenderer).GetTypeInfo().Assembly,
|
||||||
|
typeof(Controls.ExtendedTableViewRenderer).GetTypeInfo().Assembly
|
||||||
};
|
};
|
||||||
Xamarin.Forms.Forms.Init(e, assembliesToInclude);
|
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">
|
<Compile Include="App.xaml.cs">
|
||||||
<DependentUpon>App.xaml</DependentUpon>
|
<DependentUpon>App.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Controls\ExtendedTableViewRenderer.cs" />
|
||||||
<Compile Include="IconConverter.cs" />
|
<Compile Include="IconConverter.cs" />
|
||||||
<Compile Include="MainPage.xaml.cs">
|
<Compile Include="MainPage.xaml.cs">
|
||||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||||
|
|||||||
Reference in New Issue
Block a user