Get LayoutBound of custom control in ListView Xamarin











up vote
0
down vote

favorite












I have control MoreOption (use SkiaSharp draw ). I use it at ListView . Every row of ListView have 1 MoreOption . When i clicked, it show popup (Update, Delete) . I use TapGestureRecognizer_Tapped to get position at row has chosen , but I can't get it's position .
Result : i want show popup at MoreOption's position when i clicked.



enter image description here



Here's code:



Inside ListView.xaml



<ViewCell>
<AbsoluteLayout>
<Label Text="{Binding ID , StringFormat='{0:D3}'}" AbsoluteLayout.LayoutBounds="0,0.5,0.75,1"
VerticalTextAlignment="Center"
FontAttributes="Bold" AbsoluteLayout.LayoutFlags="All"/>
<Label Text="{Binding FullName}"
VerticalTextAlignment="Center" AbsoluteLayout.LayoutBounds="0.4,0.5,0.75,2" AbsoluteLayout.LayoutFlags="All"
FontAttributes="Bold" FontSize="20"
TextColor="{Binding Number, Converter={StaticResource ColorConverter}}"/>
<AbsoluteLayout AbsoluteLayout.LayoutBounds="1.84,0.5,0.5,0.5" AbsoluteLayout.LayoutFlags="All">
<AbsoluteLayout.GestureRecognizers>
<TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped" NumberOfTapsRequired="1"></TapGestureRecognizer>
</AbsoluteLayout.GestureRecognizers>
<controls:MoreOption />
</AbsoluteLayout>
</AbsoluteLayout>
</ViewCell>


Inside MoreOption.xaml :



<AbsoluteLayout VerticalOptions="FillAndExpand">
<skia:SKCanvasView x:Name="canvasView" AbsoluteLayout.LayoutBounds="0,0,0.075,0.1"
PaintSurface="OnCanvasViewPaintSurface"
AbsoluteLayout.LayoutFlags="All"/>

<skia:SKCanvasView x:Name="canvasView1" AbsoluteLayout.LayoutBounds="0,0.045,0.075,0.1"
PaintSurface="OnCanvasViewPaintSurface"
AbsoluteLayout.LayoutFlags="All" />

<skia:SKCanvasView x:Name="canvasView2" AbsoluteLayout.LayoutBounds="0,0.09,0.075,0.1"
PaintSurface="OnCanvasViewPaintSurface"
AbsoluteLayout.LayoutFlags="All" />
</AbsoluteLayout>


Inside ListUser.xaml.cs :



 private void TapGestureRecognizer_Tapped(object sender,TappedEventArgs e,Point p)
{
ContentPage Page = Application.Current.MainPage.Navigation.NavigationStack.LastOrDefault() as ContentPage;
var popuppage = new MenuMoreOptions(); popuppage.Layout(new Rectangle(p, new Size(50, 100)));
Page.Content.Navigation.PushPopupAsync(popuppage);
}


Inside MenuMoreOptions.xaml :



<AbsoluteLayout x:Name="MenuOptions" IsEnabled="{Binding Editable}" Margin="100,200"
BackgroundColor="Aqua">
<StackLayout Orientation="Vertical">
<Button BackgroundColor="Transparent" Text="Update"/>
<Button BackgroundColor="Transparent" Text="Delete"/>
</StackLayout>
</AbsoluteLayout>


Have any way resolve this issue ???










share|improve this question
























  • You can refer to:stackoverflow.com/questions/43186122/….
    – jack Hua
    Nov 12 at 9:07










  • Thanks. I have read MR.Getsure but it licensed . I research about Custom Renderer on every platform, But i can't find custom renderer of TapGestureRecognizer . Do you have any Ebook about Custom renderer of TapGestureRecognizer ? i want use control myseft without licensed . Thanks so much
    – Tân Võ Hoàng
    Nov 13 at 8:06















up vote
0
down vote

favorite












I have control MoreOption (use SkiaSharp draw ). I use it at ListView . Every row of ListView have 1 MoreOption . When i clicked, it show popup (Update, Delete) . I use TapGestureRecognizer_Tapped to get position at row has chosen , but I can't get it's position .
Result : i want show popup at MoreOption's position when i clicked.



enter image description here



Here's code:



Inside ListView.xaml



<ViewCell>
<AbsoluteLayout>
<Label Text="{Binding ID , StringFormat='{0:D3}'}" AbsoluteLayout.LayoutBounds="0,0.5,0.75,1"
VerticalTextAlignment="Center"
FontAttributes="Bold" AbsoluteLayout.LayoutFlags="All"/>
<Label Text="{Binding FullName}"
VerticalTextAlignment="Center" AbsoluteLayout.LayoutBounds="0.4,0.5,0.75,2" AbsoluteLayout.LayoutFlags="All"
FontAttributes="Bold" FontSize="20"
TextColor="{Binding Number, Converter={StaticResource ColorConverter}}"/>
<AbsoluteLayout AbsoluteLayout.LayoutBounds="1.84,0.5,0.5,0.5" AbsoluteLayout.LayoutFlags="All">
<AbsoluteLayout.GestureRecognizers>
<TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped" NumberOfTapsRequired="1"></TapGestureRecognizer>
</AbsoluteLayout.GestureRecognizers>
<controls:MoreOption />
</AbsoluteLayout>
</AbsoluteLayout>
</ViewCell>


Inside MoreOption.xaml :



<AbsoluteLayout VerticalOptions="FillAndExpand">
<skia:SKCanvasView x:Name="canvasView" AbsoluteLayout.LayoutBounds="0,0,0.075,0.1"
PaintSurface="OnCanvasViewPaintSurface"
AbsoluteLayout.LayoutFlags="All"/>

<skia:SKCanvasView x:Name="canvasView1" AbsoluteLayout.LayoutBounds="0,0.045,0.075,0.1"
PaintSurface="OnCanvasViewPaintSurface"
AbsoluteLayout.LayoutFlags="All" />

<skia:SKCanvasView x:Name="canvasView2" AbsoluteLayout.LayoutBounds="0,0.09,0.075,0.1"
PaintSurface="OnCanvasViewPaintSurface"
AbsoluteLayout.LayoutFlags="All" />
</AbsoluteLayout>


Inside ListUser.xaml.cs :



 private void TapGestureRecognizer_Tapped(object sender,TappedEventArgs e,Point p)
{
ContentPage Page = Application.Current.MainPage.Navigation.NavigationStack.LastOrDefault() as ContentPage;
var popuppage = new MenuMoreOptions(); popuppage.Layout(new Rectangle(p, new Size(50, 100)));
Page.Content.Navigation.PushPopupAsync(popuppage);
}


Inside MenuMoreOptions.xaml :



<AbsoluteLayout x:Name="MenuOptions" IsEnabled="{Binding Editable}" Margin="100,200"
BackgroundColor="Aqua">
<StackLayout Orientation="Vertical">
<Button BackgroundColor="Transparent" Text="Update"/>
<Button BackgroundColor="Transparent" Text="Delete"/>
</StackLayout>
</AbsoluteLayout>


Have any way resolve this issue ???










share|improve this question
























  • You can refer to:stackoverflow.com/questions/43186122/….
    – jack Hua
    Nov 12 at 9:07










  • Thanks. I have read MR.Getsure but it licensed . I research about Custom Renderer on every platform, But i can't find custom renderer of TapGestureRecognizer . Do you have any Ebook about Custom renderer of TapGestureRecognizer ? i want use control myseft without licensed . Thanks so much
    – Tân Võ Hoàng
    Nov 13 at 8:06













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have control MoreOption (use SkiaSharp draw ). I use it at ListView . Every row of ListView have 1 MoreOption . When i clicked, it show popup (Update, Delete) . I use TapGestureRecognizer_Tapped to get position at row has chosen , but I can't get it's position .
Result : i want show popup at MoreOption's position when i clicked.



enter image description here



Here's code:



Inside ListView.xaml



<ViewCell>
<AbsoluteLayout>
<Label Text="{Binding ID , StringFormat='{0:D3}'}" AbsoluteLayout.LayoutBounds="0,0.5,0.75,1"
VerticalTextAlignment="Center"
FontAttributes="Bold" AbsoluteLayout.LayoutFlags="All"/>
<Label Text="{Binding FullName}"
VerticalTextAlignment="Center" AbsoluteLayout.LayoutBounds="0.4,0.5,0.75,2" AbsoluteLayout.LayoutFlags="All"
FontAttributes="Bold" FontSize="20"
TextColor="{Binding Number, Converter={StaticResource ColorConverter}}"/>
<AbsoluteLayout AbsoluteLayout.LayoutBounds="1.84,0.5,0.5,0.5" AbsoluteLayout.LayoutFlags="All">
<AbsoluteLayout.GestureRecognizers>
<TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped" NumberOfTapsRequired="1"></TapGestureRecognizer>
</AbsoluteLayout.GestureRecognizers>
<controls:MoreOption />
</AbsoluteLayout>
</AbsoluteLayout>
</ViewCell>


Inside MoreOption.xaml :



<AbsoluteLayout VerticalOptions="FillAndExpand">
<skia:SKCanvasView x:Name="canvasView" AbsoluteLayout.LayoutBounds="0,0,0.075,0.1"
PaintSurface="OnCanvasViewPaintSurface"
AbsoluteLayout.LayoutFlags="All"/>

<skia:SKCanvasView x:Name="canvasView1" AbsoluteLayout.LayoutBounds="0,0.045,0.075,0.1"
PaintSurface="OnCanvasViewPaintSurface"
AbsoluteLayout.LayoutFlags="All" />

<skia:SKCanvasView x:Name="canvasView2" AbsoluteLayout.LayoutBounds="0,0.09,0.075,0.1"
PaintSurface="OnCanvasViewPaintSurface"
AbsoluteLayout.LayoutFlags="All" />
</AbsoluteLayout>


Inside ListUser.xaml.cs :



 private void TapGestureRecognizer_Tapped(object sender,TappedEventArgs e,Point p)
{
ContentPage Page = Application.Current.MainPage.Navigation.NavigationStack.LastOrDefault() as ContentPage;
var popuppage = new MenuMoreOptions(); popuppage.Layout(new Rectangle(p, new Size(50, 100)));
Page.Content.Navigation.PushPopupAsync(popuppage);
}


Inside MenuMoreOptions.xaml :



<AbsoluteLayout x:Name="MenuOptions" IsEnabled="{Binding Editable}" Margin="100,200"
BackgroundColor="Aqua">
<StackLayout Orientation="Vertical">
<Button BackgroundColor="Transparent" Text="Update"/>
<Button BackgroundColor="Transparent" Text="Delete"/>
</StackLayout>
</AbsoluteLayout>


Have any way resolve this issue ???










share|improve this question















I have control MoreOption (use SkiaSharp draw ). I use it at ListView . Every row of ListView have 1 MoreOption . When i clicked, it show popup (Update, Delete) . I use TapGestureRecognizer_Tapped to get position at row has chosen , but I can't get it's position .
Result : i want show popup at MoreOption's position when i clicked.



enter image description here



Here's code:



Inside ListView.xaml



<ViewCell>
<AbsoluteLayout>
<Label Text="{Binding ID , StringFormat='{0:D3}'}" AbsoluteLayout.LayoutBounds="0,0.5,0.75,1"
VerticalTextAlignment="Center"
FontAttributes="Bold" AbsoluteLayout.LayoutFlags="All"/>
<Label Text="{Binding FullName}"
VerticalTextAlignment="Center" AbsoluteLayout.LayoutBounds="0.4,0.5,0.75,2" AbsoluteLayout.LayoutFlags="All"
FontAttributes="Bold" FontSize="20"
TextColor="{Binding Number, Converter={StaticResource ColorConverter}}"/>
<AbsoluteLayout AbsoluteLayout.LayoutBounds="1.84,0.5,0.5,0.5" AbsoluteLayout.LayoutFlags="All">
<AbsoluteLayout.GestureRecognizers>
<TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped" NumberOfTapsRequired="1"></TapGestureRecognizer>
</AbsoluteLayout.GestureRecognizers>
<controls:MoreOption />
</AbsoluteLayout>
</AbsoluteLayout>
</ViewCell>


Inside MoreOption.xaml :



<AbsoluteLayout VerticalOptions="FillAndExpand">
<skia:SKCanvasView x:Name="canvasView" AbsoluteLayout.LayoutBounds="0,0,0.075,0.1"
PaintSurface="OnCanvasViewPaintSurface"
AbsoluteLayout.LayoutFlags="All"/>

<skia:SKCanvasView x:Name="canvasView1" AbsoluteLayout.LayoutBounds="0,0.045,0.075,0.1"
PaintSurface="OnCanvasViewPaintSurface"
AbsoluteLayout.LayoutFlags="All" />

<skia:SKCanvasView x:Name="canvasView2" AbsoluteLayout.LayoutBounds="0,0.09,0.075,0.1"
PaintSurface="OnCanvasViewPaintSurface"
AbsoluteLayout.LayoutFlags="All" />
</AbsoluteLayout>


Inside ListUser.xaml.cs :



 private void TapGestureRecognizer_Tapped(object sender,TappedEventArgs e,Point p)
{
ContentPage Page = Application.Current.MainPage.Navigation.NavigationStack.LastOrDefault() as ContentPage;
var popuppage = new MenuMoreOptions(); popuppage.Layout(new Rectangle(p, new Size(50, 100)));
Page.Content.Navigation.PushPopupAsync(popuppage);
}


Inside MenuMoreOptions.xaml :



<AbsoluteLayout x:Name="MenuOptions" IsEnabled="{Binding Editable}" Margin="100,200"
BackgroundColor="Aqua">
<StackLayout Orientation="Vertical">
<Button BackgroundColor="Transparent" Text="Update"/>
<Button BackgroundColor="Transparent" Text="Delete"/>
</StackLayout>
</AbsoluteLayout>


Have any way resolve this issue ???







xamarin.forms






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 9 at 7:43

























asked Nov 9 at 7:36









Tân Võ Hoàng

11




11












  • You can refer to:stackoverflow.com/questions/43186122/….
    – jack Hua
    Nov 12 at 9:07










  • Thanks. I have read MR.Getsure but it licensed . I research about Custom Renderer on every platform, But i can't find custom renderer of TapGestureRecognizer . Do you have any Ebook about Custom renderer of TapGestureRecognizer ? i want use control myseft without licensed . Thanks so much
    – Tân Võ Hoàng
    Nov 13 at 8:06


















  • You can refer to:stackoverflow.com/questions/43186122/….
    – jack Hua
    Nov 12 at 9:07










  • Thanks. I have read MR.Getsure but it licensed . I research about Custom Renderer on every platform, But i can't find custom renderer of TapGestureRecognizer . Do you have any Ebook about Custom renderer of TapGestureRecognizer ? i want use control myseft without licensed . Thanks so much
    – Tân Võ Hoàng
    Nov 13 at 8:06
















You can refer to:stackoverflow.com/questions/43186122/….
– jack Hua
Nov 12 at 9:07




You can refer to:stackoverflow.com/questions/43186122/….
– jack Hua
Nov 12 at 9:07












Thanks. I have read MR.Getsure but it licensed . I research about Custom Renderer on every platform, But i can't find custom renderer of TapGestureRecognizer . Do you have any Ebook about Custom renderer of TapGestureRecognizer ? i want use control myseft without licensed . Thanks so much
– Tân Võ Hoàng
Nov 13 at 8:06




Thanks. I have read MR.Getsure but it licensed . I research about Custom Renderer on every platform, But i can't find custom renderer of TapGestureRecognizer . Do you have any Ebook about Custom renderer of TapGestureRecognizer ? i want use control myseft without licensed . Thanks so much
– Tân Võ Hoàng
Nov 13 at 8:06

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53221522%2fget-layoutbound-of-custom-control-in-listview-xamarin%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53221522%2fget-layoutbound-of-custom-control-in-listview-xamarin%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Schultheiß

Verwaltungsgliederung Dänemarks

Liste der Kulturdenkmale in Wilsdruff