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

StackLayout not adaptive after navigate back and forth between pages

$
0
0

Hi guys,
I quite new to Xamarin and sorry for bad english. Basically, I got two page one is Mainpage and another is Page1 to learn about navigation and responsive of the app when device is portrait or landscape. So here is Xaml on Mainpage:

`

<StackLayout>

    <Label Text="Welcome to Xamarin!" 
       VerticalOptions="Fill" />

    <Button Text="Click me" Clicked="clickhandler"></Button>

</StackLayout>  `

And here is the code-behind
public async void clickhandler(object sender, EventArgs args) { await Navigation.PushAsync(new Page1(), true); }

My issue is that when the app run at the first time, it adapt well with the portrait or landscape screen. But after i navigated to another page(click the button) and come back. The app not adapt with the screen size any more :(. I myself knew that the HorizontalOptions and VerticalOptions was set to Fill by default so that it should adapt well when we change the screen size but it was not.
I try many way such as changed the value of HorizontalOptions and VerticalOptions, also check out the device orientation article on xamarin document site
with no luck.

I am currently using Samsung Galaxy j3(Android 5.1 - API 22) to test this app.

Could you please help me for this issue,

Many thanks.


Error SetValue: Can not convert Large to type 'System.Double' when using style with OnIdiom

$
0
0

If I define a style like this:

    <Style x:Key="NamedSizeLargeOnIdiom" TargetType="Label">
        <Setter Property="FontSize">
            <Setter.Value>
                <OnIdiom x:TypeArguments="NamedSize" Tablet="Large" Phone="Medium" />
            </Setter.Value>
        </Setter>
    </Style>

Then I get the following error in my application output:

SetValue: Can not convert Large to type 'System.Double'

If I use OnIdiom with a numeric size, or a named size without OnIdiom, it's fine. So the first two styles below are fine, but the last one produces the error:

<Application.Resources>
    <ResourceDictionary>
    <Style x:Key="NamedSizeMediumNoOnIdiom" TargetType="Label">
        <Setter Property="FontSize" Value="Medium" />
    </Style>

    <Style x:Key="NumericSizeOnIdiom" TargetType="Label">
        <Setter Property="FontSize">
            <Setter.Value>
                <OnIdiom x:TypeArguments="x:Double" Tablet="60" Phone="50" />
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="NamedSizeLargeOnIdiom" TargetType="Label">
        <Setter Property="FontSize">
            <Setter.Value>
                <OnIdiom x:TypeArguments="NamedSize" Tablet="Large" Phone="Medium" />
            </Setter.Value>
        </Setter>
    </Style>            
    </ResourceDictionary>
</Application.Resources>

Is this a known bug?

Version information:

=== Visual Studio Enterprise 2017 for Mac ===

Version 7.3.3 (build 5)
Installation UUID: 650b4c91-c7f5-4ee5-ad70-6f178f314906
Runtime:
Mono 5.4.1.7 (2017-06/e66d9abbb27) (64-bit)
GTK+ 2.24.23 (Raleigh theme)

Package version: 504010007

=== NuGet ===

Version: 4.3.1.4445

=== .NET Core ===

Runtime: Not installed
SDK: Not installed
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.1
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Version: 8.1.3.0 (Visual Studio Enterprise)
Android SDK: /Users/jameslavery/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
4.1 (API level 16)
4.3 (API level 18)
4.4 (API level 19)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
7.0 (API level 24)
7.1 (API level 25)
8.0 (API level 26)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 26.0.0
SDK Build Tools Version: 26.0.2

Java SDK: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Inspector ===

Version: 1.3.2
Hash: 461f09a
Branch: 1.3-release
Build date: Tue, 03 Oct 2017 18:26:57 GMT
Client compatibility: 1

=== Apple Developer Tools ===

Xcode 8.0 (11246)

=== Xamarin.iOS ===

Version: 11.6.1.3 (Visual Studio Enterprise)
Hash: f70a1348
Branch: xcode9.2
Build date: 2017-12-18 14:47:16-0500

=== Xamarin.Mac ===

Version: 4.0.0.215 (Visual Studio Enterprise)

=== Build Information ===

Release ID: 703030005
Git revision: b1c2982e201e71ef758866c9ade05f253a8c6f47
Build date: 2017-12-21 11:04:40-05
Xamarin addins: f397ddfbacfb39e60c9cc8d9e410f73faf8c2cbc
Build lane: monodevelop-lion-d15-5

=== Operating System ===

Mac OS X 10.11.6
Darwin 15.6.0 Darwin Kernel Version 15.6.0
Thu Jun 23 18:25:34 PDT 2016
root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

LiveXAML 1.3.31
Redth's Addins 1.0.9
Internet of Things (IoT) development (Preview) 7.1

Missing resource images (png) on iOS

$
0
0

Hi,

We have images that are bundled resources in an iOS project that display when running on the emulator and device, but are missing once we deploy the application to the App store. This is a recent problem - images that worked and have not changed did display in the app, but they are gone now?

Do the images need to be in an asset catalog for the newest version of xamarin? We are using Xamarin 4.8.0760 in Visual Studio 2015.

Thanks,
Michelle

Populate listview from json

$
0
0

I am stuck on how to get my json data into a listview. There is no problems getting the json from the webservice and into a variable. Quite possibly there is an much easier way of doing this?

Here is the class that defines how the JSON data is contructed.

`public class Result
{
    public string Comments { get; set; }
    public string first_name { get; set; }
    public string last_name { get; set; }
    public string FullName { get; set; }
    public string CreatedOn { get; set; }
    public string CreatedBy { get; set; }
    public string CreatedSystem { get; set; }
}

public class RootObject
{
    public int Count { get; set; }
    public List<Result> Result { get; set; }
}`



`public async Task LoadDetailNotesAsync() {
            ////Pass Information to Webservice
            Uri jsonUrl1 = new Uri(string.Format("myurl));

            var result = await myHelper.GetResponseString(jsonUrl1);

            JObject rss = JObject.Parse(result);
            int myCount = (int)rss["Count"];

            try
            {

                for (int x = 0; x <= myCount - 1; x++)
                {
                    NotesClass tcu = new NotesClass()
                    {
                        Comments = (string)rss["Result"][x]["Comments"]
                    };

                }

            }
}`

My Listview XAML file
`<ListView HeightRequest="150" x:Name="listDetail">
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <ViewCell>
                                <Label x:Name="lblFullName" Text="{Binding FullName}"></Label>
                                <Label x:Name="lblComment" Text="{Binding Comment}"></Label>
                                <Label x:Name="lblCreatedOn" Text="{Binding CreatedOn}"></Label>
                            </ViewCell>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>`

Interface with XAML or c #, one or the other or both.

$
0
0

Good afternoon,

I have a question

It is possible to create an interface in Xamarin in the XAML section and in turn create the interface in the .cs of the same XAML ?, that is, in code c #.

That both codes come together to form the interface?

Or is it only possible to use one of them?

Thank you

Change navigation bar back button color in xamarin android

$
0
0

Hi everyone, In my application default back button color is white. I need to change that back button color to black. I am tried so many post's for changing back button of navigation bar but no luck. Can you please suggest any idea. Here is my theme design.

style.axml:

 <resources>
   <style name="MyTheme" parent="MyTheme.Base">
   </style>
   <style name="Theme.Splash" parent="@android:style/Theme.NoTitleBar.Fullscreen">         
    <item name="android:windowBackground">@drawable/Splash</item>
    <item name="android:windowNoTitle">true</item>
   </style>
   <style name="MyTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
     <item name="colorPrimary">@color/primary</item>
    <item name="colorPrimaryDark">@color/primaryDark</item>   
    <item name="colorAccent">@color/accent</item>
    <item name="android:windowBackground">@color/window_background</item>
   </style>
 </resources> 

styles.xml:

<resources>
  <style name="MainTheme" parent="MainTheme.Base">
  </style>     
  <style name="MainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">      
    <item name="windowNoTitle">true</item>   
    <item name="windowActionBar">false</item>    
    <item name="colorPrimary">#fcce47</item>    
    <item name="colorPrimaryDark">#000000</item>    
    <item name="colorAccent">#000000</item>    
    <item name="windowActionModeOverlay">true</item>
    <item name="android:textCursorDrawable">@null</item>
    <item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>
  </style>

  <style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
     <item name="colorAccent">#FF4081</item>
  </style>
</resources>

Adjust Image bounds (similar to Android's AdjustViewBounds)

$
0
0

Hello, is there a way to adjust the Width and Height of an Image (the View) after the picture has been loaded?
I'll try to explain better: if I set Aspect = "AspectFit" to an Image then I have a View with an image in the center and empty on the two sides. In Android, in situations like that I would use the ImageView property AdjustViewBounds and it would handle this pain.

Is there a way to fix it in XForms?

THX

How to create a responsive layout to run in all device with xamarin.forms(Net Standard)

$
0
0

I created a layout by using AbsolutLayout. This went a bad idea. I adjusted to my smartphone(Samsung J500), when i installed in other device(Samsung S5) the layout broken. In my case i have an image and inside this image a rounded retangle(but this retangle is owned the image).

i used this code to place the labels inside retangle

<AbsoluteLayout>
                    <Label x:Name="lblFaturamento" Text="" AbsoluteLayout.LayoutBounds="20,8,40,100" Grid.Row="1" Grid.Column="0" TextColor="White" FontSize="9" FontAttributes="Bold"/>
                    <Label x:Name="lblCancelados" Text=""  AbsoluteLayout.LayoutBounds="195,8,40,100" Grid.Row="1" Grid.Column="1" TextColor="White" FontSize="9" FontAttributes="Bold"/>
                    <Label x:Name="lblPrestacaoContas" Text="" AbsoluteLayout.LayoutBounds="20,8,40,100" Grid.Row="2" Grid.Column="0" TextColor="White" FontSize="9" FontAttributes="Bold"/>
                    <Label x:Name="lblPendencias" Text="" Grid.Row="2" Grid.Column="1" TextColor="White" FontSize="9" FontAttributes="Bold"/>
                    <Label x:Name="lblOcupacao1" Text="" AbsoluteLayout.LayoutBounds="20,232,80,100" Grid.Row="3" Grid.Column="0" TextColor="White" FontSize="9" FontAttributes="Bold"/>
                    <Label x:Name="lblOcupacao2" Text="" AbsoluteLayout.LayoutBounds="196,234,80,100" Grid.Row="3" Grid.Column="1" TextColor="White" FontSize="9" FontAttributes="Bold"/>
                </AbsoluteLayout>

There is a way more intelligent to do this. How? How to do a responsive layout?


How to get width/height dimensions of video selected by Xam.Plugin.Media?

$
0
0

I have a mobile app that uses the Xam.Plugin.Media to select existing photos/videos on a device, or take photos/video with the device. Once I have the image/video file, I need to determine the width/height of the image/video.

I already have working C# code that allows me to get the image dimensions by examining the first 1024 bytes of the image file, so I'm all good for photos.

HOW can I find out the dimensions (resolution) of the video in the video file? Is there another plugin that reads metadata from a video file?

This needs to work on iOS and Android.

NavigationPage + TabbedPage + "More..." on iOS

$
0
0

I have an app with over 4 tab pages, so the extra ones go under the "More..." tab on iOS.

Due to this bug (https://bugzilla.xamarin.com/show_bug.cgi?id=28378) I currently have my pages set up as:

Navigation -> TabbedPage -> Children

so in App.cs->GetMainPage()

return new NavigationPage(new RootPage());

RootPage extends TabbedPage, and I add children directly to the RootPage

Children.Add(new ChildPage());

The alternative would be having the main page be a tabbed page, and wrapping each child page in a NavigationPage

TabbedPage -> NavigationPage -> ChildPage

But the above listed bug mentions that the tabs under the "More..." section won't be able to PushAsync new pages onto the Navigation, so I can't use this set up.

Main Navigation page set up causes some problems:

a) The main navigation bar has no text.

I haven't tried, but I assume I could dynamically set the parent's title text based on what page is appearing. Or somehow bind the Title to the page title (not sure if that's correct, not super familiar with Bindings)

b) The "More..." pages have double Navigation bars. The main nav bar, and then a second nav bar under it (which fortunately, does have the page's title text in it)


I guess my main question is, both setups have problems. The NavigationPage wrapped Children is unusable due to the PushAsync bug, so should I continue trying to get the Navigation wrapped TabbedPage working? Does any one have some experience / suggestions?

How to use AdMob Mediation with Facebook Audience in Xamarin Forms

$
0
0

I have a Xamarin Forms app (2.3.4+) with AdMob ads. I can see banners and interstitials in both Android and iOS apps. I'd like to enable AdMod mediation to show also Facebook ads, but mediation is not working.

Everything is configured server side. I've configured Facebook and Google, following the respective guides. I can see Facebook banners and interstitials if in the app I show them directly via the Facebook APIs and not via Google AdMob.

I guess the problem is app side. When I call InterstitialAd.Show() only AdMob banners are shown. For testing purpose I've set eCPM = 200$ to force Google to serve FB ads:

On the AdMob dashboard I see the N requests yet 0 impressions for Facebook:

In the logs I see:

07-06 12:54:13.390 I/Ads     (29542): Starting ad request.
07-06 12:54:13.395 I/Ads     (29542): Use AdRequest.Builder.addTestDevice("XXX") to get test ads on this device.
07-06 12:54:15.817 I/Ads     (29542): Trying mediation network: https://googleads.g.doubleclick.net/aclk?sa=...
07-06 12:54:15.831 I/Ads     (29542): Instantiating mediation adapter: com.google.ads.mediation.facebook.FacebookAdapter
07-06 12:54:15.836 I/Ads     (29542): Trying mediation network: 
07-06 12:54:15.844 I/Ads     (29542): Instantiating mediation adapter: com.google.ads.mediation.admob.AdMobAdapter
07-06 12:54:15.848 W/Ads     (29542): Server parameters: {"pubid":"ca-app-pub-XXX\/cak=no_cache&cadc=wb&caqid=YYY","gwhirl_share_location":"1"}
07-06 12:54:18.509 I/Ads     (29542): Ad finished loading.
07-06 12:54:18.722 I/Ads     (29542): Ad opening.

I'm using these packages:

// Android
<package id="Xamarin.GooglePlayServices.Ads" version="42.1021.1" targetFramework="monoandroid71" />
<package id="Xamarin.GooglePlayServices.Ads.Lite" version="42.1021.1" targetFramework="monoandroid71" />
<package id="Xamarin.Facebook.Android" version="4.22.0" targetFramework="monoandroid71" />
<package id="Xamarin.Facebook.AudienceNetwork.Android" version="4.22.0" targetFramework="monoandroid71" />

// iOS
<package id="Xamarin.Google.iOS.MobileAds" version="7.16.0" targetFramework="xamarinios10" />
<package id="Xamarin.Facebook.AudienceNetwork.iOS" version="4.24.0" targetFramework="xamarinios10" />
<package id="Xamarin.Facebook.iOS" version="4.24.0" targetFramework="xamarinios10" />

Any idea on why Facebook are never served by AdMob?

Thanks

ERROR ITMS-90502: "Invalid Bundle. Apps that only contain the arm64 slice must also have 'arm64'...

$
0
0

ERROR ITMS-90502: "Invalid Bundle. Apps that only contain the arm64 slice must also have 'arm64' in the list of UIRequiredDeviceCapabilities in Info.plist."

I have a Xamarin Forms app targeting iOS that I last published on Feb 8th. Tried to push out an update to the app yesterday - Feb 21st - and I got the above error message 3 times in a row when trying to upload the IPA to iTunesConnect with Application Loader. I then rebuilt the app and submitted a 4th time, and Application Loader let the IPA go through, but I got an email from Apple a few minutes later reporting the same error message.

The only changes to INFO.PLIST since the last successful upload/release are the version number strings - the 'arm64' tag was already in the UIRequiredDeviceCapabilities array, and has been for months. I haven't changed the target architecture or any other iOS project settings. The only non-code-related change to the mobile app since the last release was an update to the FFImageLoading NuGet package (from 2.2.25 to 2.3.4).

There are a number of people on the Apple Developer Forums reporting the same problem, starting sometime on the afternoon of Feb 21st. Some of the solutions involve changes to other INFO.PLIST files in their application (doesn't apply here) or modifications to the PODFILE (also doesn't apply here), but a lot of people still appear to be out in the cold...
https://forums.developer.apple.com/message/251241#295795
https://forums.developer.apple.com/thread/97422
https://forums.developer.apple.com/message/296025

All my building is done in the cloud through VSTS and MacInCloud. My MacInCloud agent is up-to-date (2.129.1) and the build is using iOS SDK 11.2 (the last successful build was against SDK 11.1, but I'm not sure if that's pertinent).

Any suggestions anyone?

XAML Designer for UWP

$
0
0

Hello,
I wonder if there is a designer tool, or at least a previewer, for Xamarin.Forms UWP project in Visual Studio 2017? I don't have any Andriod or Mac device for the moment, and I feel the Xamarin.Forms Previewer is very unstable, and requires Android project to be loaded and deployed. I just want to work with the UWP project and reload the Android/iOS projects later.
Regards /Magnus

Can the Picker list be filtered when it gains focus?

$
0
0

I have a textbox that is used to filter a picker list. I need the picker list to be filtered either when the picker gains focus, OR when the textbox loses focus. I have tried both ways, and neither work. It's as if the MessagingCenter is alerting my VM after the fact. It seems like this should be pretty easy, but I cannot come up with a solution.

How can I filter/update that list BEFORE the picker list is shown?

FWIW, here is the pertinent code"

<br />    namespace DatabaseTest.ViewModels
    {
        public class MyViewModel : INotifyPropertyChanged
        {
            public MyViewModel()
            {
                List mystuff = new List();
                using (SQLite.SQLiteConnection conn = new SQLite.SQLiteConnection(App.DB_PATH))
                {
                    conn.CreateTable();
                    mystuff = conn.Table().ToList();
                }
                myList = new ObservableCollection(mystuff);
                MessagingCenter.Subscribe<FocusedTriggerAction> (this, "changeList", (sender) => 
                {
                    if (mylookupstring == "")
                        testme = 1;
                    else
                        myList = new ObservableCollection<MyOptions>(mystuff.Where(o => o.SpecFullName.Contains(mylookupstring)));
                });
            }
            string mylookupstring = string.Empty;
            int testme = 0;
            public event PropertyChangedEventHandler PropertyChanged;
            void OnPropertyChanged([CallerMemberName] string name = "")
            {
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
            }
            public string myLookupString
            {
                get { return mylookupstring; }
                set
                {
                    mylookupstring = value;
                    mylookupstring = mylookupstring.ToUpper();
                    OnPropertyChanged();
                }
            }
            private ObservableCollection<MyOptions> _mylist;
            public ObservableCollection<MyOptions> myList
            {
                get { return _mylist; }
                set
                {
                    if (_mylist != value)
                    {
                        _mylist = value;
                        OnPropertyChanged();
                    }
                }
            }
        }
    }

Login Authentification with Google Firebase

$
0
0

Hey,

i need help. I want to connect my Xamarin.Forms App with the Firebase DB. This works finde. More problems i have to make the authentification in Xamarin.Forms with connection to firebase, so that users can login with connection to firebase.

Doers anybody know how to do this? Hope somebody can help me.

Greez

Dahl


Why does MimeTypeMap.Singleton.GetMimeTypeFromExtension for db returns null?

$
0
0

Hi,

I'm trying to change the filepicker (FilePicker-Plugin-for-Xamarin-and-Windows) intent to only show me db files, I thought that if I passed the correct mime-type it would only show me the db files.

I tried several mime-types associated with .db files (sqlite) and none worked, so I tried to get the mime type like this:

            string extension = MimeTypeMap.GetFileExtensionFromUrl(filedata.FilePath);
            string mimeType = MimeTypeMap.Singleton.GetMimeTypeFromExtension(extension);

And mimeType is set to null.

This is the code I want to change (FilePickerActivity.cs):

Am I doing something stupid?

Thanks for the help,

Luís Pinho

Is it possible (easy?) to change the background color on a Xamarin.Forms Android Date Picker?

$
0
0

Is it possible (easy?) to change the background color on a Xamarin.Forms Android Date Picker? Right now it is hot pink. Ugh.

wake lock - energy controls

$
0
0

I am programming an App on Android phones withVisual Studio in Xamarin.
Now sometimes my App is being closed, when it's in the background. Sometimes it's not and the time of when that happens is irregular.
I think it has something to do with the wake lock and the energy controls but i can't figure it out.
Any suggestions?
Thank you

XmlnsDefinitionAttribute: ArgumentNullException - Parameter name: clrNamespace

$
0
0

I am using the method LoadFromXaml in Xamarin.Forms.Xaml.Extensions. This method allows for dynamic creation of UI elements from Xaml strings at runtime. I'm using this via reflection because it is an internal method. The Xamarin Forms team have refused to make this method public for some reason, but we require this functionality so we are forced to use this reflection hack.

We've been using this functionality for several months now without a problem. But, today, when I ran the latest code, I got an exception when parsing our dynamically loaded Xaml (which hasn't changed). This has stopped development dead in its tracks for us because I can't run our app at all now.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: clrNamespace
at Xamarin.Forms.Internals.XmlnsDefinitionAttribute..ctor(String xmlNamespace, String clrNamespace)
at Xamarin.Forms.Xaml.XamlParser.GetElementType(XmlType xmlType, IXmlLineInfo xmlInfo, Assembly currentAssembly, XamlParseException& exception)
at Xamarin.Forms.Xaml.Internals.XamlTypeResolver.Resolve(String qualifiedTypeName, IServiceProvider serviceProvider, XamlParseException& exception)
at Xamarin.Forms.Xaml.Internals.XamlTypeResolver.Xamarin.Forms.Xaml.IXamlTypeResolver.TryResolve(String qualifiedTypeName, Type& type)
at Xamarin.Forms.Xaml.ExpandMarkupsVisitor.MarkupExpansionParser.Parse(String match, String& remaining, IServiceProvider serviceProvider)
at Xamarin.Forms.Xaml.ExpandMarkupsVisitor.ParseExpression(String& expression, IXmlNamespaceResolver nsResolver, IXmlLineInfo xmlLineInfo, INode node, INode parentNode)
at Xamarin.Forms.Xaml.ExpandMarkupsVisitor.Visit(MarkupNode markupnode, INode parentNode)
at Xamarin.Forms.Xaml.MarkupNode.Accept(IXamlNodeVisitor visitor, INode parentNode)
at Xamarin.Forms.Xaml.ElementNode.Accept(IXamlNodeVisitor visitor, INode parentNode)
at Xamarin.Forms.Xaml.ElementNode.Accept(IXamlNodeVisitor visitor, INode parentNode)
at Xamarin.Forms.Xaml.RootNode.Accept(IXamlNodeVisitor visitor, INode parentNode)
at Xamarin.Forms.Xaml.XamlLoader.Visit(RootNode rootnode, HydratationContext visitorContext)
at Xamarin.Forms.Xaml.XamlLoader.Load(Object view, String xaml)
at Xamarin.Forms.Xaml.Extensions.LoadFromXaml[TXaml](TXaml view, String xaml)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Adapt.Presentation.XamarinForms.XamlReader.<>c__DisplayClass1_0.<.cctor>b__2(BindableObject view, String xaml)
at Adapt.Presentation.XamarinForms.XamlReader.LoadFromXaml[TView](TView view, String xaml)
at Adapt.Presentation.XamarinForms.XamlReader.LoadFromXaml[TView](String xaml)
at Adapt.Presentation.Xivic.Navigation.TabbedPageUIController.CreateAndAddPanelFromContent(PagePanel pagePanel, Nullable`1 panelHeight)
at Adapt.Presentation.Xivic.PanelPageBase.d__22.MoveNext()

I thought it might be a problem with our XAML, but it's happening with all the XAML that has always worked in the past. Here is an example of our XAML:

<ContentView xmlns:local="clr-namespace:Adapt.Presentation.XamarinForms.Controls;assembly=Adapt.Presentation.XamarinForms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
  <Grid>

    <Grid.RowDefinitions>
      <RowDefinition Height="60" />
      <RowDefinition  />
    </Grid.RowDefinitions>

    <local:BasicRecordProvider RecordTypeName="Adapt.Model.Custom.ContractorDef"  x:Name="ContractorDefs" />

    <local:AdaptPicker Title="Client" ItemsSource="{Binding Source={x:Reference Name=ContractorDefs}}" DisplayMemberPath="Code" SelectedItem="{Binding Contractor, Mode=TwoWay}" />

    <Editor Text="{Binding ProbNotes}" TextColor="#FF0000EE" Grid.Row="1" />

  </Grid>

</ContentView>

I sifted through the Xamarin Forms code in the Git Repo, and traced the error message to this spot. It's in the constructor of XmlnsDefinitionAttribute (https://github.com/xamarin/Xamarin.Forms/blob/master/Xamarin.Forms.Core/XmlnsDefinitionAttribute.cs).

    public XmlnsDefinitionAttribute(string xmlNamespace, string clrNamespace)
    {
        if (xmlNamespace == null)
            throw new ArgumentNullException(nameof(xmlNamespace));
        if (clrNamespace == null)
            throw new ArgumentNullException(nameof(clrNamespace));

        ClrNamespace = clrNamespace;
        XmlNamespace = xmlNamespace;
    }

Note: I am using Xamarin Forms build 2.3.4.224. I have also tried upgrading to 2.3.4.231 (with a full Git Clean of my solution folders), and this made no difference.

I presume the problem has something to do with the Xml namespace, but I can't see what the issue would be here. Does anyone here have any ideas?

It's possible to build app that to send notifications to nearby users in Xamarin.forms ?

$
0
0

Hi guy's
I developing app using xamarin.forms and i want to add service that allow user to send a notification to nearby users they have the same app , it's such as car booking apps , i was read about Google nearby notification service but it's compatible with android just, if they are a way that compatible with xamarin.forms please leave a comment bellow , and if not it's ok to customizing the service by using for example web services and online database ? because this is the last solution on my opinion , thanks

Viewing all 77050 articles
Browse latest View live


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