Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all 81910 articles
Browse latest View live

Manual Page Navigation Displays Page Incorrectly

$
0
0

Some of the pages in my Xamarin app are tabbed pages - navigation between these pages (using the tabs) works perfectly.

However, some of my pages are not accessible via the tabs, for example, I am displaying a list of items, and clicking on one of the items take you to a detail page for the list item that was clicked. This is handled in the cs code behind for the list page, and navigation is triggered using this:

await Navigation.PushAsync(new DetailPage(DetailPageViewModel)); 

This works, in that it does take you to the detail page, but the page is cut off, and only the lower part of the detail page can be seen - the top half of the page is not displayed and cannot be scrolled to. It only seems to be a problem with iOS, Android does not show the same issue.

Is this a known bug, or am I doing something wrong?

I'm using Xamarin Forms 4.1.0.581479


Error using MySql connector with Xamarin

$
0
0

Hi,

I am trying to use MySql plugin in Xamarin project.

I have added the pliugin to all my PCL projects and the used:

sql_connection = new MySqlConnection("Server=mysql.mydomain.com; Database=mydb; Uid=myuser; Pwd=mypassword;");

try
{
    sql_connection.Open();
}
catch (MySqlException ex)
{
    DisplayAlert("Error", ex.Message, "Ok");
}

but I am getting below error:

System.TypeInitializationException: The type initializer for 'MySql.Data.MySqlClient.Replication.ReplicationManager' threw an exception. ---> System.TypeInitializationException: The type initializer for 'MySql.Data.MySqlClient.MySqlConfiguration' threw an exception. ---> System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.Configuration.ClientConfigPaths..ctor (System.String exePath, System.Boolean includeUserConfig) [0x00050] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
at System.Configuration.ClientConfigPaths.GetPaths (System.String exePath, System.Boolean includeUserConfig) [0x00018] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
at System.Configuration.ClientConfigurationHost.get_ConfigPaths () [0x0000a] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
at System.Configuration.ClientConfigurationHost.GetStreamName (System.String configPath) [0x0006d] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
at System.Configuration.ClientConfigurationHost.get_IsAppConfigHttp () [0x00000] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
at System.Configuration.Internal.DelegatingConfigHost.get_IsAppConfigHttp () [0x00006] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
at System.Configuration.ClientConfigurationSystem..ctor () [0x00051] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
at System.Configuration.ConfigurationManager.EnsureConfigurationSystem () [0x00024] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationManager.EnsureConfigurationSystem () [0x00060] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
at System.Configuration.ConfigurationManager.PrepareConfigSystem () [0x0000a] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x0000a] in <4cd8a957e7664f4a9e27ce43dd1afeb7>:0
at MySql.Data.MySqlClient.MySqlConfiguration..cctor () [0x00000] in <575e720ed6c440559324a6291091586f>:0
--- End of inner exception stack trace ---
at MySql.Data.MySqlClient.Replication.ReplicationManager..cctor () [0x0001e] in <575e720ed6c440559324a6291091586f>:0
--- End of inner exception stack trace ---
at MySql.Data.MySqlClient.MySqlConnection.Open () [0x000b9] in <575e720ed6c440559324a6291091586f>:0

After creating nuget package dependency service not working in Xamarin forms project.

$
0
0

hi,

I have created a xamarin app to play audio from project folder and created app using dependency service play the audio file then it's working fine.
And I have create nuget package using the same source code but dependency service not working via configuring the created nuget package i have attached my entire source here.Any one kindly review it and help me how fix this.

use below link to download the file

Create a library to play the audio using dependency service. find the below link to download the source

https://drive.google.com/open?id=1amiuXEZ_QvxRHD4TmzEFKkPTs8Z-5e1O

sample create by using nuget package what i have developed.find the below link to download the source

https://drive.google.com/open?id=1I62ubkfnAMPDJLwpK5ZDRhlXg5abcIRS

thanks in advance

Why won't my label wrap text on iOS?

$
0
0

I am trying to make a label wrap inside of the Master page of a MasterDetail page. I thought it was the default behavior to wrap labels, but just in case I even made a custom renderer. I have confirmed that the custom renderer works (through debugging and adding a background to the label), so I assume there is something easy that I am missing. Can anybody take a look at my xaml and give me an idea why this label is not wrapping?

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MyApp.Pages.NavigationDrawer.NavigationMenuMasterPage"
             xmlns:statics="clr-namespace:MyApp.Statics;assembly=MyApp"
             xmlns:multi="clr-namespace:MyApp.Pages.NavigationDrawer;assembly=MyApp"
             Title="Navigation drawer"
             Icon="hamburger.png"
             BackgroundColor="White">
    <ContentPage.Content>
        <StackLayout VerticalOptions="FillAndExpand" HorizontalOptions="Center" Margin="0, 25, 0, 0">
            <StackLayout Orientation="Horizontal" HorizontalOptions="Center">
                <Image x:Name="connectionStatusImage" />
                <Label x:Name="connectionStatusText"  Margin="16, 0, 16, 0" YAlign="Center" FontSize="Medium"/>
            </StackLayout>
            <Label x:Name="changeConnectionStatusButton" TextColor="{x:Static statics:Palette.Orange}" XAlign="Center" FontAttributes="Bold" >
                <Label.GestureRecognizers>
                    <TapGestureRecognizer Tapped="ChangeConnectionStatusClicked" NumberOfTapsRequired="1" />
                </Label.GestureRecognizers>
            </Label>
            <StackLayout x:Name="SyncStatusStack" Orientation="Horizontal" Margin="0, 16, 16, 0" VerticalOptions="Center" >
                <multi:MultiLineLabel x:Name="syncStatusText" MinimumWidthRequest="0" Margin="16, 0, 0, 0" Text="I want to write a really long string to see if it wraps" />
                <Label x:Name="syncButton" MinimumWidthRequest="40" Text="SYNC" FontAttributes="Bold" YAlign="Center" HorizontalOptions="End" >
                    <Label.GestureRecognizers>
                        <TapGestureRecognizer x:Name="SyncGestureRecognizer" NumberOfTapsRequired="1" />
                    </Label.GestureRecognizers>
                </Label>
            </StackLayout>
            <StackLayout x:Name="SyncStack" Orientation="Vertical" HorizontalOptions="Center" Margin="0, 16, 0, 0">
                <ActivityIndicator x:Name="syncingIndicator"  Margin="16, 0, 32, 0"/>
                <Label x:Name="syncingText" />
            </StackLayout>
            <ListView x:Name="menuListView" VerticalOptions="FillAndExpand" SeparatorVisibility="None" Margin="0, 16, 0, 0">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <TextCell Text="{Binding Title}" TextColor="{x:Static statics:Palette.PrimaryText}" />
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </StackLayout>
    </ContentPage.Content>
</ContentPage>

And my (most likely unnecessary) custom label renderer:

using MyApp.iOS.Renderers;
using MyApp.Pages.NavigationDrawer;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;

[assembly: ExportRenderer(typeof(MultiLineLabel), typeof(MultiLineLabeliOSRenderer))]
namespace MyApp.iOS.Renderers
{
    public class MultiLineLabeliOSRenderer : LabelRenderer
    {
        protected override void OnElementChanged(ElementChangedEventArgs<Label> e)
        {
            base.OnElementChanged(e);

            if (Control == null) return;

            Control.LineBreakMode = UIKit.UILineBreakMode.WordWrap;
            Control.Lines = 0;            
        }
    }
}

Shell Styling for Title Bar not working

$
0
0

I generated a new shell app in Visual Studio Community 2019, which gave me an App.Shell.xaml file containing some styling, like this:

<ResourceDictionary>
        <Style x:Key="ShellStyle" TargetType="Element">
            <Setter Property="Shell.TitleColor" Value="Fuchsia" />
            <Setter Property="Shell.BackgroundColor" Value="Green" />
            <Setter Property="Shell.ForegroundColor" Value="Yellow" />
            <Setter Property="Shell.TitleColor" Value="Red" />
            <Setter Property="Shell.DisabledColor" Value="#B4FFFFFF" />
            <Setter Property="Shell.UnselectedColor" Value="Grey" />
            <Setter Property="Shell.TabBarBackgroundColor" Value="Blue" />
            <Setter Property="Shell.TabBarForegroundColor" Value="Indigo" />
            <Setter Property="Shell.TabBarUnselectedColor" Value="Lime" />
            <Setter Property="Shell.TabBarTitleColor" Value="Teal" />
        </Style>
        <Style TargetType="ShellItem" BasedOn="{StaticResource ShellStyle}" />
    </ResourceDictionary>

Those weren't the default colours by the way...

Anyway, none of those styles were being applied to the shell items (the bar right at the top of the app, or the tab bar at the bottom. The title is displayed at the top, and the tabs at the bottom, they just didn't have the above styling.

I managed to fix the tab bar, by adding some new styles to the resource dictionary:

<Style x:Key="TabStyle" TargetType="TabBar">
    <Setter Property="Shell.TabBarBackgroundColor" Value="Teal" />
    <Setter Property="Shell.TabBarUnselectedColor" Value="Silver" />
    <Setter Property="Shell.TabBarTitleColor" Value="Fuchsia" />
</Style>

Then I just applied the style to the TabBar in the usual way:

<TabBar Style="{StaticResource TabStyle}">
    ...
</TabBar>

This works perfectly and the styling is applied to the tab bar at the bottom. Unfortunately, I cannot get any styling to work for the top bar of the app. None of the styles like Shell.TitleColor or Shell.BackgroundColor have any effect on the app whatsoever, and unlike with the TabBar, I don't have a <TitleBar> or any element to manually add styles to.

I did think about hiding the shell top bar, and using my own one instead, but I guess with this approach, I would then have to handle navigating back to previous pages.

What's the recommendation here? Why isn't the shell styling working as this page says it should: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/shell/configuration#set-page-colors ??

I'm using Xamarin Forms 4.1.0.581479

How To Use Xamarin.Forms To Use Datalogic Android SDK

$
0
0

Hello.

I need to develop an application for Datalogic Memor 1 device (Handheld device that has android oreo and 1d laser integrated barcode scanner.)

They have a tutorial to use SDK with Xamarin. datalogic.github.io/xamarin/quick-start/

But their sample is Xamarin.Android project, not Xamarin.Forms. Is it possible to use barcode scanning feature from Xamarin.Forms only ? How can i integrate that to Xamarin.Forms?

How can i detect key events in xamarin.forms?

$
0
0

Is there any way to detect key events from a physical keyboard on UWP project?, or its posible to create a custom renderer and assign "onkeydown event" to it?

OnIdiom in a ResourceDictionnary isn't working with all types

$
0
0

Hi,
I'm currently having a little problem understanding how OnIdiom works sometimes
In my Application Resources i have this :

            <x:Double x:Key="GlobalHeight">
                <OnIdiom x:TypeArguments="x:Double" Tablet="44" Phone="88"/>
            </x:Double>

But this doesn't work and it is rendered as if the size was null the problem is that it is working here

            <Setter Property="FontSize">
                <Setter.Value>
                    <OnIdiom x:TypeArguments="x:Double" Phone="12" Tablet="15"/>
                </Setter.Value>
            </Setter>

I'm calling it like this

<StackLayout HeightRequest="{StaticResource GlobalHeight}">

Is there a way to make OnIdiom work on a Double in a ResourceDictionary ?


Appium tests (iOS) can't see automation Ids on model\dialog

$
0
0

Hi,

We are using Appium to test our app but we can't see all elements inside a modal or dialog popup and the dialog itself.

Any way to make the dialog visible?

Why i am getting Newtonsoft.Json.JsonSerializationException in xamarin android while release time?

$
0
0

android.runtime.JavaProxyThrowable: Newtonsoft.Json.JsonSerializationException: Unable to find a constructor to use for type Model class.

A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path 'status', line 1, position 10.
[AndroidRuntime] at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateNewObject (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonObjectContract objectContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, Newtonsoft.Json.Serialization.JsonProperty containerProperty, System.String id, System.Boolean& createdFromNonDefaultCreator) [0x000d5] in <7ead8a5d25b446818eaba4cd3ba7f8d1>:0
[AndroidRuntime] at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x00148] in <7ead8a5d25b446818eaba4cd3ba7f8d1>:0
[AndroidRuntime] at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x0006d] in <7ead8a5d25b446818eaba4cd3ba7f8d1>:0
[AndroidRuntime] at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent) [0x000db] in <7ead8a5d25b446818eaba4cd3ba7f8d1>:0
[AndroidRuntime] at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00054] in <7ead8a5d25b446818eaba4cd3ba7f8d1>:0
[AndroidRuntime] at Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in <7ead8a5d25b446818eaba4cd3ba7f8d1>:0

Can you please suggest me for this issue? While debug time its working fine but, when its getting release APK only?

Android Release APK for 64-bit support crashing after API call

$
0
0

Android 64-bit support working properly in debug mode. When we create it in released after API call app get crashed

We are using Visual Studio 2019.

How to bind dictionary to a Listview item source

$
0
0

Hi I have Listview shown below.
How can I bind dictionary to Listview Itemsource so that my label as key and ENtry has value

 <ListView x:Name="ItemsListView" VerticalOptions="FillAndExpand" SeparatorVisibility="None" HasUnevenRows="true" ItemsSource="{Binding dictionary}">
                            <ListView.ItemTemplate>
                                <DataTemplate>
                                    <ViewCell>
                                         <ViewCell.View>
                                        <StackLayout Style="{DynamicResource stackLayoutCommon}" Margin="15,20,20,20">
                                            <Grid>
                                                <Grid.RowDefinitions>
                                                    <RowDefinition Height="Auto" />
                                                </Grid.RowDefinitions>
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="*" />
                                                    <ColumnDefinition Width="0.5*" />
                                                </Grid.ColumnDefinitions>
                                                <Label " Grid.Row="1" Grid.Column="0" Style="{DynamicResource lblTitle}" />
                                              <Entry x:Name="test" Grid.Row="1" Grid.Column="1" />
                                            </Grid>
                                        </StackLayout>
                                            </ViewCell.View>
                                    </ViewCell>

                                </DataTemplate>
                            </ListView.ItemTemplate>
                        </ListView>

Please provide me source to create chat application

$
0
0

I am new in xamarin.
Please provide me source to create chat application

mscorlib conflict between versions

$
0
0

Hello

I have a Xamarin Forms Shared Project which can build and deploy without errors. However, the following build warning have appeared:

There was a conflict between "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e".
1> No way to resolve conflict between "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Choosing "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.

The build warning seems to have appeared after updating Visual Studio and I cannot get rid of it.
I have tried cleaning the project, removing bin folder, .vs folder and building a new project with the same dependencies but that does not replicate the warning.

I have found other posts with a similar issue to this but I do not know if those problems are related:
https://developercommunity.visualstudio.com/content/problem/45257/no-way-to-resolve-conflict-between-mscorlib-versio.html
https://forums.xamarin.com/discussion/71781/how-to-get-rid-of-there-was-a-conflict-between-warnings-reported-between-different-packages
https://forums.xamarin.com/discussion/100868/mscorlib-version-2-0-5-0-vs-version-4-0-0-0#latest

I have the following versions:

Microsoft Visual Studio Enterprise 2017
Version 15.3.2
VisualStudio.15.Release/15.3.2+26730.10
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Enterprise

Architecture Diagrams and Analysis Tools 00369-60000-00001-AA938
Microsoft Architecture Diagrams and Analysis Tools

Visual Basic 2017 00369-60000-00001-AA938
Microsoft Visual Basic 2017

Visual C# 2017 00369-60000-00001-AA938
Microsoft Visual C# 2017

Visual F# 4.1 00369-60000-00001-AA938
Microsoft Visual F# 4.1

Application Insights Tools for Visual Studio Package 8.8.00712.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017 15.0.30726.0
ASP.NET and Web Tools 2017

ASP.NET Core Razor Language Services 1.0
Provides languages services for ASP.NET Core Razor.

ASP.NET Template Engine 2017 15.0.30726.0
ASP.NET Template Engine 2017

ASP.NET Web Frameworks and Tools 2017 5.2.50601.0
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 15.0.30728.0
Azure App Service Tools v3.0.0

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JavaScript Language Service 2.0
JavaScript Language Service

JetBrains ReSharper Ultimate 2017.1.3 Build 108.0.20170613.154143
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2017 JetBrains, Inc.

Merq 1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.50719.1

Microsoft Continuous Delivery Tools for Visual Studio 0.3
Simplifying the configuration of continuous build integration and continuous build delivery from within the Visual Studio IDE.

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Mono Debugging for Visual Studio 4.6.8-pre (ec7034f)
Support for debugging Mono processes with Visual Studio.

NuGet Package Manager 4.3.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

SQL Server Data Tools 15.1.61707.200
Microsoft SQL Server Data Tools

TypeScript 2.3.4.0
TypeScript tools for Visual Studio

Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Xamarin 4.6.0.299 (b63523e27)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK 7.4.0.21 (2851083)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK 10.12.0.20 (80b8487)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

I would like to know the cause of this, and if it is a serious problem that should be fixed?

I have attached the full warning

Thanks in advance :)

Using SkiaSharp for a real time graph

$
0
0

Hello,
I am currently building an application/library using Skiasharp which needs graphs. These graphs are updated each 4 ms with a new sample of data which is printed on the screen. I managed to make everything work but it is really slow.
1 second on my graph is actually 2 seconds in real life, it takes way longer than it should and I don't get why. I tried it with less frames and sample and I does everything fine up to 1 sample each 25 ms.

Does anyone know if this comes from Skiasharp because it can't refresh faster than 25ms ?
Does anyone know if there is a way to control the time Skiasharp takes to draw on the canvas ? To draw and update my graph I am using InvalidateSurface.

Thank you a lot for your help
Kind regards


Add border to Xamarin Pin Image

$
0
0

Hey guys, so I have menaged to add image as a custom pin. I am just wondering is there a way to make image "round" in code somehow or they are put there as they are in Drawable folder?
And is there a way to add bordrer to pin image somehow?

thx! :-)

CollectionView change default selected color

$
0
0

Hi, How can i do the custom render for a collection view selected cell like did for a listview ?

How to deal with locales in iOS that are not valid in .net?

$
0
0

Xamarin forms 3.4 (iOS)
I some cases the locale of the iOS is not valid for .net.
For example the locale returned from an iOS device can be en-BE or en-ES.
Because the returned locale (en-BE) is not valid in .net, I use a fallback which is en.
The problem is when an Entry control is bound to a decimal field and the Keyboard of the Entry is set to Numeric.
The soft keyboard that appears on the device has a comma , for decimal separator (coming for the BE part of the device culture) which is not valid for the fallback culture (en). As a result, the entry cannot accept decimals.
How can I solve this problem?

How to pass parameters to tapped event

$
0
0

Hi,

I am using the following Xamarin Code

<ListView ItemsSource="{Binding UserGroups}" RowHeight="66">
          <ListView.ItemTemplate>
            <DataTemplate>
              <ViewCell>
                <StackLayout Orientation="Horizontal" Spacing="10" Padding="10,10,10,10" TranslationX="10">
                  <Label
                    Text="{Binding Name}"
                    VerticalOptions="CenterAndExpand"  >
                    <Label.GestureRecognizers>
                      <TapGestureRecognizer  NumberOfTapsRequired="2" Tapped="OnEditGroupClicked" CommandParameter="{Binding Name}" />
                    </Label.GestureRecognizers>
                  </Label>
                 </StackLayout>
              </ViewCell>
            </DataTemplate>
          </ListView.ItemTemplate>
    </ListView>

Tapped event is firing, but sender and args are getting as unknown identifier, I am not able to figure out the issue

On Code behind file,

async void OnEditGroupClicked(object sender, EventArgs args)
{
// I want to access the Name
}

and sender and args are getting as unknown identifier

Can someone guide me the correct way to pass the parameter to tapped event

Thanks in Advance

Gesture Recognizer

$
0
0

Hi,
I'm currently trying to build a Forms UI using the collection view but however I have a problem with the gesture recognizer using android. In iOS all works fine the the events fires when tapping the BorderView (inside the collection view template) but on andoird the events get never fired and I dont know why. I've tried to use the InputTrasnparent Property but that doesnt chnage anything at all.

Here is my xaml code:

                <CollectionView ItemsSource="{Binding Studies}"
                                ItemSizingStrategy="MeasureFirstItem"
                                HeightRequest="200">
                    <CollectionView.ItemsLayout>
                        <GridItemsLayout Orientation="Vertical"
                                         Span="2" />
                    </CollectionView.ItemsLayout>
                    <CollectionView.ItemTemplate>
                        <DataTemplate>
                            <StackLayout Padding="10,0">
                                <xe:BorderView HeightRequest="80"
                                               CornerRadius="10"
                                               WidthRequest="50"
                                               BackgroundColor="White"
                                               xe:TouchEffect.Color="LightGray"
                                               Margin="0,10">
                                    <StackLayout Spacing="10"
                                                 Margin="12"
                                                 VerticalOptions="Center"
                                                 HorizontalOptions="Center">
                                        <Label Grid.Column="1"
                                               Text="{Binding Title}"
                                               FontAttributes="Bold"
                                               LineBreakMode="TailTruncation">
                                            <Label.Triggers>
                                                <MultiTrigger TargetType="Label">
                                                    <MultiTrigger.Conditions>
                                                        <BindingCondition Binding="{Binding Title}"
                                                                          Value="Add" />
                                                        <BindingCondition Binding="{Binding Team}"
                                                                          Value="System" />
                                                    </MultiTrigger.Conditions>
                                                    <Setter Property="TextColor"
                                                            Value="White" />
                                                    <Setter Property="Text"
                                                            Value="+" />
                                                    <Setter Property="FontSize"
                                                            Value="28" />
                                                </MultiTrigger>
                                            </Label.Triggers>
                                        </Label>
                                    </StackLayout>

                                    <xe:BorderView.Triggers>
                                        <MultiTrigger TargetType="xe:BorderView">
                                            <MultiTrigger.Conditions>
                                                <BindingCondition Binding="{Binding Title}"
                                                                  Value="Add" />
                                                <BindingCondition Binding="{Binding Team}"
                                                                  Value="System" />
                                            </MultiTrigger.Conditions>
                                            <Setter Property="BackgroundColor"
                                                    Value="{StaticResource LightGreen}" />
                                        </MultiTrigger>
                                    </xe:BorderView.Triggers>
                                    <xe:BorderView.GestureRecognizers>
                                        <TapGestureRecognizer
                                            Command="{Binding Command}"
                                            NumberOfTapsRequired="1" />
                                    </xe:BorderView.GestureRecognizers>
                                </xe:BorderView>
                            </StackLayout>
                        </DataTemplate>
                    </CollectionView.ItemTemplate>
                </CollectionView>

Does anyone has a ideas how to fix this problem?

Thanks,
Flo

Viewing all 81910 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>