Support UWP
Hi, Your GridSplitter is exactly what i need, unfortunatly UWP is not supported. Is there a simple way to change winphone to uwp ?
I think so yes. What are you trying to build exactly?
My application is on Android and UWP, and i have two view on a page, the user want to expand one view to see all the information in this view
Do you need to actually drag the splitter?
Yes
A very simple solution is to use a custom renderer for UWP, because Grid is available on UWP. YOu need to figure how to get the XF views in the UWP Grid control. Or, if you can wait few weeks (around 2 weeks ) I have a better solution
I can wait. Thank you for your answer
I ported the WinPhone renderer to the following UWP code. Seems to work as expected but haven't done any thorough testing
public class GridSplitterRenderer : VisualElementRenderer<GridSplitter, Control>
{
private Point? _lastPt;
protected override void OnElementChanged(ElementChangedEventArgs<GridSplitter> e)
{
if (e.OldElement != null)
{
PointerPressed -= GridSplitterRenderer_PointerPressed;
PointerReleased -= GridSplitterRenderer_PointerReleased;
PointerMoved -= GridSplitterRenderer_PointerMoved;
}
if (e.NewElement != null)
{
PointerPressed += GridSplitterRenderer_PointerPressed;
PointerReleased += GridSplitterRenderer_PointerReleased;
PointerMoved += GridSplitterRenderer_PointerMoved;
}
}
private void GridSplitterRenderer_PointerMoved(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
if (_lastPt != null)
{
var point = e.GetCurrentPoint(null).Position;
(Element as GridSplitter).UpdateGrid(point.X - _lastPt.Value.X, point.Y - _lastPt.Value.Y);
_lastPt = point;
}
}
private void GridSplitterRenderer_PointerReleased(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
_lastPt = null;
}
private void GridSplitterRenderer_PointerPressed(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e)
{
_lastPt = e.GetCurrentPoint(null).Position;
this.CapturePointer(e.Pointer);
}
}
@QuentinDosSantos Sorry but I haven't got time to do this and I don't think I will have soon.
thx fisboger, so far this works perfect for me. and thank you Andre, perfect work!