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

Is LinkedIn Xamarin Free?

$
0
0

I will use facebook login in xamarin forms project.

so find out Houssem Dellai's nuget.

in the Houssem Dellai's Video in Youtube, he used linkedin api.

If i use linkedin, have i payment the charge? orlinkedin is free?


Picker Renderer Affecting Behavior Without Any Additional Code

$
0
0

I was trying to apply a custom render to Picker when I realized the renderer affects the behavior of the Picker on Android platforms even without any additional code, i.e.

public class CustomPickerRenderer : PickerRenderer
{
    public CustomPickerRenderer(Context context) : base(context)
    {
    }
}

Without the renderer, the picker displays a full screen of options:

After renderer is applied, it looks like this:

Why is this the case and how can I apply a custom renderer while preserving the original behavior?

Set height in Toolbar xamarin froms

$
0
0

Hi i want to define Height in Toolbar, how hi can do this.

This is my code:

ContentPage.ToolbarItems >

<ToolbarItem Text="Botão 1" Clicked="OnClickButtonOne" Order="Secondary" />
<ToolbarItem Text="Botão 2" Clicked="OnClickButtonTwo" Order="Secondary" />
<ToolbarItem Text="Botão 3" Clicked="OnClickButtonThree" Order="Primary" Icon="cloud.png" />
<ToolbarItem Text="Botão 3" Clicked="OnClickButtonThree" Order="Primary" Icon="edit.png" />
<ToolbarItem Text="Botão 3" Clicked="OnClickButtonThree" Order="Primary" Icon="incomingmail" />
<ToolbarItem Text="Botão 3" Clicked="OnClickButtonThree" Order="Primary" Icon="list.png" />
<ToolbarItem Text="Botão 3" Clicked="OnClickButtonThree" Order="Primary" Icon="replayarrow.png" />
<ToolbarItem Text="Botão 3" Clicked="OnClickButtonThree" Order="Primary" Icon="settings.png" />
<ToolbarItem Text="Botão 3" Clicked="OnClickButtonThree" Order="Primary" Icon="signal.png" />
<ToolbarItem Text="Botão 3" Clicked="OnClickButtonThree" Order="Primary" Icon="search.png" />

</ContentPage.ToolbarItems>

Joining a bunch of controls

$
0
0

Sorry if this is a very basic question, but I don't know how is the name of the control or if I have to do a view, a subpage or a layout.

The point is that I have a bunch of controls (an entry, a delete button for the entry, and a listview) and variables that I want to encapsulate as a new control or something, to use with other pages once or more times. But I don't know what kind of element should I use to do it. If you could point me in the right way, I will do my researchs.

Also, I have to bind the listview with a list that can be one of the different models I have in my app, with different types of variables in it. Am I wrong or this is the time when I have to use a converter?

Thank you.

Silent remove of Page in Navigation Stack

$
0
0

Is there a way to move from one page to another but remove the last page I was on from the navigation stack.

For example

Page 1 > Page 2 > Page 3

As I move from Page 2 to Page 3, remove Page 2 from the navigation stack so when I go back it goes to page 1.

I know I can manually remove things from the navigation stack but it causes all kinds of weird animations when going back. Also if I do a Pop then a Push, it shows the animation on screen which I don't want.

So I am wondering if there is a way to remove it from the Stack silently, with no onscreen animations or quick flashes of the page etc visible to the user?

Real Time Vehicle Tracking Using Xamarin Forms

$
0
0

I am working on a task to track a vehicle (Cab)from mobile app which is to be built in Xamarin forms. Planning to Use GeoLocator plugin. Any ideas and suggestion how should i proceed.

I wish to show the vehicle moving on the map route when the user is actually tracking the ride.

How to get the best routes for a particular destination?

A device is installed in the vehicle which keeps sending the GPS Location.

Ideas and Suggestions are welcome.

How to edit and show code in Xamarin Forms

$
0
0

Hello
I would like to know how can we show Code in formatted way like we do in web pages and how to create a text area for editing code in Xamarin Forms, I am new to xamarin and xamarin forms
Thanks

SnackBar Issue

$
0
0

Hi , in my Xamarin forms app, when the user clicks on delete icon , I am showing a snackbar with the provision of undoing the deleted item. Now if I make the app go in sleep(background), change the language of device through settings , open the app and now when I click on delete button snackbar is not displayed.

Same is working fine for IOS and Xamarin android.

Any help is appreciated. TIA


how to disable the space occupied by the activity indicator in xamarin forms Mobile application?

$
0
0

how to disable the space occupied by the activity indicator in xamarin forms Mobile application?

Consuming REST services

$
0
0

What is the best method for consuming REST services which are locally deployed? I am specifically having issues with utilizing HTTPS for iOS. When calling the web service from iOS (the iPhoneSimlator), I receive a "TrustFailure" web exception. I think this is because the certificate used is self-signed (it's not secure because I am using my internal IP address and the certificate is issued for localhost) when using IIS Express. Does this mean I need to "publish" my API to IIS (or Azure) and use a valid certificate in order to consume the service? This seems like a lot of work for development, especially since I am creating the REST service and mobile application at the same time.

My development environment is:

I have reviewed this and this, but neither really touch on this issue. Any advice on a streamlined workflow would be much appreciated.

How to load records at the bottom of ListView/RepeatableStack dynamically when scrolls down?

$
0
0

I am working on Xamarin mobile app development. I am using RepeatableStack to display collection records on a CarouselPage. This is working fine, when i have less number of records.

But when i have huge number of records, the page gets stuck on load and takes few seconds. This gives bad user experience.

I would like load more records on the fly, when the user scrolls the list down to the bottom. I would like to load it, only when user scrolls down to the bottom. So that, the RepeatableStack will have less number of records when the page loads. Has any one resolved this scenario in Xamarin(C#)?

Xamarin.forms: Unable to connect to locally hosted web service.

$
0
0

Hi guys,
I've been trying to connect with web service deployed in my local (which is running in tomcat). And I'm deploying my project in Android device. As you can see in the code below that I've used my local PC's IP address. Also in Android Manifest file, I turned on the "INTERNET" permission. If I run this url directly in browser, I get expected result. Please note that I had to remove "http" from the code in order to post it here.

` public async Task<List> getHospitalsByCityAsync(string city)
{
List hospitals = null;

        string RestUrl = "192.168.15.100:8080/unsaarAPI/bismillah/city/" + city;
        var uri = new Uri(RestUrl);

        try
        {
            var response = await client.GetAsync(uri);
            if (response.IsSuccessStatusCode)
            {
                var content = await response.Content.ReadAsStringAsync();
                NswHospitalSearch nswHs = JsonConvert.DeserializeObject<NswHospitalSearch>(content);
                hospitals = nswHs.hospitals;
            }
        }
        catch (HttpRequestException e)
        {
            Debug.WriteLine(e.InnerException.Message);
        }
        catch (Exception ex)
        {
            Debug.WriteLine(@"              ERROR {0}", ex.Message);
        }
        return hospitals;
    }`

During debug, its doesn't reach at line if (response.IsSuccessStatusCode) and after a while I get
Error: ConnectFailure (Connection timed out)

I've no clue how to fix this. I've been surfing online many hours; but can't find a suitable solution.
Can any one help. I would really appreciate it.

Thanks.

Expandable ListView

$
0
0

i am new in xamarin forms and i need to make expendable list view by Populating data from web services
Thank you

How to create Background Service in xamarin forms ??

$
0
0

How to create background service in xamarin forms !! I create a task to meet my friend today at 10 am and close the app, remind before 10 minutes to the meeting time phone is ringing or vibrate.

XF vs PWA

$
0
0
Hi all! What's your thoughts about XF vs PWA? Will MS continue to Invest alot in XF, now that PWA might be a better way to fill the app-gap?

Data Binding In Grid View With Multiple Image Picker

$
0
0

Hi all,
I am uploaded multiple image with EClImagePicker but It Display Only First Image In My GridView.Cell In Rest Of My Cell. Is there any way to solve this type of error It helps me a lot.
I am getting source of all files with counter.

Thanks in advance.

App crashes on certain events

$
0
0

Hi guys,

I've written an app with a multi-page form in Xamarin Forums. Users complain about getting errors I can hardly reproduce. There's no way to test this while debugging.

HockeyApp gives me this error when they switch x times back and forth between the pages and then click on a button (and only a button), not a dropdown or other input fields. They render properly and I'm using the last version of Xamarin Forms.
Right now I'm only using Forms for Android, so I can only test this on Android.

<br /> Xamarin caused by: android.runtime.JavaProxyThrowable: System.ObjectDisposedException: Cannot access a disposed object.<br /> Object name: 'Xamarin.Forms.Platform.Android.Platform+DefaultRenderer'.<br /> Java.Interop.JniPeerMembers.AssertSelf(IJavaPeerable self)<bd30a18775d94dc8b6263aecd1ca9077>:0<br /> Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualVoidMethod(string encodedMember, IJavaPeerable self, JniArgumentValue* parameters)<bd30a18775d94dc8b6263aecd1ca9077>:0<br /> Android.Views.View.SetBackgroundColor(Color color)<9ab9faae1b4b4f0da28e7c4ac61e2c78>:0<br /> Xamarin.Forms.Platform.Android.VisualElementRenderer<TElement>.UpdateBackgroundColor()<8783e2b68568446a8522c36407e66253>:0<br /> Xamarin.Forms.Platform.Android.VisualElementRenderer<TElement>.OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)<8783e2b68568446a8522c36407e66253>:0<br /> <Module>.invoke_void_object_PropertyChangedEventArgs(object, PropertyChangedEventArgs)(wrapper delegate-invoke)<br /> Xamarin.Forms.BindableObject.OnPropertyChanged(string propertyName)<6e20d7af277949f4a7bb952d64b81cda>:0<br /> Xamarin.Forms.Element.OnPropertyChanged(string propertyName)<6e20d7af277949f4a7bb952d64b81cda>:0<br /> Xamarin.Forms.BindableObject.SetValueActual(BindableProperty property, BindableObject.BindablePropertyContext context, object value, bool currentlyApplying, BindableObject.SetValueFlags attributes, bool silent)<6e20d7af277949f4a7bb952d64b81cda>:0<br /> Xamarin.Forms.BindableObject.SetValueCore(BindableProperty property, object value, BindableObject.SetValueFlags attributes, BindableObject.SetValuePrivateFlags privateAttributes)<6e20d7af277949f4a7bb952d64b81cda>:0<br /> Xamarin.Forms.BindingExpression.ApplyCore(object sourceObject, BindableObject target, BindableProperty property, bool fromTarget)<6e20d7af277949f4a7bb952d64b81cda>:0<br /> Xamarin.Forms.BindingExpression.Apply(bool fromTarget)<6e20d7af277949f4a7bb952d64b81cda>:0<br /> Xamarin.Forms.BindingExpression.BindingExpressionPart.<PropertyChanged>b__47_0()<6e20d7af277949f4a7bb952d64b81cda>:0<br /> Java.Lang.Thread.RunnableImplementor.Run()<9ab9faae1b4b4f0da28e7c4ac61e2c78>:0<br /> Java.Lang.IRunnableInvoker.n_Run(IntPtr jnienv, IntPtr native__this)<9ab9faae1b4b4f0da28e7c4ac61e2c78>:0<br /> at (wrapper dynamic-method) System.Object:94a3beb6-4f7c-4b9d-958e-0e8b8d73194b (intptr,intptr)<br /> mono.java.lang.RunnableImplementor.n_run(Native Method)<br /> mono.java.lang.RunnableImplementor.run()RunnableImplementor.java:30<br /> android.os.Handler.handleCallback()Handler.java:751<br /> android.os.Handler.dispatchMessage()Handler.java:95<br /> android.os.Looper.loop()Looper.java:154<br /> android.app.ActivityThread.main()ActivityThread.java:6120<br /> java.lang.reflect.Method.invoke(Native Method)<br /> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run()ZygoteInit.java:865<br /> com.android.internal.os.ZygoteInit.main()ZygoteInit.java:755<br />

Because of a memoryleak in Forms, I had to change it to images with FFImageLoading.
Unfortunately, I cannot post much code, but this is the grid row that keeps crashing:
<br /> <?xml version="1.0" encoding="utf-8" ?><br /> <Grid xmlns="n.com/schemas/2014/forms" xmlns:x="ft.com/winfx/2009/xaml" xmlns:forms="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms" xmlns:extensions="clr-***.Extensions;assembly=***" x:Class="***.Views.Editors.BooleanEditor" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Padding="5,0" x:Name="Grid" IsVisible="{Binding Visible}" HeightRequest="80"><br /> &lt;Grid.RowDefinitions><br /> <RowDefinition Height="80"/><br /> &lt;/Grid.RowDefinitions></p> <p>&lt;Grid.ColumnDefinitions><br /> <ColumnDefinition Width=".2*"/><br /> <ColumnDefinition Width="1*"/><br /> <ColumnDefinition Width="3*"/><br /> <ColumnDefinition Width="1*"/><br /> <ColumnDefinition Width="6*"/><br /> <ColumnDefinition Width=".5*"/><br /> <ColumnDefinition Width="1*"/><br /> <ColumnDefinition Width=".5*"/><br /> <ColumnDefinition Width="1*"/><br /> <ColumnDefinition Width=".5*"/><br /> &lt;/Grid.ColumnDefinitions></p> <p>&lt;Grid.Children><br /> <forms:CachedImage Grid.Row="0" Grid.Column="0" WidthRequest="24" HeightRequest="24" DownsampleHeight="24" DownsampleWidth="24" Source="{extensions:ImageResource ***.Images.info.png}" HorizontalOptions="Start" VerticalOptions="Center" IsVisible="{Binding HasMemo}" CacheType="All" Margin="15,0,0,0"><br /> &lt;forms:CachedImage.GestureRecognizers><br /> <TapGestureRecognizer Command="{Binding BindingContext.ItemHelpCommand, Source={x:Reference Grid}}"/><br /> &lt;/forms:CachedImage.GestureRecognizers><br /> </forms:CachedImage></p> <pre><code><ContentView Grid.RowSpan="1" Grid.Row="0" Grid.Column="2" VerticalOptions="FillAndExpand"> <StackLayout Spacing="0" VerticalOptions="End" Margin="0,0,0,25"> <StackLayout Spacing="0"> <Label HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" HorizontalTextAlignment="Start" VerticalTextAlignment="Center" Text="{Binding Name}" FontSize="14"/> </StackLayout> <Label IsVisible="{Binding Required, Converter={StaticResource InvertBoolean}}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" HorizontalTextAlignment="Start" VerticalTextAlignment="End" Text="{extensions:Translate DynamicFormOptional}" FontSize="10"/> </StackLayout> </ContentView> <ContentView BackgroundColor="{Binding BgColor}" Grid.Row="0" Grid.Column="4" Margin="0,0,0,12"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="20"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Grid.Children> <Label Grid.Row="0" Grid.Column="0" HorizontalOptions="Start" VerticalOptions="FillAndExpand" HorizontalTextAlignment="Start" VerticalTextAlignment="Center" Text="{Binding PreviousValue, Converter={StaticResource TextTranslation}}" IsVisible="{Binding BindingContext.ValueHasChanged, Source={x:Reference Grid}}" /> <Label Grid.Row="0" Grid.Column="0" HorizontalOptions="Start" VerticalOptions="FillAndExpand" HorizontalTextAlignment="Start" VerticalTextAlignment="Center" IsVisible="{Binding BindingContext.ValueHasChanged, Source={x:Reference Grid}, Converter={StaticResource InvertBoolean}}" /> <forms:CachedImage VerticalOptions="Center" Grid.Row="1" Grid.Column="0" DownsampleToViewSize="True" Source="{extensions:ImageResource ***.Images.buttonNoOff.png}" IsVisible="{Binding Value, Converter={StaticResource NullableBoolean}, ConverterParameter=True}" CacheType="All"> <forms:CachedImage.GestureRecognizers> <TapGestureRecognizer Command="{Binding BindingContext.BooleanNoCommand, Source={x:Reference Grid}}"/> </forms:CachedImage.GestureRecognizers> </forms:CachedImage> <forms:CachedImage VerticalOptions="Center" Grid.Row="1" Grid.Column="0" DownsampleToViewSize="True" Source="{extensions:ImageResource ***.Images.buttonNoOn.png}" IsVisible="{Binding Value, Converter={StaticResource InvertNullableBoolean}}" CacheType="All"> <forms:CachedImage.GestureRecognizers> <TapGestureRecognizer Command="{Binding BindingContext.BooleanNoCommand, Source={x:Reference Grid}}"/> </forms:CachedImage.GestureRecognizers> </forms:CachedImage> <forms:CachedImage VerticalOptions="Center" Grid.Row="1" Grid.Column="1" WidthRequest="147" HeightRequest="100" DownsampleHeight="40" DownsampleWidth="147" DownsampleToViewSize="False" Source="{extensions:ImageResource ***.Images.buttonYesOff.png}" IsVisible="{Binding Value, Converter={StaticResource InvertNullableBoolean}, ConverterParameter=True}" CacheType="All"> <forms:CachedImage.GestureRecognizers> <TapGestureRecognizer Command="{Binding BindingContext.BooleanYesCommand, Source={x:Reference Grid}}"/> </forms:CachedImage.GestureRecognizers> </forms:CachedImage> <forms:CachedImage VerticalOptions="Center" Grid.Row="1" Grid.Column="1" WidthRequest="147" HeightRequest="100" DownsampleHeight="40" DownsampleWidth="147" DownsampleToViewSize="False" Source="{extensions:ImageResource ***.Images.buttonYesOn.png}" IsVisible="{Binding Value, Converter={StaticResource NullableBoolean}}" CacheType="All"> <forms:CachedImage.GestureRecognizers> <TapGestureRecognizer Command="{Binding BindingContext.BooleanYesCommand, Source={x:Reference Grid}}"/> </forms:CachedImage.GestureRecognizers> </forms:CachedImage> </Grid.Children> </Grid> </ContentView> <forms:CachedImage Grid.RowSpan="2" Grid.Row="0" Grid.Column="6" WidthRequest="24" HeightRequest="24" DownsampleHeight="24" DownsampleWidth="24" DownsampleToViewSize="False" Source="{Binding HasIssue, Converter={StaticResource HasIssueBoolConverter}}" IsVisible="{Binding HasIssueColumn}" CacheType="All"> <forms:CachedImage.GestureRecognizers> <TapGestureRecognizer Command="{Binding BindingContext.HasIssueCommand, Source={x:Reference Grid}}"/> </forms:CachedImage.GestureRecognizers> </forms:CachedImage> <forms:CachedImage Grid.RowSpan="2" Grid.Row="0" Grid.Column="8" WidthRequest="24" HeightRequest="24" DownsampleHeight="24" DownsampleWidth="24" DownsampleToViewSize="False" Source="{Binding CameraIcon, Converter={StaticResource CameraIconConverter}}" IsVisible="{Binding PictureRequired}" CacheType="All"> <forms:CachedImage.GestureRecognizers> <TapGestureRecognizer Command="{Binding BindingContext.Photo, Source={x:Reference Grid}}"/> </forms:CachedImage.GestureRecognizers> </forms:CachedImage>

</Grid.Children>


<br /> public partial class BooleanEditor : Grid, IEditor<br /> {<br /> public BooleanEditor()<br /> {<br /> InitializeComponent();<br /> }</p> <pre><code> public EditorTypes EditorType => EditorTypes.Boolean; }

I have removed the
<br /> BackgroundColor="{Binding BgColor}"<br />
for testing, but that did not change anything.

Please please help me, I'm getting desperate.

Render layout asynchronously

$
0
0

Hello everybody!

My headline may sound much worse than it really is, but this is the first thing that came to mind =)
On my page is the View and ActivityIndicator.
First I load the data from the backend into my ViewModel.
Then I send the data to the View, and when it gets the data it starts to add the elements to its Grid (my own elments).
When it adds these elements, my ActivityIndiacator freezes.

Below is my code for adding items:

public static readonly BindableProperty WeeksProperty = BindableProperty.Create(
            "Weeks",
            typeof(List<WeekInfo>),
            typeof(ScheduleMonthView),
            propertyChanged: (bindable, value, newValue) =>
            {
                var days = (List<WeekInfo>)newValue;
                ((ScheduleMonthView)bindable).FillGrid(days);
            });
//...
private void FillGrid(List<WeekInfo> weeks)
        {
            if (ReferenceEquals(weeks, null))
                throw new NullReferenceException();

            if (weeks.Count != 6)
                throw new NullReferenceException();

            for (int row = 1; row < 7; row++)
            {
                FillRow(row, weeks[row - 1]);
            }

            MonthInfo.IsBusy = false;
        }

        private void FillRow(int row, WeekInfo weekInfo)
        {
            for (int i = 0; i < 7; i++)
            {
                var cell = CreateCellView(weekInfo.Days[i]);
                PasteItem(cell, i, row);
            }
        }

        private MonthCellTemplate CreateCellView(DayInfo day)
        {
            var template = new MonthCellTemplate
            {
                BindingContext = day,
                IsNoActiveMonth = Weeks[2].DateOfFirstDayOfWeek.Month != day.DayOfMonth.Month,
            };          

            Binding itemTappedCommandBinding =
                new Binding("ItemTappedCommand", source: this);

            template.SetBinding(MonthCellTemplate.ItemTappedCommandProperty,
                itemTappedCommandBinding);

            return template;
        }

        private void PasteItem(View view, int column, int row)
        {
            MonthGrid.Children.Add(view, column, row);
        }

How can I place a NavigationPage within Placeholder.Content?

$
0
0

I currently have a nav bar that populates PlaceHolder.Content with a new class.

void Departments(object sender, System.EventArgs e)
{
var page = new Departments();
PlaceHolder.Content = page.Content;

}

My issue is that the new page that is being shown doesn't allow me to navigate through without a NavigationPage root.
is there a way that I can make..

PlaceHolder.Content = NavigationPage(Page.Content)?

I understand that they are not of the same type. But what can i do to make this work? thanks all.

Youtube API projet no compiler

$
0
0

hello i'm debutant with xamarin form and i'm doing a demo app for testing youtube services (recovering videos from a playlist) worry i've got the following i have this error CS0656 C # Member required by the compiler 'Microsoft.CSharp.RuntimeBinder .Binder.Convert 'missing which does not impede compiled the project and I checked the dependencies are well installed ... I followed this Tuto for realized
https://channel9.msdn.com/Blogs/MVP-Windows-Dev/Using-Youtube-API-with-Xamarin-Forms
Thank you

Viewing all 58056 articles
Browse latest View live


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