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

Xamarin Forms: WhenActivated not being fired reactiveui for viewmodel

$
0
0

I can't understand why the WhenActivated func is not fired for a Xamarin Forms application. The application has a LoginViewModel and a LoginView

  • LoginView: inherits from ContentPageBase which itself derives from : ContentPage, IViewFor which I think is expected
  • LoginViewModel: ReactiveObject, IRoutableViewModel, ISupportsActivation

Here's the sample application code.

The first view LoginView is loaded as expected. However, I would ideally like to load services and setup ReactiveUI.

Any ideas?

Source code

thanks


Firebase Authentication Support in Xamarin forms

$
0
0

Is there any support of Firebase authentication for Xamarin Forms? Please help

Xamairn.forms previewer not working with master detail page !

$
0
0

I'm trying to create master detail page in xamarin.forms.
But the previewer just does not work !
I'm not able to design ui easily.
Any solutions ??

Set ActionSheet Text and Value from dataSource

$
0
0

Hi,

I want to use the ActionSheet to display items from dataSource and set a display text and value to it.

For example, from my database I am returning country_code and country_name so the country_name will ne display in the actionSheet but when user clicks on any country I want to get the country_code.

Thanks,
Jassim

When do renderers get disposed?

$
0
0
When a page is pushed on the stack, does the renderer of the previous page get disposed? What about the renderers of the elements on that previous page? Is there any documentation out there that explains the lifecycle of renderers? @DavidOrtinau

Same control UI in all platform using Xamarin.Forms

$
0
0

Is there any package available for xamarin forms control that UI will be same in all platform?
and third-party package available for control.

Get Value from Jagged Array to View Model

$
0
0

How could i get value "KLM" as showed in pic below from other class to my View Model Class

How to show entry border onFocus?

$
0
0

Here i am using this code for setting entry border using renderer:

 protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
        {
            base.OnElementChanged(e);
            //Control?.SetBackgroundColor(Android.Graphics.Color.Transparent);

            if (Control != null)
            {
                var gd = new GradientDrawable();
                gd.SetStroke(2, Android.Graphics.Color.Purple);
                Control.SetPadding(10, 10, 10, 10);
                Control.SetBackground(gd);  
            }
            else
            {

            }
        }

i want to show the border with shadow only onFocus? how to do this?


Look for example of xamarin form dish dishes on smartphone with SQL Server database

$
0
0

I'm looking for examples of xamarin form dishes on smarphones like cafes, restaurants, ... or example xamarin form that connects SQL Server data and output to listview, do you have share code for me ?

Does Xamarin apps developed using Xamarin.forms support Blackberry devices running on Android OS?

$
0
0

Does Xamarin apps developed using Xamarin.forms support Blackberry devices running on Android OS?

How to upload/download files from OneDrive in Xamarin Forms 3 App

$
0
0

I am developing an app with xamarin forms 3 where I need to upload and download files from OneDrive. I can't find any solution to this problem. I googled a lot but any solution based on Graph or Cloudrail API don't run. Is there ant good tutorial or code sample that solve this problem ? I can't believe that any others are in trouble like me. Thanks in advance to anyone can help me.

Error at Android.Widget.ImageView.SetImageDrawable

$
0
0

Hello i have the following error message throught Device Log :

at <0xffffffff>
at (wrapper managed-to-native) Java.Interop.NativeMethods.java_interop_jnienv_call_nonvirtual_void_method_a (intptr,intptr&,intptr,intptr,intptr,Java.Interop.JniArgumentValue) [0x00010] in <7802aa64ad574c33adca332a3fa9706a>:0
at Java.Interop.JniEnvironment/InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference,Java.Interop.JniObjectReference,Java.Interop.JniMethodInfo,Java.Interop.JniArgumentValue
) [0x00074] in <7802aa64ad574c33adca332a3fa9706a>: 0
at Java.Interop.JniPeerMembers/JniInstanceMethods.InvokeVirtualVoidMethod (string,Java.Interop.IJavaPeerable,Java.Interop.JniArgumentValue*) [0x0005f] in <7802aa64ad574c33adca332a3fa9706a>: 0
at Android.Widget.ImageView.SetImageDrawable (Android.Graphics.Drawables.Drawable) [0x00038] in <263adecfa58f4c449f1ff56156d886fd>: 0
at Xamarin.Forms.Platform.Android.ImageViewExtensions/d__0.MoveNext () [0x00214] in D :\a\1\s\Xamarin.Forms.Platform.Android\Extensions\ImageViewExtensions.cs:67
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start<Xamarin.Forms.Platform.Android.ImageViewExtensions/d__0> (Xamarin.Forms.Platform.Android.ImageViewExtensions/d__0&) [0x00033] in :0
at Xamarin.Forms.Platform.Android.ImageViewExtensions.UpdateBitmap (Android.Widget.ImageView,Xamarin.Forms.Image,Xamarin.Forms.Image) [0x00037] in <6d4ed4125be34de781270a341e979c0d>: 0
at Xamarin.Forms.Platform.Android.ImageRenderer/d__10.MoveNext () [0x00033] in D :\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ImageRenderer.cs:113
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start<Xamarin.Forms.Platform.Android.ImageRenderer/d__10> (Xamarin.Forms.Platform.Android.ImageRenderer/d__10&) [0x00033] in : 0
at Xamarin.Forms.Platform.Android.ImageRenderer.UpdateBitmap (Xamarin.Forms.Image) [0x0002f] in <6d4ed4125be34de781270a341e979c0d>: 0
at Xamarin.Forms.Platform.Android.ImageRenderer/d__9.MoveNext () [0x00014] in D :\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ImageRenderer.cs:94
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start<Xamarin.Forms.Platform.Android.ImageRenderer/d__9> (Xamarin.Forms.Platform.Android.ImageRenderer/d__9&) [0x00033] in : 0
at Xamarin.Forms.Platform.Android.ImageRenderer.TryUpdateBitmap (Xamarin.Forms.Image) [0x0002f] in <6d4ed4125be34de781270a341e979c0d>: 0
at Xamarin.Forms.Platform.Android.ImageRenderer/d__7.MoveNext () [0x0003f] in D :\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ImageRenderer.cs:70
at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start<Xamarin.Forms.Platform.Android.ImageRenderer/d__7> (Xamarin.Forms.Platform.Android.ImageRenderer/d__7&) [0x00033] in : 0
at Xamarin.Forms.Platform.Android.ImageRenderer.OnElementPropertyChanged (object,System.ComponentModel.PropertyChangedEventArgs) [0x00037] in <6d4ed4125be34de781270a341e979c0d>: 0
at (wrapper delegate-invoke) .invoke_void_object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs) [0x00073] in <5a97d41d36694fb19855c17429527b10>: 0
at Xamarin.Forms.BindableObject.OnPropertyChanged (string) [0x0000a] in D :\a\1\s\Xamarin.Forms.Core\BindableObject.cs:153
at Xamarin.Forms.Element.OnPropertyChanged (string) [0x00000] in D :\a\1\s\Xamarin.Forms.Core\Element.cs:402
at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty,Xamarin.Forms.BindableObject/BindablePropertyContext,object,bool,Xamarin.Forms.Internals.SetValueFlags,bool) [0x00116] in D :\a\1\s\Xamarin.Forms.Core\BindableObject.cs:634
at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty,object,Xamarin.Forms.Internals.SetValueFlags,Xamarin.Forms.BindableObject/SetValuePrivateFlags) [0x0015b] in D :\a\1\s\Xamarin.Forms.Core\BindableObject.cs:426
at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty,object,bool,bool) [0x0003d] in D :\a\1\s\Xamarin.Forms.Core\BindableObject.cs:583
at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty,object,bool) [0x00000] in D :\a\1\s\Xamarin.Forms.Core\BindableObject.cs:360
at Xamarin.Forms.Setter.Apply (Xamarin.Forms.BindableObject,bool) [0x000ba] in D :\a\1\s\Xamarin.Forms.Core\Setter.cs:65
at Xamarin.Forms.TriggerBase.OnConditionChanged (Xamarin.Forms.BindableObject,bool,bool) [0x00045] in D :\a\1\s\Xamarin.Forms.Core\Interactivity\TriggerBase.cs:101
at Xamarin.Forms.BindingCondition.OnBoundPropertyChanged (Xamarin.Forms.BindableObject,object,object) [0x0001d] in D :\a\1\s\Xamarin.Forms.Core\Interactivity\BindingCondition.cs:95
at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty,Xamarin.Forms.BindableObject/BindablePropertyContext,object,bool,Xamarin.Forms.Internals.SetValueFlags,bool) [0x00122] in D :\a\1\s\Xamarin.Forms.Core\BindableObject.cs:636
at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty,object,Xamarin.Forms.Internals.SetValueFlags,Xamarin.Forms.BindableObject/SetValuePrivateFlags) [0x0015b] in D :\a\1\s\Xamarin.Forms.Core\BindableObject.cs:426
at Xamarin.Forms.BindingExpression.ApplyCore (object,Xamarin.Forms.BindableObject,Xamarin.Forms.BindableProperty,bool) [0x00216] in D :\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:173
at Xamarin.Forms.BindingExpression.Apply (bool) [0x0003e] in D :\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:57
at Xamarin.Forms.BindingExpression/BindingExpressionPart.b__49_0 () [0 x 00000] in D :\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:616
at Java.Lang.Thread/RunnableImplementor.Run () [0x0000e] in <263adecfa58f4c449f1ff56156d886fd>: 0
at Java.Lang.IRunnableInvoker.n_Run (intptr,intptr) [0x00008] in <263adecfa58f4c449f1ff56156d886fd>: 0
at (wrapper dynamic-method) object.8fb0aee2-4199-46cb-9693-1580fd8e2803 (intptr,intptr) [0x00011] in : 0
at (wrapper native-to-managed) object.8fb0aee2-4199-46cb-9693-1580fd8e2803 (intptr,intptr) [0x00021] in : 0

The flow is : I have a Page A with a listview. This Listiview has ViewCell which has 2 images and some stacklayouts with labels inside. When i click at one item of this Listview, Page B appear, i'm doing some stuff and then i popasync at Page A again. I have to notice that i have a Refresh function inside override void OnAppearing() which Refresh the items of ListView at Page A. This function change the labels and images (By triggers) for each item of ListiView.

Xamarin forms with .netStandard 2.0, can't reference Core

$
0
0

I can't reference my Interfaces from my .Core project to my Android Project and I don't understand why...

I created a new solution with Visual Studio 2017 in Xamarin.Forms with .Net Standard lib.

And this is what I tried:
I can't post link, so, delete space:
ht tp://us.v-cdn.net/5019960/uploads/editor/lx/58oajif2knff.png

With the old .NetFramework Core project method, it worked perfecly, but not now...

Thanks for your help

Generate Random number

$
0
0

Hello, how to generate a random or sequential number in an entry. I have the code but it did not work.

\CODE

Random generator = new Random ();

String randomumber = generator.Next (100000, 999999) .ToString (itemEntry.Text);

Uncaught Exception when using plugin.media

$
0
0

I get an Uncaught Exception Cannot throw 'Plugin.Media.Abstractions.MediaPermissionExceptions' on thread... (im using live player can see the whole massage) I followed a video image

I have also given permission in andriod for CAMERA, READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE. I dont know how to continue any leads?

XAML:

    </Button>

    <Button BackgroundColor="Red" Clicked="Browsephoto_onclick" Text="Browse" x:Name="Browsephoto">

    </Button>

    <Image x:Name="MainImage">


    </Image>

</StackLayout>

CS:

public partial class NewitemPage : ContentPage
{
public NewitemPage ()
{
InitializeComponent ();
}

    private async void Takephoto_onclick(object sender, EventArgs e)
    {



        await CrossMedia.Current.Initialize();

        if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported)
        {
            await DisplayAlert("Error", "(Camera not avalible.", "OK");
            return;

        }

        var file = await CrossMedia.Current.TakePhotoAsync(
            new StoreCameraMediaOptions
            {
                SaveToAlbum = true,
                Name = "Annons_bild.jpg"

            });

        if (file == null)
        {
            return;

        }



        MainImage.Source = ImageSource.FromStream(() => file.GetStream());

    }

    private async void browsephoto_onclick(object sender, EventArgs e)
    {
        await CrossMedia.Current.Initialize();

        if (!CrossMedia.Current.IsPickPhotoSupported)
        {
            await DisplayAlert("Error", "Cant browse photo", "okbye");
            return;
        }

        var file = await CrossMedia.Current.PickPhotoAsync();

        if (file == null)
        {
            return;
        }



        MainImage.Source = ImageSource.FromStream(() =>
        {
            var stream = file.GetStream();
            file.Dispose();
            return stream;

        });
    }

}

}


Save images and Formatted Text

$
0
0

Hi Forum is it possible to save formatted text and images in xamarin

Displaying data from sql

$
0
0

Hi Forum
may I ask how to display sql data directly into ListView? I know its a bad practice and it is supposed to be through webservice but in this scenario I have to pull directly from sql and put it to ListView

Unhandled Exception: System.TypeLoadException: Could not resolve type with token 010000c1

$
0
0

Anyone having or ever had an issue with installing Xamarin Forms 3.0+ (or another version) and then the app starts crashing on the .init(..) line in the android activity on start up.

I am creating a blank project and updating XF to 3.0+ and this works fine, when I start adding packages and implement this in my activity in android I eventually get the exception and only works rolling back to XF's 2.5.

Any ideas how to debug this or preferably solve this issue. I am guessing this might be to do with a reference issue with one of my packages dependencies regarding Forms.

Error below:

Unhandled Exception:

System.TypeLoadException: Could not resolve type with token 010000c1 (from typeref, class/assembly Xamarin.Forms.Xaml.XamlResourceIdAttribute, Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null)

Unhandled Exception:

Full error:

System.TypeLoadException: Could not resolve type with token 010000c1 (from typeref, class/assembly Xamarin.Forms.Xaml.XamlResourceIdAttribute, Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null)

Pan Gesture on in Xamarin Forms

$
0
0

Hi all,

I see that there is no Command binding to the Pan gesture class. I would like to keep the cs file of my views clean, I normally bind commands (that are implemented in the view model files) in the xaml file. How can I achieve this in this situation?
Thanks

Bind Table

$
0
0

Hi xamarin forum how can I or rather what is the proper to call table from database to bind it to ListView should I do it like this

as a side note TableName.Customer is the format of my table's name

Viewing all 89864 articles
Browse latest View live


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