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

HybridWebView sample with local html file as embedded resource in NetStandard class library

$
0
0

Can anyone help me with a HybridWebView sample able to open a local html file, available as embedded resource in a referenced NetStandard class library ?


MasterDetailPage - page data is lost when navigated to another detail page

$
0
0

I have an MD page with 3 detail pages (of which each of them are of type ContentPage)

The problem I have now is that when the user navigates to another detail page, the data on the current page are lost (which is not fine) and when the user goes back to that page, it's like it's initialised all over again (which is fine)

Now, I am looking to find a way to raise an event on the detail page to realise when the page is left so that I can save data accordingly.

I know how to do it on the MasterDetailPage by accessing an event:

MasterPage.ListView.ItemSelected += ListView_ItemSelected;

but I need to raise this event on the detail page itself so I can save data first.

Thanks

How to use ffmpeg to compress video in xamarin.fomrs

$
0
0

i want to compress and resize my video with ffmpeg, but i don't know how to use it...please help me.thanks

System.TypeInitializationException error when using NavigationPage

$
0
0

I'm on Xamarin.Forms version 2.3.2.127.

Anytime I seem to wrap my content pages in a NavigationPage I get the following error:

"System.TypeInitializationException: The type initializer for 'Attribute' threw an exception."

Even using something as simple will throwthe error, such as:
protected override void OnStart() { MainPage = new NavigationPage(new SimplePage()); }

Where simplePage is:

<?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="SimpleApp.SimplePage"> <Label Text="{Binding MainText}" VerticalOptions="Center" HorizontalOptions="Center" /> </ContentPage>

namespace SimpleApp { public partial class SimplePage : ContentPage { public test() { InitializeComponent(); } } }

Any help is appreciated, I'm not really sure how to proceed from here.

xamarin for beginners

$
0
0

Hey. I have experience for 3 years with with Swift, java and last year with React Native. Anyway I want to learn some Xamarin.forms.

What is your best resources for learning xamarin.forms?

Xamarin university is not a option...

Thank you for you possitive reply

M.

AppResources.Designer.cs is not re-generated after upgrade PCL -> NETSTANDARD 2.0

$
0
0

Finally I upgraded my App from PCL -> NETSTANDARD 2.0.
All went fine, app runs fine, it uses string resources fine.

Now I added a new string resource to AppResources.resx (with the VS built in grid resource editor), but the AppResources.Designer.cs is not re-generated, so I could not use the new string in my code:
error CS0117: 'AppResources' does not contain a definition for 'IDS_NEWSTRING'

Tried re-build, etc.

How to "ask" VS2017 (win)/Xamarin NETSTANDARD 2.0 to re-generate those AppResources.$LANG$.Designer.cs files?

create a view above the navigation & status Bar on Xamarin.Forms?

$
0
0

Hello World,

I tried to write a view on top of the screen with a RelativeLayout or ModalViews,
it wasn't working cause both doesn't include Navigation & Status Bar on their layout.

Do you know any implementation to displaying a view on top of all existed views?

Maybe I will have to create a blank view in natives environments, hope it will be possible to add it's content from PCL
Could you maybe guide me to start? Which class to extend in both environnement?

Thnaks by advance,

How to manage this decimal input?

$
0
0

here while input number then first it will add into decimal then it moved to left
How to create this?


System.IO.IOException: Sharing violation on path PropertyStore.forms

$
0
0

Hi,

On my android app, when i hit the home button or back button or try to take a picture with the Plugin.Media, i get the following error:
UNHANDLED EXCEPTION:
System.AggregateException: One or more errors occurred. ---> System.IO.IOException: Sharing violation on path PropertyStore.forms
at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0026d] in /Users/builder/data/lanes/4468/f913a78a/source/mono/mcs/class/corlib/System.IO/FileStream.cs:249
at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean isAsync, System.Boolean anonymous) [0x00000] in /Users/builder/data/lanes/4468/f913a78a/source/mono/mcs/class/corlib/System.IO/FileStream.cs:149
at System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.IsolatedStorage.IsolatedStorageFile isf) [0x00000] in /Users/builder/data/lanes/4468/f913a78a/source/mono/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFileStream.cs:127
at System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.IsolatedStorage.IsolatedStorageFile isf) [0x00000] in /Users/builder/data/lanes/4468/f913a78a/source/mono/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFileStream.cs:142
at (wrapper remoting-invoke-with-check) System.IO.IsolatedStorage.IsolatedStorageFileStream:.ctor (string,System.IO.FileMode,System.IO.IsolatedStorage.IsolatedStorageFile)
at System.IO.IsolatedStorage.IsolatedStorageFile.OpenFile (System.String path, System.IO.FileMode mode) [0x00000] in /Users/builder/data/lanes/4468/f913a78a/source/mono/mcs/class/corlib/System.IO.IsolatedStorage/IsolatedStorageFile.cs:908
at (wrapper remoting-invoke-with-check) System.IO.IsolatedStorage.IsolatedStorageFile:OpenFile (string,System.IO.FileMode)
at Xamarin.Forms.Platform.Android.Deserializer+<>c.b__1_0 () [0x00006] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\Deserializer.cs:22
at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x00012] in /Users/builder/data/lanes/4468/f913a78a/source/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/Future.cs:680
at System.Threading.Tasks.Task.Execute () [0x00016] in /Users/builder/data/lanes/4468/f913a78a/source/mono/mcs/class/referencesource/mscorlib/system/threading/Tasks/Task.cs:2502

i cant understat according to this callstack what is theorigion of the error,
but if some one had the same exception and found a solution i ll be happy to hear for a solution.

System.IO.IOException: Invalid handle to path "PropertyStore.forms"

$
0
0

Hi,
I have an Android App built with Xamarin.forms. Everyday, HockeyApp reports crashes with the exact same error:
System.IO.IOException: Invalid handle to path "PropertyStore.forms" at System.IO.FileStream..ctor(System.String_path__FileMode_mode__FileAccess_access__FileShare_share__Int32_bufferSize__Boolean_anonymous__FileOptions_options.args:1337) at System.IO.FileStream..ctor(System.String_path__FileMode_mode__FileAccess_access__FileShare_share__Int32_bufferSize__Boolean_isAsync__Boolean_anonymous.args:1337) at System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor(System.String_path__FileMode_mode__FileAccess_access__FileShare_share__Int32_bufferSize__System.IO.IsolatedStorage.IsolatedStorageFile_isf.args:1337) at System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor(System.String_path__FileMode_mode__System.IO.IsolatedStorage.IsolatedStorageFile_isf.args:1337) at com.algodesign.tagpunch.edStorage.IsolatedStorageFileStream:.ctor(string_System.IO.FileMode_System.IO.IsolatedStorage.IsolatedStorageFile.args:1337) at System.IO.IsolatedStorage.IsolatedStorageFile.OpenFile(System.String_path__FileMode_mode.args:1337) at com.algodesign.tagpunch.edStorage.IsolatedStorageFile:OpenFile(string_System.IO.FileMode.args:1337) at com.algodesign.tagpunch.Xamarin.Forms.Platform.Android.Deserializer+<>c.<DeserializePropertiesAsync>b__1_0(.args:1337) at System.Threading.Tasks.Task1[TResult].InnerInvoke(.args:1337) at System.Threading.Tasks.Task.Execute(.args:1337) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(.args:1337) at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task_task.args:1337) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task_task.args:1337) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(System.Threading.Tasks.Task_task.args:1337) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1+ConfiguredTaskAwaiter[TResult].GetResult(.args:1337) at com.algodesign.tagpunch.Xamarin.Forms.Application+<GetPropertiesAsync>d__66.MoveNext(.args:1337)

There is no explicit call to PropertyStore.forms or GetPropertiesAsync in the entire solution. Any idea how to fix or at least understand this issue? The App run on custom hardware with Kitkat 4.4.4.

Thanks for the help and have a nice day,
LP

Sharing violation on path PropertyStore.forms.tmp

$
0
0

I am seeing a huge upswing in reports of this in Insights in the past few days - seems to be mostly on Android, not iOS

the stack trace is

System.IO.FileStream.ctor(System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options)

System.IO.FileStream.ctor(System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean isAsync, Boolean anonymous)

System.IO.IsolatedStorage.IsolatedStorageFileStream.ctor(System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, System.IO.IsolatedStorage.IsolatedStorageFile isf)

System.IO.IsolatedStorage.IsolatedStorageFileStream.ctor(System.String path, FileMode mode, System.IO.IsolatedStorage.IsolatedStorageFile isf)

System.IO.IsolatedStorage.IsolatedStorageFile.OpenFile(System.String path, FileMode mode)

Xamarin.Forms.Platform.Android.Deserializer+<>c__DisplayClass3.<SerializePropertiesAsync>b__2()

System.Threading.Tasks.Task.InnerInvoke()

System.Threading.Tasks.Task.Execute()

has anyone else run across this? Any suggestions on how to handle it?

Xamarin crash when calling external APIs

$
0
0

Here is my case (that I thought was simple and common).

MainPage.xaml.cs
private void Button_clicked(...) {
// Rely on backgound thread
MessagingCenter.Subscribe<SerialLoader, SerialRec>(this, "SerialLoader", OnSerialLoaded);
// Trigger the load
serialLoader.Load(targetID);
}

private void OnSerialLoaded(...) {
Device.BeginInvokeOnMainThread(() => Navigation.PushAsync(...));
}

SerialLoader.cs
public void Load(string targetID,) {
// API service call that "forces" me to use the following
client.LoadCompleted += OnSerialLoadCompleted(sender, e);
client.LoadAsync(...) // I don't think this call is "really async" as return type is void.
}

public void OnSerialLoadCompleted(object sender, LoadCompletedEventArgs e) {
if (...) { // If loaded successfully...
// Notify the receiver that load has completed.
MessagingCenter.Send<SerialLoader, SerialRec>(this, "SerialLoader", e.Result);
}
}

OnSerialLoaded is called successfully then Xamarin crashes the application with the following errors.

EMULATOR
Closes the application without any warning nor message!

SMARTPHONE (API 21)
03-29 18:47:52.617 E/mono-rt (13649): No native Android stacktrace (see debuggerd output).
03-29 18:47:52.617 E/mono-rt (13649):
03-29 18:47:52.617 E/mono-rt (13649):
03-29 18:47:52.617 E/mono-rt (13649): =================================================================
03-29 18:47:52.617 E/mono-rt (13649): Got a SIGSEGV while executing native code. This usually indicates
03-29 18:47:52.617 E/mono-rt (13649): a fatal error in the mono runtime or one of the native libraries
03-29 18:47:52.617 E/mono-rt (13649): used by your application.
03-29 18:47:52.617 E/mono-rt (13649): =================================================================
03-29 18:47:52.617 E/mono-rt (13649):
03-29 18:47:52.617 F/libc (13649): Fatal signal 11 (SIGSEGV), code 2, fault addr 0xbe562fd0 in tid 13649 (com.s4gv.mobile)

I assume this is related to executions on multiple threads; I had tried without MessagingCenter (see my question "Xamarin crashes when mixing Action and API calls (threading concern?)").

Also, I'm surprised both the emulator and the smartphone crash so badly!

Any help is appreciated as I'm now completely stuck :(

Additional details: VS2017 Community 15.6.4 on Windows 10 Xamarin Forms 2.5.0.280555 Target Android SDK 8.1 (API 27 - Oreo)

Native Forms UWP CreateFrameworkElement() can only be used in a frame?

$
0
0

I'm doing some experimenting with Native Forms on UWP. It looks like from the samples, that the FrameworkElement that you get from ContentPage.CreateFrameworkElement() can only be placed inside a Frame. And furthermore, it looks like a Frame can only exist at the very root of the application. So this means that Xamarin Forms can only be "embedded" as only a top level (page level) form for the application, rather than in any arbitrary panel? I tried adding the FrameworkElement to a UWP StackPanel and it doesn't render. Is there a way to place the FrameworkElement from a ContentPage anywhere in your app? If not, it seems extremely limiting and almost useless. Am I missing something?

Alert Explossion in Xamarin Forms.

$
0
0

Hi,

I'm developing an application with Xamarin Forms 2.3.4.247 and Prism 6.3.0.

I'm currently having an issue that I've been unable to solve or to identify what's causing it.

When my application being executed on release mode, after a few hours of usage the screen gets filled with all the Alerts displayed during the session lifetime. It just explodes, showing a bunch of cascading alerts and then the application stops working.

The code I'm using to show alerts varies in these 4 ways:

await _pageDialogService.DisplayAlertAsync(Resources.Localization.Main.Main_Success_Label, successMessage, Resources.Localization.Main.Main_OK_Label);
await _pageDialogService.DisplayAlertAsync(errorTitle, errorMessage, cancelButton);
await _pageDialogService.DisplayActionSheetAsync(title, cancelButton, destroyButton, otherButtons);
await _pageDialogService.DisplayAlertAsync(errorTitle, errorMessage, cancelButton);

I'm using IPageDialogService from Prism.Services.

When I use it these lines of code (separately) in different part of my application the alert displays without problem. But after a while all of them get displayed again.

Does anybody know what could be the cause of this? Or how to solve it?

xamarin forms map is not showing

$
0
0

xamarin forms map was not showing

i already checked access permission.

how can i solve this problem?


How to crop a zone of Camera Preview?

$
0
0

I have success show a Camera Preview (I use CustomRenderer a View) and draw a Rectangle at the center of Camera Preview (I use SkiaSharp to draw directly in xaml.cs file).
Now I only want to get Image (take a shot or video) inside that Rectangle.
How to do that!
Thank you

How to select values for entry (text box) from different forms?

$
0
0

Hello Friends,

I have a form with three Picker controls for user to select values. All these Pickers are bound with data source. Clicking on them pops up all the items and user can select the items. This is working correctly.

However what the issue here is there are lots of items in the data source so I need Search functionality for users to look for a item and select it. Can you please help me how can I achieve this?

I have tried opening a new form and selecting values from there but I don't know how to preserve the values of other picker controls when coming back from new forms.

Please help me how can I achieve this.

Thank You

Loading a PDF file

$
0
0

Hi Everyone,

I am getting a byte array from server for the pdf file and I want to load it in app.
What are the options available for this?

Thanks
Kaushalya

How to implement lockscreen in Xamarin forms application?

$
0
0

I'm trying to get access to the device lockscreen in a xamarin forms pcl project. I have heard about third-party components such as Lockscreen and Passcode but i dont know how to go about it since this is a xamarin forms app not xamarin.android. How would i implement let's say Lockscreen in the android project of my xamarin forms application?

Connecting Oracle DB and Xamarin Forms

$
0
0

I have a project to connect my Application in Xamarin.Forms in cross platform and Oracle DB but i cant find any solution to connect it.
Please help

thanks

Viewing all 58056 articles
Browse latest View live


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