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

button back to my app in the background and when you resume it starts again

$
0
0

I am developing an app in Xamarin.Forms, before I was trying to make a master detail page to become my MainPage when I logged in to my app, this I have already achieved. Now I have the problem that when I use the button behind the phone my app is miimiza and goes to the background which is the behavior I hope, but when I return to my app does not continue showing my master detail page, but returns to my LginPage.

It is as if my app was running twice or at least there were two instances of LoginPage existing at the same time, this is because in my LoginPage I trigger some DisplayAlert according to some messages that my page is listening through the MessaginCenter and they are they shoot twice.

Can someone tell me how I can return the same to my app on the master detail page and not restart in the strange way described?
Thanks.


Need help debugging random crashes in GridCalc.cs

$
0
0

Hi, it's been a year or so that im getting random crashes in GridCalc, totally fail to repro, making it impossible for me to avoid. It's just random, on both iOS and Android, whatever forms version, being on latest atm.
Even worse, I cant seem to match Xamarin open source code i can find in inet with stacktrace lines numbers.
If anyone could could give me a direction to dig in, would be grateful for any clue:

12-12 16:08:53.456 I/MonoDroid( 7446): UNHANDLED EXCEPTION:
Thread started: <Thread Pool> #13
12-12 16:08:53.776 I/MonoDroid( 7446): System.NullReferenceException: Object reference not set to an instance of an object.
12-12 16:08:53.777 I/MonoDroid( 7446):   at Xamarin.Forms.Grid.MeasureStarredRows () [0x0017c] in D:\a\1\s\Xamarin.Forms.Core\GridCalc.cs:530 
12-12 16:08:53.777 I/MonoDroid( 7446):   at Xamarin.Forms.Grid.MeasureAndContractStarredRows (System.Double width, System.Double height, System.Double totalStarsHeight) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\GridCalc.cs:403 
12-12 16:08:53.778 I/MonoDroid( 7446):   at Xamarin.Forms.Grid.MeasureGrid (System.Double width, System.Double height, System.Boolean requestSize) [0x00117] in D:\a\1\s\Xamarin.Forms.Core\GridCalc.cs:510 
12-12 16:08:53.778 I/MonoDroid( 7446):   at Xamarin.Forms.Grid.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x0002a] in D:\a\1\s\Xamarin.Forms.Core\GridCalc.cs:58 
12-12 16:08:53.778 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:760 
12-12 16:08:53.778 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:642 
12-12 16:08:53.779 I/MonoDroid( 7446):   at Xamarin.Forms.Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:131 
12-12 16:08:53.779 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:700 
12-12 16:08:53.779 I/MonoDroid( 7446):   at Xamarin.Forms.StackLayout.CalculateNaiveLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, Xamarin.Forms.StackOrientation orientation, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint) [0x00236] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:198 
12-12 16:08:53.779 I/MonoDroid( 7446):   at Xamarin.Forms.StackLayout.CalculateLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint, System.Boolean processExpanders) [0x00058] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:123 
12-12 16:08:53.779 I/MonoDroid( 7446):   at Xamarin.Forms.StackLayout.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00019] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:80 
12-12 16:08:53.779 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:760 
12-12 16:08:53.779 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:642 
12-12 16:08:53.779 I/MonoDroid( 7446):   at Xamarin.Forms.Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:131 
12-12 16:08:53.780 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:700 
12-12 16:08:53.780 I/MonoDroid( 7446):   at Xamarin.Forms.StackLayout.CalculateNaiveLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, Xamarin.Forms.StackOrientation orientation, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint) [0x00236] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:198 
12-12 16:08:53.783 I/MonoDroid( 7446):   at Xamarin.Forms.StackLayout.CalculateLayout (Xamarin.Forms.StackLayout+LayoutInformation layout, System.Double x, System.Double y, System.Double widthConstraint, System.Double heightConstraint, System.Boolean processExpanders) [0x00058] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:123 
12-12 16:08:53.783 I/MonoDroid( 7446):   at Xamarin.Forms.StackLayout.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00019] in D:\a\1\s\Xamarin.Forms.Core\StackLayout.cs:80 
12-12 16:08:53.784 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:760 
12-12 16:08:53.784 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:642 
12-12 16:08:53.784 I/MonoDroid( 7446):   at Xamarin.Forms.Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:131 
12-12 16:08:53.784 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:700 
12-12 16:08:53.784 I/MonoDroid( 7446):   at Xamarin.Forms.ScrollView.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x0005d] in D:\a\1\s\Xamarin.Forms.Core\ScrollView.cs:233 
12-12 16:08:53.784 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:760 
12-12 16:08:53.784 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:642 
12-12 16:08:53.785 I/MonoDroid( 7446):   at Xamarin.Forms.Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:131 
12-12 16:08:53.785 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:700 
12-12 16:08:53.785 I/MonoDroid( 7446):   at Xamarin.Forms.TemplatedView.OnSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x0003c] in D:\a\1\s\Xamarin.Forms.Core\TemplatedView.cs:39 
12-12 16:08:53.785 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.OnMeasure (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:760 
12-12 16:08:53.785 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00053] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:642 
12-12 16:08:53.785 I/MonoDroid( 7446):   at Xamarin.Forms.Layout.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:131 
12-12 16:08:53.786 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.Measure (System.Double widthConstraint, System.Double heightConstraint, Xamarin.Forms.MeasureFlags flags) [0x00054] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:700 
12-12 16:08:53.786 I/MonoDroid( 7446):   at Xamarin.Forms.Layout.LayoutChildIntoBoundingRegion (Xamarin.Forms.VisualElement child, Xamarin.Forms.Rectangle region) [0x00110] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:165 
12-12 16:08:53.786 I/MonoDroid( 7446):   at Xamarin.Forms.AbsoluteLayout.LayoutChildren (System.Double x, System.Double y, System.Double width, System.Double height) [0x00046] in D:\a\1\s\Xamarin.Forms.Core\AbsoluteLayout.cs:69 
12-12 16:08:53.787 I/MonoDroid( 7446):   at Xamarin.Forms.Layout.UpdateChildrenLayout () [0x0014b] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:263 
12-12 16:08:53.787 I/MonoDroid( 7446):   at Xamarin.Forms.Layout.OnSizeAllocated (System.Double width, System.Double height) [0x0000f] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:223 
12-12 16:08:53.787 I/MonoDroid( 7446):   at Xamarin.Forms.VisualElement.SizeAllocated (System.Double width, System.Double height) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:798 
12-12 16:08:53.787 I/MonoDroid( 7446):   at Xamarin.Forms.Layout+<>c.<OnChildMeasureInvalidated>b__45_0 () [0x00080] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:380 
12-12 16:08:53.787 I/MonoDroid( 7446):   at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <ad2f15102b3a4d36b40e9b0cbc11c376>:0 
12-12 16:08:53.788 I/MonoDroid( 7446):   at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <ad2f15102b3a4d36b40e9b0cbc11c376>:0 

PK Phoo

$
0
0

I want to class Content page class from Android .cs Class.
I use StartActivity(new Intent(Application.Context, typeof(LoginPage)));
showing error message
"System.ArgumentException: type
Parameter name: Type is not derived from a java type
"
Someone knows the sloution??Hlep me.

How to remove blank space from scrollable tab menu?

$
0
0

I want scroll-able tabs in my xamarin.forms .net standard project. So i have set the tab mode to scrollable in Tabbar.axml file in xamarin.Android Project:

app:tabMode="scrollable" .

My issues is if there are only two tabs in entire tab menu, there is some blank space left after the last tab and all the tabs do not occupy the equal width within the screen. Does any have solution to this or better approach to make tabs scrollable in xamarin.forms.?

Position of InitializeComponent

$
0
0

I have question with regards to the position InitializeComponent in the App.xaml.cs ?

If I place InitializeComponent below the MainPage statement, the style.css styles will be be applied in all the pages. Is this a bug or work by design ? If it is a work by design then there should be a big warning in the Docs as I can cause hours or days of head banging to locate the issue.

public App()
{
InitializeComponent();

MainPage = new NavigationPage( new MyOwnPage());

}

<Application.Resources>
           <StyleSheet Source="/Assets/style.css"/>
 </Application.Resources>

Device.StartTimer async

$
0
0

Hi,

Is there any trick to use Device.StartTimer with async?

Device.StartTimer(TimeSpan.FromMinutes(1), async () =>
{
        await DisplayAlert("","","");
}

It doesn't compile: Cannot convert async lambda to delegate type Func

Any help?

Xamarin.Forms

$
0
0

Hi guys,
I'm trying to call a method in my MainPage.cs from the webview.
I read on some guide that you have to modify the manifest file specifying the intent-filter, but the error that I return is always the same:

NET::ERR_UNKNOWN_URL_SCHEME

and this is my manifest

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.ScanCustomer" android:installLocation="auto"> <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="27" /> <uses-permission android:name="android.permission.CAMERA" /> <application android:label="ScanCustomer.Android"> <activity android:name=".MyUriActivity"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="scanapp" android:host="com.companyname.ScanCustomer.MainPage" /> </intent-filter> </activity> </application> </manifest>

i call my method in webpage JS:

var tags = {
user_type: 'test'
};

window.location.href = 'ScanApp://alert?tags=tags';

and my method:

public void alert(string tags) { ..... }

Update a certain variable in code behind (xaml.cs) after an event is launched in another project.

$
0
0

Hello,

The context of the problem:

I'm developing a solution where I use the SerialPort class (System.IO.Ports) to Scan Barcodes through serial connection. This class is only available in UWP projects so I integrated this class with dependency service and I can use it from the main project. This class has an event ( DataReceivedHandler(object sender, SerialDataReceivedEventArgs e) ) which successfully launches when i scan any barcode. No problem with this.

Problem:

The problem is that when i am running the app and from a certain view i scan something, the event launches (uwp) and i don't know how to program that this scanned value actualize the entry variable (in an xaml.cs file) I was when the event was triggered.

Any idea? I'm really stucked here

Thanks!


Upgarding to xamarin forms nightly version causes null reference exception

$
0
0

We have created a custom control and used customrender for converting it forms to native. We faced null reference exception only when using the 3.5.0.979221-nightly version and it works fine when using 3.3.0.912540. On further analysis we found that the null reference exception occurs in all Xamarin forms nightly version. Can any one please explain the difference between the Xamarin forms nightly version and normal xamarin forms version. We don't know what the reason for this. Could anyone please help to resolve the issue. The sample code is given below

public static IVisualElementRenderer Convert(Xamarin.Forms.View source, Xamarin.Forms.VisualElement valid)
{
IVisualElementRenderer render = (IVisualElementRenderer)source.GetValue(RendererProperty);
if (render == null)
{
render = Platform.CreateRenderer(source);
source.SetValue(RendererProperty, render);
var p = PlatformProperty.GetValue(valid);
PlatformProperty.SetValue(source, p);
IsPlatformEnabledProperty.SetValue(source, true);
}

        return render;
    }

I have also attached the image showing the issue.

Binding to an element of an array (or List)

$
0
0

After much googling, I haven't found an answer to this.

I have an array of colors. I want to bind a Button's BorderColor to a specific element within an array.
What is the syntax to achieve this?

Xaml:

 BorderColor="{Binding ButtonColors[11], Converter={Services:ByteToBorderColourConverter}}"

ViewModel:

private List<byte> buttoncolors;

public List<Byte> ButtonColors
    {
        get => buttoncolors;
        set
        {
            buttoncolors = value;
            OnPropertyChanged();
        }
    }

...

ButtonColors[11] = (Byte)Data[3];

I've also tried implementing this with List, but it also doesn't work.
I think the xaml binding syntax is incorrect maybe?

Weird behavior when using MasterDetailPage ToolbarItems navigate to other pages

$
0
0

Hi guys, recently I met a problem when I am trying to navigate from MasterDetailPage to another pages via ToolbarItems.

Btw, sorry for my bad english ah...

Here is the first image which before I perform navigating, it working fine.

Here is the second image which after I perform navigating, as you can see the ToolbarItems "fly" to the top left corner.

I will really appreciate if you guys can help me out from this. Thanks a lot guys :smile:

MasterDetailPage XAML Coding
<MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="AMC.Common.pgeMainPage" xmlns:pages="clr-namespace:AMC.Common;assembly=AMC.Common"> <MasterDetailPage.ToolbarItems> <ToolbarItem Name="tbiQRScanner" Order="Primary" Icon="ic_action_scan.png" Priority="0" Clicked="tbiQRScanner_Activated" /> <ToolbarItem Name="tbiAuthenticator" Order="Secondary" Text="Authenticator" Priority="1" Clicked="tbiAuthenticator_Activated" /> <ToolbarItem Name="tbiActivation" Order="Secondary" Text="Activation" Priority="1" Clicked="tbiActivation_Activated" /> </MasterDetailPage.ToolbarItems> <MasterDetailPage.Master> <pages:pgeMainPageMaster x:Name="MasterPage" /> </MasterDetailPage.Master> <MasterDetailPage.Detail> <pages:pgeMainPageDetail /> </MasterDetailPage.Detail> </MasterDetailPage>

MasterDetailPage Behind Coding
`public pgeMainPage()
{
InitializeComponent();
MasterPage.ListView.ItemSelected += ListView_ItemSelected;
}

    private void ListView_ItemSelected(object sender, SelectedItemChangedEventArgs e)
    {
        try
        {
            var item = e.SelectedItem as clsMainPageMenuItem;
            if (item == null)
                return;

            //var page = (Page)Activator.CreateInstance(item.TargetType);
            //page.Title = item.Title;
            Detail = (Page)Activator.CreateInstance(item.TargetType);
            MasterPage.ListView.SelectedItem = null;
            IsPresented = false;
        }
        catch (Exception ex)
        {
            System.Diagnostics.Debug.WriteLine("ListView_ItemSelected: " + ex.Message);
        }
    }

    private void tbiQRScanner_Activated(object sender, EventArgs e)
    {
        try
        {
            clsCommonFunction.LaunchQRScanner(this);
        }
        catch (Exception ex)
        {
            System.Diagnostics.Debug.WriteLine("tbiQRScanner_Activated: " + ex.Message);
        }
    }

    private void tbiAuthenticator_Activated(object sender, EventArgs e)
    {
        try
        {
            var objAuthenticatorPage = new pgeAuthenticator();
            NavigationPage.SetHasNavigationBar(objAuthenticatorPage, false);
            Navigation.PushAsync(objAuthenticatorPage);
        }
        catch (Exception ex)
        {
            System.Diagnostics.Debug.WriteLine("tbiAuthenticator_Activated: " + ex.Message);
        }
    }

    private void tbiActivation_Activated(object sender, EventArgs e)
    {
        try
        {
            var objActivationPage = new pgeSignUpActivation();
            NavigationPage.SetHasNavigationBar(objActivationPage, false);
            Navigation.PushAsync(objActivationPage);
        }
        catch (Exception ex)
        {
            System.Diagnostics.Debug.WriteLine("tbiActivation_Activated: " + ex.Message);
        }
    }`

Showing DISABLE_XAML_GENERATED_BINDING_DEBUG_OUTPUT when loading a page

$
0
0

Redirecting to App.g.i.cs when loading a page in xamarin UWP. Code control comes to the following if block.

#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
        UnhandledException += (sender, e) =>
        {
            if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
        };
#endif

If I mouse over the e showing {Windows.UI.Xaml.UnhandledExceptionEventArgs}

I am not understanding what is the problem? Is this related to some error in XAML? This issue is only on the windows app, Android and IOS apps parts are working fine.

Thanks in advance :)

Keyboard is not hiding when click background in xamarin forms IOS

$
0
0

In the normal case of xamarin forms ios app, the keyboard is hiding when taps on the background. Also, scrolling works perfectly when the keyboard is on.

But when the page contains listview, the keyboard is not closing when background tap and scrolling is not working in the same case.

How can I fix this issue? I need to close the keyboard when clicking the background and need scrolling feature when the keyboard is on. Attaching a screenshot having listview and keyboard.

Wait for Device.BeginInvokeOnMainThread

$
0
0

Hello,

I have an interface IPicture which I uses on Android and iOS.

I implemented with dependecy service a way to save a photo in device.

Here is my code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Foundation;
using UIKit;
using System.IO;
using System.Threading.Tasks;
using System;
using Xamarin.Forms;


[assembly: Xamarin.Forms.Dependency(typeof(MyApp.iOS.Picture_iOS))]

namespace MyApp.iOS
{
    public class Picture_iOS: IPicture
    {
        public Int16 SavePictureToDisk(string filename, byte[] imageData)
        {
            var chartImage = new UIImage (NSData.FromArray (imageData));
            Int16 response = 0;


            Device.BeginInvokeOnMainThread (() => {


                chartImage.SaveToPhotosAlbum ((image, error) => {
                    //you can retrieve the saved UI Image as well if needed using
                    //var i = image as UIImage;
                    if (error != null) {
                        Console.WriteLine (error.ToString ());
                        response = 0;
                    } else
                        response = 1;
                });
            });

            return response;
        }
    }
}

My problem is that I need it to return a Int16 as response... but just after the Device.BeginInvokeOnMainThread runs...

I can't use await because it is void...

How I can do that?

Select Multiple image from gallery in ios.

$
0
0

I have goann with ELCImagePickerController but they said install this component which is not available. Is there any other lib that i can go for multiple selection.
Thankx in advance :smile:


Xamarin Forms - Sending a large file over a TCP connection (using Socket.BeginSendFile) fails

$
0
0

I encountered a strange behavior when using the Socket.BeginSendFile method in a Xamarin Forms app on android.

When I run my app using the Visual Studio debugger (with an android phone connected over USB) and want to pass a large file (7 MB) over a TCP connection, only the first 2 MB of data are being sent. Transmission then stops.
The app functions as a TCP client. I checked with Wireshark and the TCP packets all look OK: The last 2 packets or a TCP ACK from my app (sending some data), followed by a TCP ACK from the server. The socket remains active.

When I run the app without the debugger (directly from a smartphone) the error doesn't seem to occur. The complete 7 MB of data is being transmitted.

I use Socket.BeginSendFile because that gives the highest throughput. When I do the exchange with 'normal' Socket.BeginSend calls (and my own file stream and reader code) the error never pops up, but throughput is bad. Transfer speed is about 40 times less than with Socket.BeginSendFile.

Is there anyone who can shed some light on this? The issue is probably in the Mono runtime since only System.Net.Sockets is being involved.

how to create a straight line between 2 StackLayouts? just to Separate

$
0
0

So i am looking for a separator ! in order to separate 2 views . for example 2 layouts. Any ideas? (.cs)

Custom Renderer erroneously instantiated multiple times

$
0
0

I have a Master-Detail pattern Xamarin Forms app in which the landing detail page has a HybridWebView in it.

On iOS, I have created a custom renderer for that Xamarin Forms HybridWebView.

The problem is that every time I leave the page by clicking a Master item, and then come back into this page, that an additional instance of the custom renderer is created: I've proven this because I create an ID for each renderer in it's constructor, when it is created.

Because both are bound to a Uri in the viewmodel, they both make a call to the uri.

Of course the user sees only one, but I need to stop this behaviour!

Any ideas how this is occurring?

Kind regards,

Anthony

The renderer is a WKWebView, btw!

Low Performance with Sycfusion SfDataGrid scroll

$
0
0

Hi,

I'm using a Syncfusion SfDataGrid on my Xamarin.Forms app, but I have low performaces when I scroll.
I've check the % of CPU used it's stay at ~25%.

I don't know if it's a recurent problem but I find nobody with the same problem.
Have somebody any solution?

Can debug on simulator but CANT run app in debug on device and app quits in release with this error:

$
0
0

Guys I do not know what happened but this error came up when running app in debug, I updated eveyrthing including windows and visual studio to all the latest updates as of 11 Dec 2018. What is going on??

UPDATE: App debugging in simulator works perfectly fine.
I just cannot debug, or run on device. It just quits with the error below:

2018-12-11 14:56:45.424 MyApp.iOS[1352:236793] Token received: <c888863b cb362ba8 3028fa09 ea6171ce e88231e3 f1d5f6a3 071e47aa 1b2511e3>
Thread started:  #9
Thread started: <Thread Pool> #10
Thread started: <Thread Pool> #11
Thread started: <Thread Pool> #12
Thread started: <Thread Pool> #13
Thread started: <Thread Pool> #14
2018-12-11 14:56:46.014 MyApp.iOS[1352:236793] <!DOCTYPE html>
<html>
    <head>
        <title>The resource cannot be found.</title>
        <meta name="viewport" content="width=device-width" />
        <style>
         body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} 
         p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
         b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
         H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
         H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
         pre {font-family:"Consolas","Lucida Console",Monospace;font-size:11pt;margin:0;padding:0.5em;line-height:14pt}
         .marker {font-weight: bold; color: black;text-decoration: none;}
         .version {color: gray;}
         .error {margin-bottom: 10px;}
         .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }

@media screen and (max-width: 639px) {
          pre { width: 440px; overflow: auto; white-space: pre-wrap; word-wrap: break-word; }
         }
         @media screen and (max-width: 479px) {
          pre { width: 280px; }
         }
        </style>
    </head>

    <body bgcolor="white">

            <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

            <h2> <i>The resource cannot be found.</i> </h2></span>

            <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

            <b> Description: </b>HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. &nbsp;Please review the following URL and make sure that it is spelled correctly.
            <br><br>

            <b> Requested URL: </b>/push/installations/e99787d6-f94e-4ddf-888d-9b4e8e680bdd<br><br>

            <hr width=100% size=1 color=silver>

            <b>Version I
The app has been terminated.
llback cb, Object extraData)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.<>c__DisplayClass285_0.<ExecuteStepImpl>b__0()
   at System.Web.HttpApplication.StepInvoker.Invoke(Action executionStep)
   at System.Web.HttpApplication.StepInvoker.<>c__DisplayClass4_0.<Invoke>b__0()
   at Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule.OnExecuteRequestStep(HttpContextBase context, Action step)
   at System.Web.HttpApplication.<>c__DisplayClass284_0.<OnExecuteRequestStep>b__0(Action nextStepAction)
   at System.Web.HttpApplication.StepInvoker.Invoke(Action executionStep)
   at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
--><!-- 
This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using &lt;customErrors mode="Off"/
nformation:</b>&nbsp;Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3163.0

            </font>

    </body>
</html>
<!-- 
[HttpException]: The controller for path &#39;/push/installations/e99787d6-f94e-4ddf-888d-9b4e8e680bdd&#39; was not found or does not implement IController.
   at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType)
   at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName)
   at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory)
   at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
   at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state)
   at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCa
&gt;. Consider using &lt;customErrors mode="On"/&gt; or &lt;customErrors mode="RemoteOnly"/&gt; in production environments.-->
Failed to Stop app:  An error occured on client IDB412377 while executing a reply for topic xvs/idb/4.12.3.77/stop-app
The app has been terminated.
Viewing all 91519 articles
Browse latest View live