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

System.ObjectDisposedException: Cannot access a disposed object. Object name: 'PrimaryToolbarItem'.

$
0
0

Application is crashing after adding the toolbar in master detail page, It is crashing if we come back from the current page and after tapping different page on master and on that page I have added toolbar icons.

{System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'PrimaryToolbarItem'.
at Foundation.NSObject.get_SuperHandle () [0x0004a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/Foundation/NSObject2.cs:456
at UIKit.UIBarButtonItem.set_Image (UIKit.UIImage value) [0x00033] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/UIBarButtonItem.g.cs:652
at Xamarin.Forms.Platform.iOS.ToolbarItemExtensions+PrimaryToolbarItem.UpdateIconAndStyle () [0x00031] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Extensions\ToolbarItemExtensions.cs:84
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__7_0 (System.Object state) [0x00000] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1021
at Foundation.NSAsyncSynchronizationContextDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/Foundation/NSAction.cs:178
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 /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/UIKit/UIApplication.cs:86
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.6.0.12/src/Xamarin.iOS/UIKit/UIApplication.cs:65
at MotorApp.iOS.Application.Main (System.String[] args) [0x00002] in /Volumes/PMTSL/Ashish/ABC/MotorCatalogApp/ABCApp/MotorApp.iOS/Main.cs:14 }


Hide TabBar on push in Xamarin.Forms

$
0
0

Did anyone manage to implement hiding TabBar on push (iOS)? I found here on forum some examples, but none of them works. I managed to hide TabBar by changing its frame in custom renderer, however ListViews/TableViews have white space in place of TabBar.

Of course I could set Margin="0,0,0,-49", but I'm looking for some generic working solution.

How to handle notification click on Xamarin form ios project

$
0
0

When my Xamarin ios app is in background and I am clicking on the Push notification it is always opening the page i.e in background. Please let me know how I can open another app page on clicking push notifications. when I am clicking on notification public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, Action completionHandler)
{
}
event is called but I am not able to redirect to another app page.

Xamarin forms: Webview for playing video is not working in iPhone?

$
0
0

I am using Webview for playing video and audio and it is working fine on android and iPhone simulators. But on the real iPhone, video playing is not working fine.

For playing the video on the iPhone, I need to tap the video play button multiple times. After that also it takes a long time to play the video. Another important thing is my video links have no video format(.mp4,.mkv).

XAML

<WebView 
    x:Name="web_view"
    HeightRequest="200"
    WidthRequest="200"
    HorizontalOptions="FillAndExpand"
    VerticalOptions="FillAndExpand"/>

XAML.cs

web_view.Source = "https://player.vimeo.com/video/303543322";

I tried Plugin.MediaManager.Forms, but it needs video format(.mp4,.mkv) in the link, otherwise it will not work. So is there any way to fix this issue in webview itself or should I go for any other player(video and audio) which supports playing video without video format?

horizontal collectionview inside the horizontal collection view

$
0
0

Hi,

I'm using Xamarin.Forms Latest version
and using collection view for binding the repeated tiles in my project

i'm using horizontal collectionview inside the horizontal collection view and that creates a laggy scrolling in that

Get device region in xamarin forms.

$
0
0

How can I get the device region (not the device language) of a device?

both
var region = RegionInfo.CurrentRegion.ToString().ToUpper();
and
var r = System.Globalization.CultureInfo.CurrentUICulture.Name;
doesn't return the region.

Thanks

How to Play Youtube Video using youtube url in xamarin forms?

$
0
0

Hlo Everyone,

I want to play youtube video play in Video Player using youtube url in Xamarin forms without using webview .

Why don't set image from url?

$
0
0

Don't set image from url. Permission INTERNET is enabled, i already deleted bin and obj files. No errors.
Image.Source = "site.com/image.png"


Developing FCM Push notifications in Xamarin.Forms

$
0
0

I have already developed push notifications for Xamarin.Android & Xamari.iOS. How can this help me to develop notifications in Xamarin.Forms?

How to implement ShimmerLayout in Xamarin Forms ?

Local Notifications for a Cross Platform app

$
0
0

Hi All,

I'm am learning Xamarin.Forms and have been at it for just over a week now, and i should just say that these are my first steps into app development using Xamarin.

I want to write a cross platform app so I can release on Android as well as iOS, but I'd also like to use the Xamarin.iOS local notification system. I dont even know if Android has such a thing, but if it does, I'd like to use that too.

I found this guide on how to do this (for iOS) using Xamarin.iOS and even got the example working on my PC/MacBookPro combination using Visual Studio 2017 on my PC, and must say the code looks a little alien to me, and doesn't reflect the Xamarin.Forms way of doing things at all.

Is there a simple way of re-engineering an example (this one in particular) from Xamarin.iOS to Xamarin.Forms?

Also Are there any good guides out there on how to replicate this for Android using Xamarin.Forms?

The guide I followed is shown below, and is a https link... (The link may or may not work, Apparently I'm too green to post links yet)

developer.xamarin.com/guides/ios/platform_features/user-notifications/deprecated/local_notifications_in_ios_walkthrough/

How do i download a string from a url in Xamarin.Forms

$
0
0

I previously managed to download a string in Xamarin.Android like this:
using (WebClient client = new WebClient()) { var TheString = client.DownloadString("http://www.topentwelonline.nl/json/news.json"); }
but WebClient isn't supported in xamarin.forms, so how can i achieve this?

Getting Mono.AndroidTools.RequiresUninstallException on Android

$
0
0

Today I started getting this deployment error on android:

Severity Code Description Project File Line Suppression State
Error ADB0030: Mono.AndroidTools.RequiresUninstallException: The installed package is incompatible. Please manually uninstall and try again.
at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) in E:\A_work\267\s\External\androidtools\Mono.AndroidTools\Internal\AdbOutputParsing.cs:line 339
at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass95_0.b__0(Task1 t) in E:\A\_work\267\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:line 753 at System.Threading.Tasks.ContinuationTaskFromResultTask1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at AndroidDeviceExtensions.d__11.MoveNext() in E:\A_work\267\s\External\androidtools\Xamarin.AndroidTools\Devices\AndroidDeviceExtensions.cs:line 187
--- End of stack trace from previous location where exception was thrown ---
at AndroidDeviceExtensions.d__11.MoveNext() in E:\A_work\267\s\External\androidtools\Xamarin.AndroidTools\Devices\AndroidDeviceExtensions.cs:line 194
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at AndroidDeviceExtensions.d__11.MoveNext() in E:\A_work\267\s\External\androidtools\Xamarin.AndroidTools\Devices\AndroidDeviceExtensions.cs:line 203
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Xamarin.AndroidTools.AndroidDeploySession.d__112.MoveNext() in E:\A_work\267\s\External\androidtools\Xamarin.AndroidTools\Sessions\AndroidDeploySession.cs:line 414
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Xamarin.AndroidTools.AndroidDeploySession.d__106.MoveNext() in E:\A_work\267\s\External\androidtools\Xamarin.AndroidTools\Sessions\AndroidDeploySession.cs:line 217
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Xamarin.AndroidTools.AndroidDeploySession.d__104.MoveNext() in E:\A_work\267\s\External\androidtools\Xamarin.AndroidTools\Sessions\AndroidDeploySession.cs:line 119 0

It only happens in Debug, but in Release i can deploy and run the app just fine.
Why is this happening?

This morning i installed the Android SDK 10.0 and I suspect it started after that, so now I uninstalled it, but I still can't deploy because of the same error.
Other apps from the same PC can be deployed just fine, so I don't get it...

I did check this out
https://docs.microsoft.com/en-us/xamarin/android/errors-and-warnings/adb0030

but I don't even have my app installed on the device...

Thanks

Advanced map pin customization

$
0
0

I need to create a custom pin that has BorderColor, FillColor and Text properties as shown:

can it be designed and shared via SkiaSharp, or I have to design it for each platform?

more detail on how it can be created is greatly appreciated!

SQLite Extensions - Relations to different Databases

$
0
0

Hello,

I am new to SQLite and at the moment I am settings up one database with multiple tables and their relations, which works quite well, for example:

  public class ClassA
 {
[PrimaryKey, AutoIncrement]
public int ID { get; set; }

public string Version { get; set; }

[ForeignKey(typeof(ClassB))]
public int ClassBID { get; set; }
[OneToOne]
public ClassB InstanceB{ get; set; }
 }

 public class ClassB
 {
[PrimaryKey, AutoIncrement]
public int ID { get; set; }

public string Name { get; set; }
  }

   SQLiteConnection db = new SQLiteConnection(dbPath);

   db.CreateTable<ClassA>();
   db.CreateTable<ClassB>();

   ClassA instanceA = new ClassA();
   db.Insert(instanceA);

   ClassB instanceB = new ClassB();
   db.Insert(instanceB);

   instanceA.InstanceB = instanceB;

   db.UpdateWithChildren(instanceA);

This works and all tables are in the same DB.

But what if I wanted to relate to an entry in another database. Assume that the ClassB table was in a different database than the ClassA table.
Could I wire all up in a similar way? I habe read about the ATTACH command, but does the SQLite Extensions Syntax support this?


UITest iOS DeviceAgentException Unable to end session A task was canceled

$
0
0

I am seeing a similar problem as posted in the now read only Test Cloud forum. Running UI Tests on physical iOS devices causes the following error when switching between tests:

SetUp : Xamarin.UITest.XDB.Exceptions.DeviceAgentException : Unable to end session: A task was canceled.
  ----> System.Threading.Tasks.TaskCanceledException : A task was canceled.

I can run iOS simulators no problem but a physical device causes this error when it ends the first test and then attempts to do the second test. Has anyone else run into this problem? I can run each test individually just not successively in a single run.

Xamarin.UITest: v2.2.6
Test Server version: 0.21.7

Subscribing and Unsubscribing from notificiationhub with tags in xamarin

$
0
0

I am currently developing an App in Xamarin.Forms that recieves multiple notifications from notificiationhub for Android and UWP.

each notification has a tag that correspondent to a production line ID. My backend API has a hangfirejob that checks for the new entries in the database.

Recieving notifications is fine,but the users for the app do not need to recieve ALL notificiations.
Instead they can select in the app from which production line they want to see production stops.

Is there a way that i can select which notifications i want to recieve from a switch in Xamarin.Forms with these switches?

I tried to Unregister and register new tags each time the user made his selection, but the documentation of FCM state that you rarely have to unregister notificationschannel from an app. which also did not work with this code...

 public void ReRegisterToNotificationsHub(string token)
        {
            hub = new NotificationHub(AppSettingValues.NotificationHubName, AppSettingValues.ListenConnectionString, this);
            hub.UnregisterAll(token);
            var tags = GetLineValueKeysFromAppSetting();
            var register = hub.Register(token, tags);
            var regID = register.RegistrationId;
        }

Is there any other way that i can choose that i can filter the notifications to those that only has selected a line.
Can i dynamically reset my tags in a way without registering back or something?

Thanks in advance.

How can I read a RFID card in my Xamarin.Forms Application?

$
0
0

Hi guys, how can I read a RFID card in my Xamarin.Form Application?
In the end, I want to read this card over an android tablet.
Thanks.

Shell TabBar as Child Item

$
0
0

I'm currently creating an app with a different kind of login flow. Normally after the login page is closed and the main app pages are shown the login page isn't needed anymore. But in this use-case it should be very easy to change the current user. Also the user should sign in everytime the app starts.

So I want the login page to be on the top of the pages hierarchy and all other pages to be below this, so I can use the back button to easily go back to the login page. My idea is something like this: After the login page I want to get a tabbed view that shows my pages 1 to 3 and at the top of the tabbed view the navigation bar should be shown with a back button with which I can navigate back to the login page. A flyout is neither necessary nor wanted.
This would result in a hierarchy similar to this:

  • LoginPage
    • TabBar/TabbedPage/whatever
      • Page 1
      • Page 2
      • Page 3

How do I have to specify this in the AppShell.xaml. I just can't get it to work no matter how I do it.

How to show the Toolbox control after install the NuGet package in Xamarin platform

$
0
0

Hi

I am trying to add the Toolbox controls along with default Microsoft Visual Studio toolbox window for Xamarin, after install the Custom NuGet packages instead of install the custom Tool Box Extension since the toolbox has been enable for the Xaml pages.

I have tried add the tools folder with the VisualStudioToolSDKmanifest.xml file along with my sample NuGet package. But don't have luck. The controls are showing in the default Visual Studio Xamarin Toolbox. But I can't drag and Drop the control in the XAML file since the controls are disabled in the toolbox window.

The above method has been worked on the WPF and UWP Xaml pages. But not working in the Xamarin project xaml pages.

Is there any problem in xamarin XAML file to show the toolbox control through the NuGet packages?
Could you please any one suggestion to achieve this?

Thanks,
Ganesan R.

Viewing all 77050 articles
Browse latest View live


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