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

Error after installing Xamarin.Forms 3.0

$
0
0

I have installed Xamarin.Forms 3.0 and i have this message in debug in the App.xaml

"System.MissingMethodException: System.Func`2<string, string> Xamarin.Forms.Internals.ResourceLoader.get_ResourceProvider()"

in this piece of code

[global::Xamarin.Forms.Xaml.XamlFilePathAttribute("App.xaml")]
public partial class App : global::Xamarin.Forms.Application {

    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Forms.Build.Tasks.XamlG", "2.0.0.0")]
    private void InitializeComponent() {
        global::Xamarin.Forms.Xaml.Extensions.LoadFromXaml(this, typeof(App));
    }

Someone can help me to understand why?


Code MSB4062

$
0
0

Hi Xamarin Forum,
I notice one thing when I update my Xamarin.Forms to 3.0.0.446417 in VS 2017 when I start a new project either .Net or shared I immediately got the error MSB4062 The "Xamarin.Forms.Build.Tasks.XamlGTask" task could not be loaded from the assembly. Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

So how can I fix this?
Thank you

Column Width

$
0
0

Hi is it possible to use percentage on column spacing or width

How to make a call using label

$
0
0

Hi

how can I make my label call by tapping that label with phone num as its text

    <Label Text="(02) 345 7854">
                <Label.GestureRecognizers>
                    <TapGestureRecognizer NumberOfTapsRequired="1" Tapped="TaptoCall"/>
                </Label.GestureRecognizers>
            </Label>

Then here is my back code

void TaptoCall(object sender, EventArgs args)
    {
        Device.OpenUri(new Uri("(02) 345 7854"));
    }

When I tap on that label my app crashes

Implement firebase chat in Xamarin forms app.

$
0
0

I need to implement chat feature in Xamarin forms application. I need to build both android and iOS apps. I would like to know whether this is possible with firebase chat. I'm unable to find any content supporting this. Is it possible ?

The VS2017 and .forms update thread...

$
0
0

Hi all

I have to update my whole dev environment (VS2015 -> VS2017) and also the whole Xamarin stuff in the next time and yes... really fear that :neutral:
Actually, there are a lot (too much) of "releases" in the "Xamarin.Forms Releases" thread, since I have frozen my actually used version.
If I have a look at the (MS) VS 2017 (Xamarin) bug site and/or the .forms GitHub issues (unfortunately most without a clear relation to the "bug version"), I feel sick...

As I’m sure, I’m not the only one in this situation, I have started this thread and hope, that a lot of users will post here their experiences with VS2017, the Xamarin integration software and also the .forms version (as we all know, the whole stuff have to work together, that we can work with it :smirk: ).

So... it would be nice if you would post your experiences/findings here regarding VS2017 :sunglasses:
* Which exact version of VS2017 are you using ans why?
* Which exact version of .forms are you using and why?
* How does the Xamarin integration software work (open “old” projects, debugger, emulators, connection to MAC and so on…) ?
* How is the app performance (startup, running) with the new (which?) XF version compared to the old (which?) version, you have used?

And... as soon as I start my migration (I think, this will be in a few weeks), I also will post my findings here…

Link to thread, with some problems / information’s to XF3 and VS2017, started from @ClintStLaurent:
https://forums.xamarin.com/discussion/127089/upgade-to-xamarin-forms3-throws-exception-support-core-ui-26-0-2-not-present-when-27-0-2-exists#latest

How to make Date time calender?

$
0
0

i am trying to make a Date and Time Picker in which i can choose the date and send it.i need this calendar in this format.please suggest me.

Azure Xamarin.Forms Quickstart - When Will It Get Updated?

$
0
0

If you create a new Mobile App via Azure QuickStart and select Xamarin.Forms and download the solution (i.e. follow these steps), you'll see the template is pretty out of date. Anyone know when we can expect that seed project (which is really a nice feature) to get updated to .NET Standard Library 2.0 (instead of PCL) and Xamarin.Forms 3.0?


Best moment to save settings

$
0
0

I create a new app where some settings have to be stored. For this, I use XAM.Plugin.Settings. The samplecode describes to do the saving on buttonclick. I intent to save the settings automatically for example, when I switch the page.
What is the best Moment to save settings? Is there any Event of the page?

getting null reference exception object refernce not set to be an instance of an object

$
0
0

getting null reference exception object refernce not set to be an instance of an object while subscribing a value from one page to another page entry???

Open mobile camera in webview

$
0
0

I'm building an application where i load website in a webview.

On website i open device camera ( take pics etc ) and its working perfectly fine on all browsers but when i load same application in xamarin.forms web view, mobile camera doesn't show up. Any idea what could be the reason ?

Regards
TA

Draw a line between two controls

$
0
0

Hello!

I would like to create a simple structure of organizational chart, and so far, i'm dynamically adding buttons to StackLayout. When i click a button, i create another one and put him in StackPanel.

Now i would like to create a line, connecting clicked button and newly created one.

I would appreciate any help!

How to use icon in Xamarin.forms?

$
0
0

Hi,
is it possible to use an icon in xamarin forms?
I want to use thumbs_up and thumbs_down icon in my ListView and change colour of icon by click event.

Can i return MemoryStream from dependency call ?

$
0
0

hello,

I am trying to write IPicturePicker (to pick images from gallery) and meet problem with incorrect image orientation some time.
decided to try to solve it automatically in picturepicker code (now in Android version ).

but when I try to return memorystream to shared code everything crashing (null reference , external code ).

while writing this question decided to switch to byte[] and it is working.
but still interested, why I can't return memorystream ?

tia
ish

Can we generate images dynamically using c# in Xamarin forms

$
0
0

Can we create images using c# in Xamarin forms


Creating a form dynamically

$
0
0

I have a json as below:-

{"RespondantQuestionnare":[{"QuestionnareTypeID":"629","Questions":"I find that I have low energy levels and I have been feeling tired easily.","Mandatory":"Y","QuestionType":"Radio","Choices":["Yes","Sometimes","No"]},{"QuestionnareTypeID":"629","Questions":"I have been suffering from pains in various parts of my body.","Mandatory":"Y","QuestionType":"CheckBox","Choices":["Yes","Sometimes","No"]},{"QuestionnareTypeID":"629","Questions":"I find that I have been getting irritable and angry easily.","Mandatory":"Y","QuestionType":"Radio","Choices":["Yes","Sometimes","No"]},{"QuestionnareTypeID":"629","Questions":"I have been finding it difficult to take initiative and feel enthusiastic.","Mandatory":"Y","QuestionType":"CheckBox","Choices":["Yes","Sometimes","No"]},{"QuestionnareTypeID":"629","Questions":"I feel constantly under strain and I find it difficult to relax.","Mandatory":"Y","QuestionType":"CheckBox","Choices":["Yes","Sometimes","No"]},{"QuestionnareTypeID":"629","Questions":"I have been finding it difficult to interact with my family and friends.","Mandatory":"Y","QuestionType":"CheckBox","Choices":["Yes","Sometimes","No"]},{"QuestionnareTypeID":"629","Questions":"I have been feeling anxious and tense.","Mandatory":"Y","QuestionType":"CheckBox","Choices":["Yes","Sometimes","No"]},{"QuestionnareTypeID":"629","Questions":"I have been feeling sad and depressed without reason.","Mandatory":"Y","QuestionType":"TextBox","Choices":["TextBox"]},{"QuestionnareTypeID":"629","Questions":"I feel inadequate, worthless and guilty most of the time.","Mandatory":"Y","QuestionType":"TextBox","Choices":["TextBox"]},{"QuestionnareTypeID":"629","Questions":"I have been having sleep problems( either disturbed/excessive sleep).","Mandatory":"Y","QuestionType":"TextBox","Choices":["TextBox"]},{"QuestionnareTypeID":"629","Questions":"I find that I am losing confidence in myself.","Mandatory":"Y","QuestionType":"TextBox","Choices":["TextBox"]},{"QuestionnareTypeID":"629","Questions":"I have been experiencing palpitations/a thumping of my heart.","Mandatory":"Y","QuestionType":"TextBox","Choices":["TextBox"]},{"QuestionnareTypeID":"629","Questions":"Of late hobbies or activities that I enjoyed earlier do not interest me.","Mandatory":"Y","QuestionType":"TextBox","Choices":["TextBox"]}],"JSONErrorCode":0,"strRespMsg":""}

How can i dynamically create a form using this json.

Images with databinding via XAML

$
0
0

I am able to display images successfully, but it fails when I try to do it with data binding in a XAML ListView.

I have tried it a couple ways.

1

Image Source="{Binding ImageResourcePath}"

I know the object is getting pulled correctly because I have a label immediately near that pulls another property ("{Binding Street}") successfully.

2

ImageCell Text="{Binding Street}" ImageSource="{Binding ImageResourcePath}"

Both of these approaches show text information just fine, but the image is gone.

I can see the image resources have loaded from a assembly.GetManifestResourceNames check I do. I copied the paths directly from that output to the ImageResourcePath.

I have even put static paths that I can see working (not in the ListView) into the ImageResourcePath, but this shows as blank also.

I have tried switching out the images that work with the databinding images as well. Still blank.

Edit:

These are embedded assembly images

Using Embedded Images via binding

$
0
0

Hi,

I'm new to Xamarin Forms only started a couple of weeks ago coming from a WPF / MVVM background. I have a MasterDetailPage all working without icons so I am trying to 'bind' embedded images.

So in my MenuView XAML page, I have the following:-

  <ListView x:Name="lvMenu" VerticalOptions="FillAndExpand" SeparatorVisibility="None" ItemsSource="{Binding Menu}">
    <ListView.ItemTemplate>
      <DataTemplate>
        <ImageCell Text="{Binding Title}" ImageSource="{Binding IconSource}" />
      </DataTemplate>
    </ListView.ItemTemplate>
  </ListView>

The Menu is just a list of MenuItems that have TargetType, Title and IconSource properties. My IconSource contains the filename of the image, ie: cog.png

The following works and does show the image (albeit the same image for all the menu options):

<ImageCell Text="{Binding Title}" ImageSource="{local:ImageResource Touchretail.Trims.Mobile.Images.cog.png}" />

So I'm pretty sure it is achievable. What I would like to do is just replace the cog.png part with the TargetType from the Menu object. Effectively - I'm trying to get to:

<ImageCell Text="{Binding Title}" ImageSource="{local:ImageResource Touchretail.Trims.Mobile.Images.{Binding IconSource}}" /> 

but obviously this would not work.... How can I achieve the desired result?

Webservice calls in queue: problem on Android

$
0
0

I hope someone can help me, I have a queue for webservice calls and it works perfectly in Windows Phone and iOS, but not on Android.
I can't get a response from Android.
Here is my code (usage HTTPRequestQueue.AddToQueue(yourUrl) )

public class HTTPRequestQueue
{
public class QueueRequest
{
public string Url;
public Action Callback;
public string Id;

        public QueueRequest(string url, Action<WebRequestCompletedArgs> callback)
        {
            Url = url;
            Callback = callback;
        }
    }

    enum QueueStatus { Stopped, OnGoing }; // Queue can be in one of these states

    public List<QueueRequest> requests = new List<QueueRequest>();


    QueueStatus currentStatus;
    QueueRequest currentRequest;
    HttpWebRequest WebRequest;

    public HTTPRequestQueue()
    {
        currentStatus = QueueStatus.Stopped;
        WebRequest = null;
    }

    public void AddToQueue(string url, Action<WebRequestCompletedArgs> callback)
    {

        requests.Add(new QueueRequest(url, callback));
        MakeNextRequest();
    }

    public void Start()
    {
        MakeNextRequest();
    }

    public void StopQueue()
    {
        if (currentStatus == QueueStatus.OnGoing)
        {
            currentStatus = QueueStatus.Stopped;
            if (WebRequest != null)
                WebRequest.Abort();
            requests.Insert(0, currentRequest);

        }
    }

    //Private functions 
    void MakeNextRequest()
    {

        if (currentStatus == QueueStatus.OnGoing)
        {

            if (requests.Count() == 0)
            {
                currentStatus = QueueStatus.Stopped;
            }
            else if (requests.Count() > 0 && WebRequest == null)
            {
                MakeRequest();
            }

        }
        else if (currentStatus == QueueStatus.Stopped)
        {
            if (requests.Count() > 0 && WebRequest == null)
            {
                currentStatus = QueueStatus.OnGoing;
                MakeRequest();
            }
        }
    }

    void MakeRequest()
    {
        if (currentStatus == QueueStatus.Stopped)
            return;

        currentRequest = requests.First();

        try
        {
            WebRequest = (HttpWebRequest)HttpWebRequest.Create(currentRequest.Url);
            WebRequest.BeginGetResponse(new AsyncCallback(FinishWebRequest), this);
        }
        catch (WebException ex)
        {
            WebRequest = null;
            if (currentRequest.Callback != null)
            {
                currentRequest.Callback(new WebRequestCompletedArgs(WebRequestStatus.WebException));
            }
        }
        catch
        {
            if (currentRequest.Callback != null)
            {
                currentRequest.Callback(new WebRequestCompletedArgs(WebRequestStatus.BeginWebRequestGeneralError));
            }
        }
        //
        if (WebRequest != null)
        {
            if (requests.Count > 0)
                requests.RemoveAt(0);
        }
    }

    void RequestCompleted(QueueRequest request, string responseString)
    {
        if (request.Callback != null)
        {
            request.Callback(new WebRequestCompletedArgs(responseString));
        }
    }

    void FinishWebRequest(IAsyncResult result)
    {
        HTTPRequestQueue ptr = (HTTPRequestQueue)result.AsyncState;

        if (currentStatus == QueueStatus.Stopped)
        {
            ptr.WebRequest = null; //Queue is been stopped 
            return;
        }

        HttpWebRequest request = (HttpWebRequest)ptr.WebRequest;
        HttpWebResponse response = null;
        Stream streamResponse = null;
        StreamReader streamRead = null;
        WebRequestStatus status = WebRequestStatus.Completed;

        bool requestSuccess = true;

        try
        {
            // End the operation
            response = (HttpWebResponse)request.EndGetResponse(result);
            streamResponse = response.GetResponseStream();
            streamRead = new StreamReader(streamResponse);
            string responseString = streamRead.ReadToEnd();
            RequestCompleted(currentRequest, responseString); //Request completed succesfully

        }
        catch (WebException e)
        {
            requestSuccess = false;
            status = WebRequestStatus.WebException;
        }
        catch (Exception ex)
        {
            requestSuccess = false;
            status = WebRequestStatus.FinishWebRequestGeneralError;
        }
        finally
        {
            // Close stream objects
            if (streamResponse != null)
                streamResponse.Dispose();
            if (streamRead != null)
                streamRead.Dispose();
            if (response != null)
                response.Dispose();

            ptr.WebRequest = null;

            if (requestSuccess)
                MakeNextRequest();
            else
            {
                if (currentRequest.Callback != null)
                {
                    currentRequest.Callback(new WebRequestCompletedArgs(status));
                }
            }
        }
    }

}

Expand/Collapse Lollipop toolbar animation (Telegram app)

$
0
0

I'm trying to figure out how the expand/collapse animation of the toolbar is done. If you have a look at the Telegram app settings, you will see that there is a listview and the toolbar. When you scroll down, the toolbar collapse, and when you scroll up it expands. There is also the animation of the profile pic and the FAB. Does anyone have any clue on that?

Viewing all 91519 articles
Browse latest View live


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