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

VS 2015 Pro build with error "Xamarin.Forms require msbuild. xbuild is no longer supported"

$
0
0

Dear all,
Currently, I am using Visual Studio 2015 Pro version 14.0.25431.01 Update 3.
My environment is: .NET Framework 4.7.02558, Xamarin 4.8.0.756, Xamarin.Android 8.1.0.13.

I create a new Xamarin.Forms PCL project and use Xamarin.Forms 3.4.0.1008975 (Lastest stable version).
But I cannot build the project with error "Xamarin.Forms require msbuild. xbuild is no longer supported".

I spent many times to search about this issue without success.
I changed to other version of Xamarin.Forms until 3.0.0.446417 but still same issue.

Some one said that I cannot use Xamarin.Forms from version 3.0.0.446417 with Visual Studio 2015.

Does any one from Xamarin can help me officially check this information?

Is there any one have solution for this error building in VS 2015?

Actually, I am trying to build the Droid project with Android 8 to use Plugin.FirebasePushNotification library.

So, any one have solution to implement Firebase Push Notification in Xamarin.Forms, please help me.

All your supports are welcome.

Thank you very much,


Generate token from credit card Stripe.Net

$
0
0

Since Stripe.Net doesn't work anymore in the PCL side, we need to use DependencyServices<>. However, when I'm trying to generate a token from credit card information, it seems like... It's missing in the doc, I just can't find anything on the web or in the doc, is that normal?

I would like to achieve something like that :

public string CardToToken()
{
    var card = new Card()
    {
        Number = "4242424242424242",
        ExpiryMonth = 12,
        ExpiryYear = 16,
        CVC = 123
    };

    try
    {
        token = await Stripe.CreateToken(card);
    }
    catch (Exception ex)
    { 
        return null;
    }

    return token;
}

So then I can just simply send it to my server. Any idea to achieve something that easy? That's the last point I need to finish for my project...

This example is in my Android side.

Thank for any help...

Integrate Stripe SDK for xamarin forms

$
0
0



Hello Developer,
How developers how can integrate Stripe Api and Stripe SDK for android and IOS.

I read this post "https://stripe.com/docs/mobile/android".

I have "build.gradle" but i can't add this file in inside the dependencies section.

Below I attach build.gradle and dependencies section.

Help for Integrate Sprite payment gatway in xamarin forms.

Thanks

Deepak :smile:

StripeView in Xamarin Forms

$
0
0

I did a little research and it seems braintree and stripe are suitable for app payments.
braintree has no official xamarin bindings but there's a Stripe component by Xamarin for Android and iOS.
is it possible to use this component in Xamarin.Forms (and it's StripeView UI) ?

'Stripe payment' component is not shown in xamarin component store

$
0
0

Hi everyone, I want to implement 'Stripe' payment in one of my xamarin android project, Now I am go to component store and search but it show's no component found. In last month I have found 'Stripe' component in the xamarin component store. what will happen now it's not showing this stripe component in store.

How to get rid of Hamburger icon

$
0
0

I have been revisiting one of my old Xamarin apps and I noticed the hamburger icon appear on the bottom navigation bar.

Does anyone know how to get rid of this?

Why can't MessagingCenter deduce correct type from a base class when publishing?

$
0
0

I am trying to use Xamarin.Messaging to communicate between my model and view-logic layers. I thought I would use something similar to the SetProperty<T>() function I have in the base class of my view-models. So I have something like this...

A View-Model that should act as receiver of messages

public class SomeViewModel : ViewModelBase
{
    protected void FunctionThatRunsBeforeViewModelDoesAnything
    {
        MessagingCenter.Subscribe<SomeModel>( this, "ABC", MessagingCallback );
    }

    private void MessagingCallback( SomeModel someModel )
    {
        // Do something.
    }
}

These classes are in my model-layer and are the publishers of messages

public abstract class ModelBase
{
    protected bool SetProperty<T>( ref T oldValue, T newValue, [CallerMemberName] string propertyName = null )
    {
        if( ( oldValue == null && newValue != null ) || !oldValue.Equals( ( T )newValue ) )
        {
            oldValue = newValue;
            MessagingCentre.Publish( this, "ABC" ); // This message is NOT received.
            return true;
        }
        return false;
    }
}

public class SomeModel : ModelBase
{
    public int SomeProperty
    {
        get => _someProperty;
        set
        {
            if( SetProperty( ref _someProperty, value ) )
                MessagingCentre.Publish( this, "ABC" ); // This message is received okay.
        }
    }

    private int _someProperty = 0;
}

As the comments indicate, the message sent from the subclass instance works fine but the message sent from the base class is not received.

Inside the base class, at the point where I send the message, the type of the this reference is correctly reported as being SomeModel, not ModelBase, so why is a message sent from here never received?

I am guessing the reason the message sent from the base class is not received is because the MessagingCenter thinks the type of the sender is ModelBase, not SomeModel. Since the debugger and perhaps more significantly my run-time logs get the type correct at this point, I am mystified why this is not working. Does anyone know why I can't send the message from the base class?

  • Patrick

PCL Assembly compression and combining it in few set of single assemblies.

$
0
0

Hi,

I have a project under development, which is using few plug-ins as well.
The thing bothering to me is there are 114 (so far) dll files which gets packed in resulting APK.

I want to merge (with or without ILMerge tool) and compress these dlls in few groups, like systm.x???.dll into system.merged.dll and like wise.

Has anyone tried it? my main motto is to reduce the APK size and at the same time remove clutter from application packaging,
All thoughts - sample (build) scripts are welcome.

Thanks
N Baua


Opening Location Settings Page or Prompting user to Enable Location

$
0
0

hello,
i've been hacking my brain and googling away in vain. i am trying to find a way to prompt the user to switch location on either by going directly to the settings page or just tapping yes on the screen.
all code i've seen doesn't seem to work. does any one have something that works. a detailed example will be much appreciated. thank you.
I'm really new to Xamarin development

Build Specific UI

$
0
0

hi ,
Is it possible to build this specific UI on xamarin forms ? binding from an api !

Responsive UI, Ripple animation, ImageButton, Tapable layout etc.

$
0
0

Hi all,

Responsive UI in xamarin forms - there is an easy way to achieve it!

On touch you can change:
Background image
Background color (animated or not)
Opacity (animated or not)
Scale (animated or not)

Ripple animation is supported

https://github.com/AndreiMisiukevich/TouchEffect (good documentation is there)

TabbedPage event on tab click or refresh tab when same tab is clicked?

$
0
0

I'm using a TabbedPage with Xamarin.Forms, and when a user is already on Tab 2, and clicks on Tab 2, I'd either like that tab to reload, or i'd like to run my own custom code to refresh the page.

I have been trying to find any sort of event I could hook into, or a way to do this with custom renderers but have been unable to find anything. What's the simplest way to do this?

Thanks!

Button text inside a Grouped Listview header is not binding to group property.

$
0
0

Hi I am trying to dynamically changed the button text inside Groupheader in GroupListview but its always empty. Below is the code snippet.

                      <Button  Grid.Row="0" Grid.Column="3" Text="{Binding **ButonText**}" WidthRequest="175" 
                                      BackgroundColor="White" 
                                      Command="{Binding AddImages}" 
                                      CommandParameter="{Binding Source={x:Reference Item}, Path=BindingContext}"
                                      BindingContext="{Binding Source={x:Reference GroupedView},Path=BindingContext}"      />  

But when i remove the binding Context from Button than Text is displayed properly but than Command does not work.

Thanks in Advance.

How best to optimise BackgroundColors in a hierarchy of Views when the Colors will be the same?

$
0
0

A ViewModel has a public property that returns the state of some entity.
The View presents that state information in the form of the BackgroundColor (accessibility is taken care of separately).
The ViewModel doesn't know how the View presents the state, so the View uses a ValueConverter to convert the state to the corresponding Color.
All good so far.

The View is made up of a Layout and the Children of that Layout (and any Children or Content of those Children).
The BackgroundColor of the Layout represents the state of the entity.
The BackgroundColor of the Children (and further descendants) of the Layout will also represent the state of the entity, so will be equal to the BackgroundColor of the Layout.

Various implementation methods exist:
(1) The Layout and each of the Children have their BackgroundColor bound to the ViewModel property, each using the ValueConverter. That means lots of repeated conversions.
(2) The Layout has its BackgroundColor bound to the ViewModel property, and each of the Children have their BackgroundColor set to Color.Transparent. So, only one conversion and a lot of Transparent colors.
(3) The Layout has its BackgroundColor bound to the ViewModel property, and each of the Children have their BackgroundColor bound to the Layout's BackgroundColor
(4) Any others?

So, the question is - without breaking MVVM, which would be expected to be the most performant implementation?

Active Directory sign in: Redirect URI for android?

$
0
0

I am working in a Xamarin Forms mobile app in which I intend to use Active Directory for user account management. I have implemented a functional signup / signin in Azure and in my Xamrin Forms app, am able to sign up / sign in when running on UWP. However when trying to do the same in android I get an error. My understanding is that the redirectURI needs to be different depending on the OS.

My UWP redirect URI is:

$"urn:ietf:wg:oauth:2.0:oob"

What redirect URI should I be using for Android / iOS? And is this the only change I need to make for active directory to work in the other OS's?


The immovable problem with Xamarin.iOS

$
0
0

Good day to you people , i'm trying to deploy my app on to a iphone device and i get the following error :

"/Users/systemadmin/Library/Caches/Xamarin/mtbs/builds/POD.iOS/07c34a292fa4873ef8290af52bfd88ba/bin/iPhone/Debug/POD.iOS.app: errSecInternalComponentPOD.iOS"

i have tried everything that google could offer me and nothing worked , could some help me out with some pointers ?

How to add swiping dots to Tabbed/Carousel page?

$
0
0

I'm wondering how to add dots indicating to swipe screens in either TabbedPage or CarouselPage like in the below image?

I tried adding images for that but they don't look natural so is there a real way for doing that?

My above workaround explanation in an example with 3 page:

I create 3 images each image has 3 dots one of them is highlighted:

First image highlighted dot is the first one.

Second image highlighted dot is the second one.

and etc.

Adding a clickable dropdown icon in a picker

$
0
0

I have a picker, and I use XAML to add a dropdown icon as an image and set it to the right of the picker. It looks perfect, but the icon area is not clickable (understandable as there is an image overlay)

Is there any way I can display the dropdown icon and still make the area clickable? (preferably with the same way I'm adding the icon i.e. without custom renderers)

Listview on iOS 9 not filling screen width - issue with custom ViewCell

$
0
0

In iOS8 a simple Listview would have separator lines that filled the width (especially in landscape mode)
In iOS9 the Listview separator lines no longer fill the full width on a landscape iPad mini.

(first attached image is a simple list view with the ItemsSource set to an array of 3 strings)

This causes me a problem as I have custom ViewCells and they are left aligned on the screen and so appear out of alignment with the separator lines.

(see second attached image. I've used the code fragment below to have a custom ViewCell)

Here is a very short sample program.
Note in the custom ViewCell I don't bother to get the proper list contents. For now I just hard code a label which is enough for now.

Any ideas on how to fix this layout so it looks like iOS8 did with seperators filling the screen.

Thanks

UPDATE... Tried XamStudio Alpha (with Xam.iOS 8.13.xx) and Beta (with Xam.iOS 9.xx) and XamForms 1.4.4 and 1.5.0. Nothing helped.

    using System;

    using Xamarin.Forms;

    namespace ListViewBug2
    {
        public class App : Application
        {
            public App ()
            {

                ListView listview = new ListView();
                listview.ItemsSource = new String[]{"one","two","three"};
                listview.ItemTemplate = new DataTemplate(typeof (CustomCell));


                // The root page of your application
                MainPage = new ContentPage {
                    Content = new StackLayout {
                        VerticalOptions = LayoutOptions.Center,
                        Children = {
                            new Label {
                                XAlign = TextAlignment.Center,
                                Text = "Welcome to Xamarin Forms!"
                            },
                            listview,
                        },
                        Padding = new Thickness(0,20,0,0),
                    }
                };
            }

        }

        public class CustomCell : ViewCell {
            // Constructor
            public CustomCell() {
                Label myLabel = new Label();
                myLabel.Text = "custom list item";  // Hard code for now
                View = myLabel;
            }
        }
    }

Listview Group

$
0
0

Hi!

Does anybody have some example abaout working with groups in listviews?

I´m triying to display an Observablecollection (PedidoShow), and the group key is "idsector". The detail would be the items "codigo" and "descrip`" (it is just an example, there are more items), and only the key group (idsector) is shown. I´ve tried a lot examples from the web, and none work it. I´ll put the last code I´ve been trying. Thanks!

XAML:

<ListView.ItemTemplate>



</ListView.ItemTemplate>

Viewing all 91519 articles
Browse latest View live


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