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 ???
xamarin.forms
add a comment |
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 ???
xamarin.forms
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
add a comment |
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 ???
xamarin.forms
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
xamarin.forms
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
add a comment |
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
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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