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

How to retrieve value from custom control

$
0
0

This is my custom control with entry, where function checks for valid name and return true or false.. I am not able to set IsValid parameter as well as I am not able to pass IsValid value back to main control..
PatientDetailsEntryFormView .xaml.cs

public partial class PatientDetailsEntryFormView : ContentView
    {
    public string Name
        {
            get { return (string)GetValue(NameProperty); }
            set { SetValue(NameProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Name.  This enables animation, styling, binding, etc...
        public static readonly BindableProperty NameProperty =
            BindableProperty.Create("Name", typeof(string), typeof(PatientDetailsEntryFormView), default(string),BindingMode.TwoWay, propertyChanged:NamePropertyChanged);

        private static void NamePropertyChanged(BindableObject bindable, object oldValue, object newValue)
        {
            var control = (PatientDetailsEntryFormView)bindable;
            control._nameEntry.Text = newValue.ToString();
            if (!CheckNameProperty(control._nameEntry.Text))
            {
                control._nameEntry.ErrorText = "A Name is required";                
            }
        }

        static bool CheckNameProperty(string Value)
        {
            if (Value == null)
            {
                return false;
            }

            var str = Value as string;
            return !string.IsNullOrWhiteSpace(str);
        }

        public bool IsValid
        {
            get { return (bool)GetValue(IsValidProperty); }
            set { SetValue(IsValidProperty, value); }
        }

        // Using a DependencyProperty as the backing store for IsValid.  This enables animation, styling, binding, etc...
        public static readonly BindableProperty IsValidProperty =
            BindableProperty.Create("IsValid", typeof(bool), typeof(PatientDetailsEntryFormView), default(bool), BindingMode.TwoWay);



        public PatientDetailsEntryFormView()
        {
            InitializeComponent();        
        }

PatientDetailsEntryFormView.xaml

<ContentView x:Name="_patientEntryForm">
                        <Entry
                            x:Name="_nameEntry"
                            Text="{Binding Name, Source={x:Reference _patientEntryForm}}" />
                </ContentView>

MainViewModel.xaml

<templates3:PatientDetailsEntryFormView
                                Name="{Binding PatientName.Value}"
                                IsValid="{Binding IsValid}" />

I had went through dozens of articles before posting question.. Any pointer will be helpful


Bug with databinding a ListView from XAML (leads to big perf problem)

$
0
0

There appears to be a bug in the ordering that BindingContext is set on items generated within a ListView that is causing some invalid debug output. I'm getting debug spew that a binding is failing because a property is not found on the object I'm binding to. But it is not listing the type of object that is being used within my collection pointed to by ItemsSource. It's outputting the type that is in the BindingContext for the ListView... not what should be for the items.
Binding: 'PublishDate' property not found on 'ViewModel', target property: 'Xamarin.Forms.ImageCell.Detail'

The object that is being used on my page is a class called ViewModel and is set as the page's BindingContext. (And is thus also my ListView's BindingContext.)
ViewModel has a property called Articles which is a collection of Article classes.
The Article class has a property called PublishDate.

My ListView has ItemsSource={Binding Articles} so each child item in the list should have a BindingContext set to the item which is type Article.
My DataTemplate for the ListView contains an ImageCell with Detail={Binding PublishDate} which it should be getting from the Article.

So why is the debug spew happening for each of my items which says I'm trying to bind to a PublishDate back on the ViewModel (parent of the Articles)? My guess is that the BindingContext is set on each of the items too late as Xamarin materializes the items and adds children. It looks like its going through the binding code while each child still has BindingContext inherited from the parent (null on itself). I'm guessing that the BindingContext is then getting set after the children are added and the correct binding is getting updated as my view is eventually rendered correct. It's the only way I could envision that my form is showing correct but I'm getting debug spew showing me that I'm binding to the wrong item type (the type my ListView is bound to).

This generate a ton of debug spew while connected to a debugger (I'm using VS2013) and makes the performance unusable until the debug output has completed. I think this is only happening on a page generated from XAML so there may be some timing that coded pages don't exhibit.

More testing and examples using XAML please.

Essentials Web Authenticator does not provide PKCE support

$
0
0

Since it is the recommended flow to support mobile clients using OpenID Connect it seems surprising that Web Authenticator does not appear to support PKCE.
I have seen David Britch's post where he combines Web Authenticator with IdentityModel.OidcClient however that has a bit of a problem on iOS when the Authority supports shared cookies and thus pops the iOS Sign In permission. Declining that causes an NSErrorException to be thrown in WebAuthenticator. Also, this OidcClient tends to be quite slow, presumably because it's parsing the discovery document.
Does anyone know if it is planned to support more complex flows using WebAuthenticator?

Execute a command from textchanged event in mvvm

$
0
0

Dear @LandLu Please help
In my project Mobile Number Entry, while entering number as it reached to max length which is 8, textchanged event should call a command or method which will bring the bill amount in other enteries, i did all the possible but failed, i tried 2 codes one is giving null reference and other is not fired

View Model

      public class BillPageViewModel : BaseViewModel
        {
            #region Declaration         
            private string _mobilenumber = null;
            private int _limit = 8;       
            #endregion
            public string MobileNumber
            {
                get { return _mobilenumber; }
                set
                {             
                    _mobilenumber = value;    
                        TextChangedCommand.ChangeCanExecute();                     
                    OnPropertyChanged();               
                }
            }       
            public Command TextChangedCommand => new Command<string>(async (_mobilenumber) => await TextChanged(_mobilenumber));

            private async Task TextChanged(string p)
            {
                if(p.Length==_mobilenumber.Length)
                   await UserDialogs.Instance.AlertAsync("Your Bill amount ", "Info", "OK");
            }
//XAML=======
 <customelements:BorderlessEntry Margin="20,0,20,0"
                             FontFamily="STC-Bold"
                             TextColor="{StaticResource primary}"
                             Text="{Binding MobileNumber,Mode=TwoWay}"                                                           
                             Keyboard="Numeric"
                             Placeholder="Enter your line number here"
                             PlaceholderColor="{StaticResource placecolor}"
                             ClearButtonVisibility="WhileEditing"
                             MaxLength="8"                                                             
                             VerticalOptions="Center">
                                <customelements:BorderlessEntry.Behaviors>
                                    <behaviors:EventToCommandBehavior 
                                        EventName="TextChanged"
                                        Command="{Binding TextChangedCommand}"
                                         CommandParameter="Text"/>
                                </customelements:BorderlessEntry.Behaviors>

                            </customelements:BorderlessEntry>

The Dialog box should appeared when I finished entering mobile number 8 digits

Developing a Location Background Service

$
0
0

Hi

I want my app to send a location every x minuttes, both when using the app, but also when the app is in the background.

I seen a few example of how to create a service which is running in the background with xamarin.android. (https://github.com/xamarin/mobile-samples/tree/master/BackgroundLocationDemo)

But what about xamarin.forms, which I'm working on? Could the same code be used with forms? Also I haven't seen the same for xamarin.ios.

Why can't I find a full example code of sending locations from a app, both foreground and background? I'm convinced a lot of developers could be interested in such functionallity.

I'm very new to xamarin, so I'm hoping you can point me in the right direction if its possible to develop such funcionallity.

Kind regards

Xam.Plugin.Media after camera capture app crashes without any error

$
0
0

Hello,

I am using Xam.Plugin.Media in my xamarin forms (Xamarin.Forms 4.5.0.530) mobile app. App gets crashed after camera capture strangely without any error. Camera captured image also gets stored in the desired folder I set. I don't know how to proceed further, would appreciate if someone could help me move forward.

Code snippet and other App details are attached below:

Shared Project

XAML

<ContentPage.Resources>
            < ResourceDictionary>
                < services:Null2StringConverter x:Key="Null2String"/>
                < services:ByteToImageFieldConverter x:Key="ByteArrayToImage"/>
            < /ResourceDictionary>
    </ContentPage.Resources>

    <Grid ColumnSpacing="16">
        <StackLayout Grid.Column="0">
            <Image
                x:Name="PhotoImage"
                Aspect="AspectFit"
                Source="{Binding PhotoByte, Converter={StaticResource ByteArrayToImage}, Mode=TwoWay}" />
        </StackLayout>
        <StackLayout  Grid.Column="1">
            <Button Grid.Column="1" WidthRequest="200"
                x:Name= "btnTake"
                Text = "Take Picture"
                Style="{StaticResource ButtonBlueWhite}"
                HorizontalOptions = "End"/>
        </StackLayout>
    </Grid>

View

    public partial class PODUpdate : ContentPage
    {
            PODViewModel viewModel;

                public PODUpdate()
                {   
                     InitializeComponent();

                        BindingContext = viewModel = new PODViewModel(2);
                }



                private void BtnTake_Clicked(object sender, EventArgs e)
                {
                    PictureClick();
                }


                private async void PictureClick()
                {
                    try
                    {
                        if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported)
                        {
                            await DisplayAlert("No Camera", ":( No camera available.", "OK");
                            return;
                        }

                        string mFileName = DateTime.Now.Year.ToString() +
                                            DateTime.Now.Month.ToString() +
                                            DateTime.Now.Day.ToString() +
                                            DateTime.Now.Hour.ToString() +
                                            DateTime.Now.Minute.ToString() +
                                            DateTime.Now.Second.ToString();


                        await CrossMedia.Current.Initialize();

                        var photo = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
                        {
                            MaxWidthHeight = 2500,
                            CompressionQuality = 80,
                            DefaultCamera = Plugin.Media.Abstractions.CameraDevice.Front,
                            Name = mFileName,
                            PhotoSize = Plugin.Media.Abstractions.PhotoSize.Small
                        });

                        if (photo == null)
                            return;


                        if (photo != null)
                        {
                            viewModel.IsPhotoTaken = true;
                            viewModel.PhotoByte = System.IO.File.ReadAllBytes(photo.Path);

                            photo.Dispose();
                        }
                    }
                    catch (Exception ex)
                    {
                        await DisplayAlert(this.Title, ex.Message+ ex.InnerException, "Ok");
                        return;
                    }
                }
    }

Android Project
AndroidManifest.xml

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.Flyking.ibots.netmobile" android:installLocation="auto">
        <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
        <application android:label="Ibots.NetMobile.Android" android:icon="@drawable/FlykingIcon">
            <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.Flyking.ibots.netmobile.fileprovider" android:exported="false" 
                  android:largeHeap="true" android:grantUriPermissions="true">
                <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths"></meta-data>
            </provider>
        </application>
      <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
        <uses-permission android:name="android.permission.CAMERA" />
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
        <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
        <uses-permission android:name="android.permission.FLASHLIGHT" />
    </manifest>

AssemblyInfo.cs

    using System.Reflection;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;
    using Android.App;

    // General Information about an assembly is controlled through the following 
    // set of attributes. Change these attribute values to modify the information
    // associated with an assembly.
    [assembly: AssemblyTitle("Ibots.NetMobile.Android")]
    [assembly: AssemblyDescription("")]
    [assembly: AssemblyConfiguration("")]
    [assembly: AssemblyCompany("")]
    [assembly: AssemblyProduct("Ibots.NetMobile.Android")]
    [assembly: AssemblyCopyright("Copyright ©  2014")]
    [assembly: AssemblyTrademark("")]
    [assembly: AssemblyCulture("")]
    [assembly: ComVisible(false)]

    // Version information for an assembly consists of the following four values:
    //
    //      Major Version
    //      Minor Version 
    //      Build Number
    //      Revision
    //
    // You can specify all the values or you can default the Build and Revision Numbers 
    // by using the '*' as shown below:
    // [assembly: AssemblyVersion("1.0.*")]
    [assembly: AssemblyVersion("1.0.0.0")]
    [assembly: AssemblyFileVersion("1.0.0.0")]

    // Add some common permissions, these can be removed if not needed
    [assembly: UsesPermission(Android.Manifest.Permission.Internet)]
    [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
    #if DEBUG
        [assembly: Application(Debuggable = true, UsesCleartextTraffic = true)]
    #else
        [assembly: Application(Debuggable = false, UsesCleartextTraffic = true)]
    #endif

    [assembly: UsesPermission(Android.Manifest.Permission.Camera)]
    [assembly: UsesFeature("android.hardware.camera", Required = true)]
    [assembly: UsesFeature("android.hardware.camera.autofocus", Required = true)]

MainActivity.cs

    public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
    {

            protected override void OnCreate(Bundle savedInstanceState)
            {
                TabLayoutResource = Resource.Layout.Tabbar;
                ToolbarResource = Resource.Layout.Toolbar;

                base.OnCreate(savedInstanceState);
                Rg.Plugins.Popup.Popup.Init(this, savedInstanceState);

                Xamarin.Essentials.Platform.Init(this, savedInstanceState);
                global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

                ZXing.Net.Mobile.Forms.Android.Platform.Init();

                LoadApplication(new App());
            }



            public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
            {
                global::ZXing.Net.Mobile.Forms.Android.PermissionsHandler.OnRequestPermissionsResult(requestCode, permissions, grantResults);

                Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);

                base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
            }

    }

Thanks - G Rajesh

PDFSharp.Xamarin.Forms: add image to PDF from Resource

$
0
0

Hi all,

I have a Xamarin.Forms for Android and iOS, where I use PDFSharp.Xamarin.Forms to create a PDF-file and put some text on this with color. This file never gets saved on the phone, since it will only E-mail the file (with System.Net.Mail). This all works, but I have difficulties with the following:

I have an image (for Android in /Resources/drawable/image.jpg and for iOS in /Resources/image.jpg) which I want to add to the PDF-file. I Googled some examples, but nothing worked for me so far.

Is it even possible to do this? If so, how?

Hope someone can help.

Video is not played in iOS project

$
0
0

Hello,

I have used Plugin.MediaManager in my Xamarin.Forms application. It works perfectly in Android project, but in iOS project it does not.

I have added

VideoViewRenderer.Init();

in AppDelegate, and this is the code in the view:

        async void PlayStop_Clicked(object sender, System.EventArgs e)
        {
            if (this.BtnPlayStop.Text == "Start Video")
            {
                string video = Path.Combine(_videoPath, this.viewModel.Item.Video);

                if (File.Exists(video))
                {
                    await CrossMediaManager.Current.Play(video, MediaFileType.Video);

                    this.BtnPlayStop.Text = "Stop Video";
                }
            }
            else
            {
                await CrossMediaManager.Current.Stop();

                this.BtnPlayStop.Text = "Start Video";
            }
        }

Code enters the first if, since button changes its text to 'Stop Video' but no video appears. The video is a local mp4 file.

As I told, this works perfect in Android.

What's wrong?

Thanks

Jaime


Prism Navigation after Dialog results in unexpected behavior

$
0
0

While calling Navigate right after a dialog the ViewModel of the target page is loaded but the Page remains the same. If a small Task.Delay is added in between the Page is loaded along with its ViewModel normally. For the dialogs, the Prism Plugins.Popup nugget package is used. Both ways exhibit the same behavior:

await DialogService.ShowDialogAsync(App.DIALOG_ALERT);
await NavigationService.NavigateAsync(App.PAGE_KEY_LOGIN);
DialogService.ShowDialog(App.DIALOG_ALERT,
async res => await NavigationService.NavigateAsync(App.PAGE_KEY_LOGIN));

Any help in trying to understand this behavior is greatly appreciated. I want to come a more educated solution than randomly delaying. Thank you in advance.

Change background color of ToolbarItems

$
0
0

How do I change the background color and text of ToolbarItems? The default color is black and I would like to change how to do it?

<ContentPage.ToolbarItems>
    <ToolbarItem Order="Secondary" Icon="morevert.png" Text="Atualizar" Command="{Binding Atualizar}"/>
    <ToolbarItem Order="Secondary" Text="Ajuda" Command="{Binding Ajuda}"/>
    <ToolbarItem Order="Secondary" Text="Sair" Command="{Binding Sair}"/>
</ContentPage.ToolbarItems>

admob pre-launch errors

$
0
0

App works in debug mode on emulator. However, I get the following on pre-launch. cannot figure out how to resolve.

Anyone run into this

Process: com.dnktechnologies.SWLog, PID: 18323\
java.lang.RuntimeException: Unable to get provider com.google.android.gms.ads.MobileAdsInitProvider: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.ads.MobileAdsInitProvider" on path: DexPathList[[zip file "/data/app/com.dnktechnologies.SWLog-7oXNguA79p9Hrsr-w1PFSQ==/base.apk", zip file "/data/app/com.dnktechnologies.SWLog-7oXNguA79p9Hrsr-w1PFSQ==/split_config.arm64_v8a.apk", zip file "/data/app/com.dnktechnologies.SWLog-7oXNguA79p9Hrsr-w1PFSQ==/split_config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/com.dnktechnologies.SWLog-7oXNguA79p9Hrsr-w1PFSQ==/lib/arm64, /data/app/com.dnktechnologies.SWLog-7oXNguA79p9Hrsr-w1PFSQ==/base.apk!/lib/arm64-v8a, /data/app/com.dnktechnologies.SWLog-7oXNguA79p9Hrsr-w1PFSQ==/split_config.arm64_v8a.apk!/lib/arm64-v8a, /data/app/com.dnktechnologies.SWLog-7oXNguA79p9Hrsr-w1PFSQ==/split_config.xxhdpi.apk!/lib/arm64-v8a, /system/lib64, /product/lib64]]\
at android.app.ActivityThread.installProvider(ActivityThread.java:6988)\
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6528)\
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6445)\
at android.app.ActivityThread.access$1300(ActivityThread.java:219)\
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1859)\
at android.os.Handler.dispatchMessage(Handler.java:107)\
at android.os.Looper.loop(Looper.java:214)\
at android.app.ActivityThread.main(ActivityThread.java:7356)\
at java.lang.reflect.Method.invoke(Native Method)\
at

Xamrain Forms app templates

$
0
0

Hi

I‘m a dot net developer but digging first time into Xamarin. My first Xamrain Forms app needs a few simple screens; a list screen, a simple vertical stacked gallery, a news page with pic, headline and synopsis. App would be mostly UI, bound to backend remote api.

I wondering if I there are any page/app templates that I can use to jump start development while I am still learning Xamrain Forms. Any pointers would be appreciated.

Thanks

Regards

How convert entries in string or int ?

$
0
0
Hello,

I would like to store two entries (a name and a price) generated from my cs in two lists:
-A string list
-An int list

But, of course, I have this one mistake: Unable to convert 'Xamarin.Forms.Entry' to 'string'.
And the same with the int

I'd like to reuse these lists anywhere in my cs.

Thanks to whoever will help me, thanks in advance!



public partial class DetailPage : ContentPage
{
StackLayout parent;
List<string> Acheteur = new List<string>();
List<int> Prix = new List<int>();

public DetailPage()
{
InitializeComponent();
}

int incrementation = 0;

Entry a;
Entry b;

public void Addbutton(object sender, EventArgs e)
{

incrementation++;

a = new Entry { Placeholder = "Acheteur " + incrementation + " :" };
b = new Entry { Placeholder = "Prix" };

parent = layout;

StackLayout child_stackLayout = new StackLayout
{
Orientation = StackOrientation.Vertical,
HorizontalOptions =
LayoutOptions.FillAndExpand,
Margin = new Thickness(20),
Padding = 20,
BackgroundColor = Color.Accent
};

// Ajouter mes objets au stacklayout
child_stackLayout.Children.Add(a);
child_stackLayout.Children.Add(b);

//Ajoute le stacklayout au parent StackLayout
parent.Children.Add(child_stackLayout);
}
}

How to use pre release version of Xamarin form

$
0
0

The current version of Xamarin forms is 4.7.
But I need to use pre-release version of 4.8, which has a few fixes important for my project.
I can't seem to find it in nuget packages. Can anyone help.

Help me to add custom set of MSBuild Targets and Tasks for Dotfuscator for protecting App?


Get number from Incoming call and then launch my app

$
0
0

Hi Geeks,

I have a requirement where I need to work in the following scenario.

When any user gets a call, identify the number, and launch my app in the background and insert a record in some table.

I searched through different forums and found BroadcastReceiver is the one by which I can get the incoming number.

However, I tried to implement this, but no success.

[BroadcastReceiver(Enabled =true)]
[IntentFilter(new[] { "com.App.CALLER_RECEIVER" })]
public class IncomingCallReader : BroadcastReceiver
{
    public override void OnReceive(Context context, Intent intent)
    {
        switch (intent.Action)
        {
            case Intent.ActionNewOutgoingCall:
                Globals.ContactNumber = intent.GetStringExtra(Intent.ExtraPhoneNumber);
                var outboundPhoneNumber = intent.GetStringExtra(Intent.ExtraPhoneNumber);
                Toast.MakeText(context, $"Started: Outgoing Call to {outboundPhoneNumber}", ToastLength.Long).Show();
                break;
             case TelephonyManager.ActionPhoneStateChanged:
                var state = intent.GetStringExtra(TelephonyManager.ExtraState);
                if (state == TelephonyManager.ExtraStateIdle)
                    Toast.MakeText(context, "Phone Idle (call ended)", ToastLength.Long).Show();
                else if (state == TelephonyManager.ExtraStateOffhook)
                    Toast.MakeText(context, "Phone Off Hook", ToastLength.Long).Show();
                else if (state == TelephonyManager.ExtraStateRinging)
                    Toast.MakeText(context, "Phone Ringing", ToastLength.Long).Show();
                else if (state == TelephonyManager.ExtraIncomingNumber)
                {
                    var incomingPhoneNumber = intent.GetStringExtra(TelephonyManager.ExtraIncomingNumber);
                    Toast.MakeText(context, $"Incoming Number: {incomingPhoneNumber}", ToastLength.Long).Show();
                }
                break;
            default:
                break;
        }
    }


   protected override void OnCreate(Bundle savedInstanceState)
    {
        TabLayoutResource = Resource.Layout.Tabbar;
        ToolbarResource = Resource.Layout.Toolbar;
        base.OnCreate(savedInstanceState);
        Xam.Essentials.Platform.Init(this, savedInstanceState);
        global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
        RegisterReceiver(new IncomingCallReader(), new IntentFilter("com.uniconta.mobile_new.app"));
        LoadApplication(new App());
    }

Second Approach:

 public interface ICallReceiver
   {
    void OnReceive();
   }

public class IncomingCallReceiver: ICallReceiver
{
    public void OnReceive()
    {
        Intent intent = new Intent("com.uniconta.CALLER_RECEIVER");
        var incomingPhoneNumber = intent.GetStringExtra(TelephonyManager.ExtraIncomingNumber);
        Globals.ContactNumber = incomingPhoneNumber;
        Forms.Context.SendBroadcast(intent);
    }
} 

DependencyService.Get().OnReceive();

I want this method to be called whenever the user gets a call.

1st question - Is it possible to get the incoming call number in Xamarin forms?
2nd Question - is it possible to launch an app in the background when someone gets a call and app can do things in the background?

Thanks
Anand

Xamarin Forms, cannot generate IPA file for IOS project

$
0
0

Hello,

I have a Xamarin.Forms app that we run on Android, IOS and Windows. Android and Windows work fine and we have them deployed. IOS works fine in the Simulator, and I can install to an iPad via a USB cable. But, I have been unable to generate an IPA file for wider distribution.

When running the Release build (Build IPA is checked), all seems to go well but no IPA file is generated.

The only thing that looks awry is this warning message: "There is no available connection to the Mac, hence the task Xamarin.Messaging.Tasks.CopyFileFromMac will not be executed".

Our MacInCloud server is paired for the build session, so should be "available". But I assume this is why we are not getting the IPA file? Does that message imply that I could/should be able to find the file out on the MacInCloud server somewhere? I looked around, but could not see one.

VS.2019 is latest build, and NuGet Xamarin packages are also latest.

Can anyone give me some guidance on how to get our IPA generated?

Thanks for any help.

Bryan Hunt

Updated to latest Xamarin Forms and now weird build error :(

$
0
0

So today I updated to the latest version of Xamarin Forms and Xamarin Essentials and I am getting a weird build error.
I have restarted visual studio
I have removed the nuget packages and reinstalled.
I have removed the bin and obj files

Help please.....

Visual Material Entry Underline invisibility

$
0
0

Hello,

searched through the internet. Came up with no clue.

How can one remove the underline in entry using visual and still maintain the floating label.

See image below.

The password field is a normal entry with material set to visual.

The one underneath is a custom renderer but i didnt get to remove the underline and keep the text color

when the text color is black, the underline comes back

The custom ios renderer code is

public class RoundedEntryRendererIos : MaterialEntryRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs e)
{
base.OnElementChanged(e);

        if (e.OldElement == null)
        {
            Control.Layer.CornerRadius = 25;
            Control.Layer.BorderWidth = 1f;

            //Control.Layer.BorderColor = Color.LightGray.ToCGColor();
            //Control.Layer.BackgroundColor = Color.White.ToCGColor();

            //Control.LeftView = new UIKit.UIView(new CGRect(0, 0, 10, 0));
            //Control.LeftViewMode = UIKit.UITextFieldViewMode.Always;

            //rounded

            // Transparent, set FromWhiteAlpha(1,1);

            Control.BackgroundColor = UIColor.FromWhiteAlpha(0, 0);

            Control.BorderStyle = UITextBorderStyle.None;
        }
    }
}

Best package for handling text from pdf?

$
0
0

What is the best package for reading (and maybe displaying) text from pdf documents. The text displayed must be selectable but not editable.

There are quite a number of NuGet packages for pdf. Which is the best for my purpose?

— Eigil

Viewing all 79144 articles
Browse latest View live


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