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

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?


How can I add a style trigger to a RowDefiniton in xaml?

$
0
0

I have been trying to make my value of my row height update depending on if the device is portrait mode or not (set in the view model). I can't seem to find a way to add a trigger to a row definition to do this. Is there a way?

How to develop on Linux?

$
0
0

Hello,

I just installed MonoDevelop for Linux and I have no option for creating a Xamarin app project. I use Linux distribution Ubuntu and I would like to develop crossplatform mobile applications using Xamarin for Android and iOS.

I know that there is Rider by JetBrains, but it is not free, I just want to learn to code in Xamarin and make open source apps with no profit.

Adding image to StackLayout container failing if done using a local image from the .cs side

$
0
0

In my xaml file I am trying to set up a container that will house an unknown number of images, if I manually set an image inside there in the xaml file it works great:
<Image Source="Tamarin_portrait.JPG" WidthRequest="50" HeightRequest="50" Margin="10, 10, 10, 10"></Image>.

If I try to add a file from my cs side using an image online it works great:

var webImage = new Image { Source = ImageSource.FromUri(new Uri("https://xamarin.com/content/images/pages/forms/example-app.png")) }; imageContainer.Children.Add(webImage);

However if I try to add a local image to the imageContainer it fails to do so:
var locImage= new Image { Source = "Tamarin_portrait.JPG" }; //Or this way after declaring image without source-> locImage.Source = ImageSource.FromFile("Tamarin_portrait.JPG"); imageContainer.Children.Add(locImage);

I'm running it on android, and the image is located in the resources/drawable folder.

This feels like there's a simple mistake I'm making that I just don't see, can anyone shed some light on the problem?

Master Detail Page - Status Bar Problem on Android

$
0
0

I have a problem with the master detail page on Android. The drawer hides even the status bar. You can see only the icons...
I would like to have a semi transparent status bar. I have exactly the same code as in the docs.

How it looks like

What I would like to achieve

How tu use the new Device.RuntimePlatform

$
0
0

Hello, could someone help me to understand how to use the new Device.RuntimePlatform with this kind of call :

statusLayout = new StackLayout
{
Padding = new Thickness(Device.OnPlatform(10,0,0), 0, 0, 0),
Spacing = 0,
BackgroundColor = Color.Black,
HorizontalOptions = LayoutOptions.Start,
VerticalOptions = LayoutOptions.Center,
Orientation = StackOrientation.Vertical
};

I would appreciate to avoid making a really big switch case everywhere I use that.

Thanks!

Phil

How Disable Gestures (swipe l/r) of CarouselPage?

$
0
0

Hi all,

I want to use CarouselPage to have the right-to-left transition animation for page content and the header is static.
Could you please give me a solution with Xamarin form? I can't find out any ways.

Thanks.

Removing shadow from android buttons

$
0
0

suddenly my buttons started showing shadows, which they didn't before. I am not sure what caused the style to change, but I would like to just have a plain rectangle with no visual effects as buttons.

i have already tried:
forums.xamarin.com/discussion/97653/button-without-shadow
alexdunn.org/2017/05/04/xamarin-tips-overriding-android-button-shadowselevation/
i.e.:

  • Creating a custom renderer that sets the Elevation property to 0 and/or sets StateListAnimator = null.
  • Setting a buttonStyle in styles.xml:
    <style name="NoShadowButton" parent="android:style/Widget.Button"> <item name="android:stateListAnimator">@null</item> </style>
    or using Base.Widget.AppCompat.Button.Borderless

but nothing is working.

I am also not looking for 'just use TapGestureRecognizers', i'd like to use buttons, this shouldn't be such a hard problem to solve.
Anyone have any tips?

tested on android 5.0.1, xamarin.forms 2.5.0.280555


Platform specific XAML in Content Page

$
0
0

I am working on a toolbar for my app and hoping to use it in a cross platform manner. To do this I would like to be able to use a platform specific tag inside of my page content for that platform. To do this I would like to use a nice tag from the UWP, FontIcon, to set the icon for an item when using a uwp platform. I know this XAML doesn't work, but in essence what I want to do is the following "In Concept" to set the icon of a menu item command to be a glyph font icon on UWP and just use a file image source on the other platforms for now. How would I go about doing this in reality? I am not sure what the first step is.

<ContentPage.ToolbarItems>
        <ToolbarItem Name="MenuItem2" Order="Primary" Text="Add" Priority="0" Command="{Binding AddItemCommand}" >
            <ToolbarItem.Icon>
                    <On Platform="UWP">
                <FontIcon Glyph="&#xEB52;" FontFamily="Segoe MDL2 Assets" />
                </On>
                   <OnPlatform x:TypeArguments="FileImageSource" iOS="plus.png">
            </ToolbarItem.Icon>
        </ToolbarItem>
    </ContentPage.ToolbarItems>

Storing a push notifications

$
0
0

Xamarin forms or Xamarin android , how to store push notification on local database (Akavache) that notifications push from Microsoft AppCenter and displaying later for future use . Thank you Developers.

App resuming results in crash with FormsAppCompatActivity

$
0
0

I have a Xamarin Forms app, currently being built for Android. I have a MainActivity that used to extend FormsApplicationActivity, but because I want to use a custom theme I had to change it to extend FormsAppCompatActivity (see my other question: http://stackoverflow.com/questions/35754590/xamarin-forms-custom-theme-not-working).

Ever since changing from FormsApplicationActivity to FormsAppCompatActivity the app crashes whenever I switch out of the app and then back into the app. It throws an error in the App.xaml.cs class in the OnResume method, where I try to set the MainPage to a new navigation page:

protected override void OnResume()
{
    bool isRegistered = _authenticationService.IsRegistered();

    MainPage = isRegistered 
        ? new NavigationPage(new LoginPage()) 
        : new NavigationPage(new RegisterPage()); // this results in the crash
}

The error I'm getting is:

Java.Lang.IllegalStateException: Can not perform this action after
onSaveInstanceState

This is the stacktrace:

03-09 13:43:52.098 I/MonoDroid( 1243): Java.Lang.IllegalStateException: Can not perform this action after onSaveInstanceState
03-09 13:43:52.098 I/MonoDroid( 1243):   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/2098/3efa14c4/source/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Android.Runtime.JNIEnv.CallIntMethod (IntPtr jobject, IntPtr jmethod) [0x00063] in /Users/builder/data/lanes/2098/3efa14c4/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:386 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Android.Support.V4.App.FragmentTransactionInvoker.Commit () [0x00033] in <filename unknown>:0 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.SwitchContentAsync (Xamarin.Forms.Page view, Boolean animated, Boolean removed, Boolean popToRoot) [0x000e1] in <filename unknown>:0 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.OnPushAsync (Xamarin.Forms.Page view, Boolean animated) [0x00000] in <filename unknown>:0 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.PushViewAsync (Xamarin.Forms.Page page, Boolean animated) [0x00000] in <filename unknown>:0 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.<OnElementChanged>b__13_0 (Xamarin.Forms.Page p) [0x00000] in <filename unknown>:0 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Xamarin.Forms.EnumerableExtensions.ForEach[T] (IEnumerable`1 enumeration, System.Action`1 action) [0x00010] in <filename unknown>:0 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs`1 e) [0x001af] in <filename unknown>:0 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].SetElement (Xamarin.Forms.Platform.Android.TElement element) [0x000fc] in <filename unknown>:0 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x00027] in <filename unknown>:0 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Xamarin.Forms.Platform.Android.Platform.CreateRenderer (Xamarin.Forms.VisualElement element) [0x0001f] in <filename unknown>:0 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Xamarin.Forms.Platform.Android.RendererFactory.GetRenderer (Xamarin.Forms.VisualElement view) [0x00000] in <filename unknown>:0 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Xamarin.Forms.Platform.Android.AppCompat.Platform.AddChild (Xamarin.Forms.Page page, Boolean layout) [0x00015] in <filename unknown>:0 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Xamarin.Forms.Platform.Android.AppCompat.Platform.SetPage (Xamarin.Forms.Page newRoot) [0x00090] in <filename unknown>:0 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.InternalSetPage (Xamarin.Forms.Page page) [0x0001a] in <filename unknown>:0 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.AppOnPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs args) [0x0001e] in <filename unknown>:0 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00012] in <filename unknown>:0 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Xamarin.Forms.Application.set_MainPage (Xamarin.Forms.Page value) [0x0008b] in <filename unknown>:0 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Smartbit.App.OnResume () [0x00020] in C:\Users\leonc\Documents\Visual Studio 2015\Projects\Smartbit\Smartbit\Smartbit\App.xaml.cs:52 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Xamarin.Forms.Application.SendResume () [0x00006] in <filename unknown>:0 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnStateChanged () [0x00039] in <filename unknown>:0 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnRestart () [0x00019] in <filename unknown>:0 
03-09 13:43:52.098 I/MonoDroid( 1243):   at Android.App.Activity.n_OnRestart (IntPtr jnienv, IntPtr native__this) [0x00009] in /Users/builder/data/lanes/2098/3efa14c4/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.App.Activity.cs:4539 
03-09 13:43:52.098 I/MonoDroid( 1243):   at (wrapper dynamic-method) System.Object:cba7a870-1435-4f70-9059-e10915aba0c0 (intptr,intptr)
03-09 13:43:52.098 I/MonoDroid( 1243):   --- End of managed exception stack trace ---
03-09 13:43:52.098 I/MonoDroid( 1243): java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
03-09 13:43:52.098 I/MonoDroid( 1243):  at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1448)
03-09 13:43:52.098 I/MonoDroid( 1243):  at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1466)
03-09 13:43:52.098 I/MonoDroid( 1243):  at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:634)
03-09 13:43:52.098 I/MonoDroid( 1243):  at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:613)
03-09 13:43:52.098 I/MonoDroid( 1243):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.n_onRestart(Native Method)
03-09 13:43:52.098 I/MonoDroid( 1243):  at md5b60ffeb829f638581ab2bb9b1a7f4f3f.FormsAppCompatActivity.onRestart(FormsAppCompatActivity.java:86)
03-09 13:43:52.098 I/MonoDroid( 1243):  at android.app.Instrumentation.callActivityOnRestart(Instrumentation.java:1181)
03-09 13:43:52.098 I/MonoDroid( 1243):  at android.app.Activity.performRestart(Activity.java:5291)
03-09 13:43:52.098 I/MonoDroid( 1243):  at android.app.Activity.performResume(Activity.java:5302)
03-09 13:43:52.098 I/MonoDroid( 1243):  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2764)
03-09 13:43:52.098 I/MonoDroid( 1243):  at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2803)
03-09 13:43:52.098 I/MonoDroid( 1243):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1238)
03-09 13:43:52.098 I/MonoDroid( 1243):  at android.os.Handler.dispatchMessage(Handler.java:102)
03-09 13:43:52.098 I/MonoDroid( 1243):  at android.os.Looper.loop(Looper.java:136)
03-09 13:43:52.098 I/MonoDroid( 1243):  at android.app.ActivityThread.main(ActivityThread.java:5001)
03-09 13:43:52.098 I/MonoDroid( 1243):  at java.lang.reflect.Method.invokeNative(Native Method)
03-09 13:43:52.098 I/MonoDroid( 1243):  at java.lang.reflect.Method.invoke(Method.java:515)
03-09 13:43:52.098 I/MonoDroid( 1243):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
03-09 13:43:52.098 I/MonoDroid( 1243):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
03-09 13:43:52.098 I/MonoDroid( 1243):  at dalvik.system.NativeStart.main(Native Method)

Attribute "imageaspectratioadjust" Already Defined with Incompatible Format

$
0
0

For a day, I am facing problem when I try to build my Droid project and the above error arises. This happened after I updated my plugins and Xamarin Forms to 2.5.x.xxxx. I have made sure all projects have same Xamarin Forms version but nothing has changed. Any help from other developers? I understand I am not the first one facing the issue.
Complete error:
Severity Code Description Project File Line Suppression State
Error {Project.Path}XXXX.Droid\obj\Debug\lp\78\jl\res\values\values.xml:1: error: Attribute "imageAspectRatioAdjust" already defined with incompatible format

Problem with touch gesture recognizer in IOS

$
0
0

Hello,
I've a complex layout that is making me crazy because I'm trying to make working a tap gesture recognizer in my ios project that works fine in Android project but not in Apple one.

My layout is composed of different levels of grids, nested one inside others.

I tried with a lot of temptatives discovering that until the second level of grid I can use a tapgesture and my application receive a notification, while if I try to get a user input inside the second grid it doesn't work.

I tried with a tapgesture recognizer and with a simple button, but all the elements I have inside the second grid are not fired.
I also tried to use the InputTransparent property without success.
I also tried to create a custom rendered for the Grid where to set UserInteractionEnabled or to prevent to capture the input like explained in this thread:
https://forums.xamarin.com/discussion/55376/pass-click-tap-event-through-levels-of-relativelayout
but I wasn't able to find the right way to do it.

Can somebody point me in the right direction to have my tapgestures recognizers working in ios like they already do in Android?

Thank you

Future of Xamarin.Forms: Rendering in HTML5 and Compiling into JavaScript?

$
0
0

Hello Community,

This has been on my mind with the new year, and I just wanted to get it out there and get some discussion around it.

Currently, the vision around Xamarin.Forms is around building native UIs from a single code base. With the amazing talent of Jason Smith and team (and also of the community!), I don't think there will be any problem reaching all the target platforms in great fashion and functionality. In fact, I believe there are already community efforts around WPF and WinRT renderers for Xamarin.Forms.

The problem I have been thinking about is this: let's say I am a start-up (and I am. :)), and I am going to build an app. I would use Xamarin.Forms to reach all the target app stores. Now, my problem is... what happens when a user loads my website on their device/workstation? Websites (or web applications) are obviously rendered in HTML5/JavaScript these days. This is something that Xamarin.Forms (as awesome as it is) does not do, currently (as far as I know). And so, I have been wondering if this is a known issue, and (more importantly) a known/possible direction for Xamarin.Forms.

Ideally, we (my start-up) would have 1 single code base (as currently designed/possible with Xamarin.Forms) that has rendering projects for:

  • iOS (possible today)
  • Droid (possible today)
  • Windows Phone (possible today)
  • Windows Store (or "Universal Apps" -- not entirely possible just yet, but again as mentioned WinRT rendering is a community effort)
  • Web Application (not possible today, but would render in HTML5/JavaScript)

Then I, as a start-up, would only need 1 developer to hit all these primary target platforms. Otherwise, I would have to hire 1 Xamarin developer and 1 web application/site developer (and incur the overhead of two code bases -- precisely the problem space that Xamarin aims to solve).

As I am sure you know, a good (perfect, actually) example of a web application is Facebook. They have developed all of their native applications for the native app stores, but if you visit Facebook.com in your phone's browser, you will see a HTML5 application that does pretty much everything the native applications do (or in Windows Phone's case, even better. :P )

Has there been discussion around this? I would love to know, and sincerely apologize if there is and I am just adding to the noise.

Thank you for any discussion/feedback you can provide around this matter,
Michael

How to download a file in Xamarin Forms and store it in the device storage ?


Floating Action menu in Xamarin.Forms

$
0
0

how to create Floating Action menu in Xamarin.Forms

MVVM .NET Standard hamburger menu sample

$
0
0

Hello

Can someone please provide me with a full working example of a hamburger menu using .NET standard and MVVM pattern?

When creating a new Xamarin project in Visual Studio 2017 (15.6.2) there is the option to use a Master Detail template, however it unfortunately uses a tabbed page layout instead of a hamburger menu.

There is a Microsoft site that explains how to use a Master-Detail page "MasterDetailPageNavigation", unfortunately it is a PCL project, which is now deprecated/obsoleted. In addition the project's structure seems quite odd.
The Microsoft article explaining Master-Detail pages:
docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/navigation/master-detail-page
The download link of the project:
developer.xamarin.com/samples/xamarin-forms/Navigation/MasterDetailPage
(sorry, I am not yet allowed to post links...)

The ideal solution would look like a merge between the Visual Studio "Master Detail" template and the "MasterDetailPageNavigation" solution.
This new solution would use .NET standard, MVVM pattern and of course a hamburger menu.

On a side note:
Does anyone know why the Master Detail template in Visual Studio uses a tabbed page instead of a hamburger menu?
There seem to be a lot of apps using a hamburger menu but the ones with a tabbed view are not that common, thus it seems quite odd to chose a tabbed page intead of a hamburger menu...

Any help is much appreciated.

Kind regads

Get current page in xamarin forms

$
0
0

Hi,
I want to get the currnetpage instance inorder to handle the back button functionality in android using xamarin forms.can anyone suggest how to accomplish this?

Thanks,
sunil

ListView NullReferenceException when reseting / updating ItemSource

$
0
0

In my ViewModel I have a property called 'Objects' which is an ObservableCollection.

When I setup the ListView it is as such:

ObjectList = new ListView()
{
        IsPullToRefreshEnabled = true,
        HasUnevenRows = ViewModel.HasUnevenRows,
        RefreshCommand = ViewModel.LoadObjects,
        ItemsSource = ViewModel.Objects,
        ItemTemplate = new DataTemplate(ViewModel.ListViewItem),
        BindingContext = ViewModel
};
ObjectList.SetBinding(ListView.IsRefreshingProperty, new Binding("IsLoading"));

My ViewModel has an IsLoading property and I am making sure I'm not reloading the list while it is already being loaded via the command CanExecute:

LoadObjects = new Command(() => { ListObjects(); },() => { return !IsLoading; });

When I pull to refresh it executes the LoadObjects command.

The issue I am encountering is when I pull to refresh the list, after the 3rd or 4th time it will crash with this:

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
  at Xamarin.Forms.Platform.iOS.LabelRenderer.UpdateText () [0x00070] in <8f7e3b9d1483403590c8ab3d78cce1ac>:0 
  at Xamarin.Forms.Platform.iOS.LabelRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00097] in <8f7e3b9d1483403590c8ab3d78cce1ac>:0 
  at (wrapper delegate-invoke) <Module>:invoke_void_object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs)
  at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x0000a] in C:\agent\_work\3\s\Xamarin.Forms.Core\BindableObject.cs:137 
  at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in C:\agent\_work\3\s\Xamarin.Forms.Core\Element.cs:388 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x000f4] in C:\agent\_work\3\s\Xamarin.Forms.Core\BindableObject.cs:593 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in C:\agent\_work\3\s\Xamarin.Forms.Core\BindableObject.cs:390 
  at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x001f9] in C:\agent\_work\3\s\Xamarin.Forms.Core\BindingExpression.cs:174 
  at Xamarin.Forms.BindingExpression.Apply (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property) [0x0006b] in C:\agent\_work\3\s\Xamarin.Forms.Core\BindingExpression.cs:77 
  at Xamarin.Forms.Binding.Apply (System.Object newContext, Xamarin.Forms.BindableObject bindObj, Xamarin.Forms.BindableProperty targetProperty) [0x00042] in C:\agent\_work\3\s\Xamarin.Forms.Core\Binding.cs:126 
  at Xamarin.Forms.BindableObject.ApplyBindings (System.Boolean skipBindingContext) [0x0003b] in C:\agent\_work\3\s\Xamarin.Forms.Core\BindableObject.cs:421 
  at Xamarin.Forms.BindableObject.ApplyBindings () [0x00000] in C:\agent\_work\3\s\Xamarin.Forms.Core\BindableObject.cs:125 
  at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x0005a] in C:\agent\_work\3\s\Xamarin.Forms.Core\BindableObject.cs:119 
  at Xamarin.Forms.Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00000] in C:\agent\_work\3\s\Xamarin.Forms.Core\Element.cs:498 
  at Xamarin.Forms.Element.OnBindingContextChanged () [0x00021] in C:\agent\_work\3\s\Xamarin.Forms.Core\Element.cs:341 
  at Xamarin.Forms.View.OnBindingContextChanged () [0x00042] in C:\agent\_work\3\s\Xamarin.Forms.Core\View.cs:99 
  at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x00060] in C:\agent\_work\3\s\Xamarin.Forms.Core\BindableObject.cs:120 
  at Xamarin.Forms.Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00000] in C:\agent\_work\3\s\Xamarin.Forms.Core\Element.cs:498 
  at Xamarin.Forms.Element.OnBindingContextChanged () [0x00021] in C:\agent\_work\3\s\Xamarin.Forms.Core\Element.cs:341 
  at Xamarin.Forms.View.OnBindingContextChanged () [0x00042] in C:\agent\_work\3\s\Xamarin.Forms.Core\View.cs:99 
  at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x00060] in C:\agent\_work\3\s\Xamarin.Forms.Core\BindableObject.cs:120 
  at Xamarin.Forms.Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00000] in C:\agent\_work\3\s\Xamarin.Forms.Core\Element.cs:498 
  at Xamarin.Forms.Element.OnBindingContextChanged () [0x00021] in C:\agent\_work\3\s\Xamarin.Forms.Core\Element.cs:341 
  at Xamarin.Forms.Cell.OnBindingContextChanged () [0x00000] in C:\agent\_work\3\s\Xamarin.Forms.Core\Cells\Cell.cs:114 
  at Xamarin.Forms.BindableObject.BindingContextPropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldvalue, System.Object newvalue) [0x0000e] in C:\agent\_work\3\s\Xamarin.Forms.Core\BindableObject.cs:441 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00108] in C:\agent\_work\3\s\Xamarin.Forms.Core\BindableObject.cs:596 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in C:\agent\_work\3\s\Xamarin.Forms.Core\BindableObject.cs:390 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x0005f] in C:\agent\_work\3\s\Xamarin.Forms.Core\BindableObject.cs:543 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in C:\agent\_work\3\s\Xamarin.Forms.Core\BindableObject.cs:83 
  at Xamarin.Forms.BindableObject.set_BindingContext (System.Object value) [0x00000] in C:\agent\_work\3\s\Xamarin.Forms.Core\BindableObject.cs:24 
  at Xamarin.Forms.Internals.TemplatedItemsList`2+<UnhookItem>d__154[TView,TItem].MoveNext () [0x000b0] in C:\agent\_work\3\s\Xamarin.Forms.Core\TemplatedItemsList.cs:1217 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151 
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.2.0.11/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1018 
  at UIKit.UIKitSynchronizationContext+<Post>c__AnonStorey0.<>m__0 () [0x00000] in /Users/builder/data/lanes/5481/2f8bbec0/source/xamarin-macios/src/UIKit/UIKitSynchronizationContext.cs:24 
  at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Users/builder/data/lanes/5481/2f8bbec0/source/xamarin-macios/src/Foundation/NSAction.cs:163 
--- End of stack trace from previous location where exception was thrown ---
  at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/5481/2f8bbec0/source/xamarin-macios/src/UIKit/UIApplication.cs:79 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/5481/2f8bbec0/source/xamarin-macios/src/UIKit/UIApplication.cs:63 
  at HydrusCRM.iOS.Application.Main (System.String[] args) [0x00001] in /Volumes/Data/Apps/HydrusCRM/iOS/Main.cs:17 

Here is the code that updates the objects collection:

var result = (IList)JsonConvert.DeserializeObject(results, listType);
if (result.Count > 0)
{
    Device.BeginInvokeOnMainThread(() =>
    {
        foreach (Models.Objects.Model @object in result)
        {
        objects.Add(@object);
    }
    });
}

I am not sure where the issue is coming from as none of my apps code is in the exception stack.

Capturing and viewing traffic from iPhone device

$
0
0

I've got a xamarin forms app that is calling a webservice. For some reason the webservice is returning errors and I want to check the request that my app is making.

through the simulator it all works OK but something on the device isn't working correctly.

I've got Fiddler running on a Windows box, set it to allow remote connections and set a proxy on my iPhone WiFi connection. Got a bit of strange scenario:

Fiddler is able to capture the traffic from Safari and other apps on the phone
I've got some analytics installed and the calls to the analytics web service are being picked up
The calls to my App WebService are not being picked up in Fiddler.

Not sure what is going on, any ideas? or other suggestions on how I can view check? im not using HTTPS and the messages are reaching my webservice as i have seen it being hit in the logs.

Viewing all 77050 articles
Browse latest View live


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