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

Hot Reload does nothing


How to get the clicked item from MpAndroidChart(UltimateXF) in Xamarin forms

$
0
0

I'm using MpAndroidChart(UltimateXF) for my app. I created the piechart successfully but I am unable to create a event listener to get the clicked item when user touched one of piechart item.

This is my UltimateXF library....
https://nuget.org/packages/UltimateXF/

This is my code....

    public partial class HomePage : ContentPage
    {
        public HomePage ()
        {
            InitializeComponent ();

            var entries = new List<PieEntry>();

            entries.Add(new PieEntry(40, "Life"));
            entries.Add(new PieEntry(60, "General"));

            var dataSet4 = new PieDataSet(entries, "")
            {
                Colors = new List<Color>()
                {
                    Color.Accent, Color.Chocolate
                },
                ValueLineColor = Color.Blue,
                SliceSpace = 2f,
                ValueFormatter = new CustomPercentDataSetValueFormatter()
            };
            var data4 = new PieChartData(dataSet4)
            {

            };

            var dataSet5 = new PieDataSet(entries, "")
            {
            };


            pieChart.ChartData = data4;
            pieChart.RotateEnabled = false;

        }
    }


    public class CustomPercentDataSetValueFormatter : IDataSetValueFormatter
    {
        public string GetFormattedValue(float value, int dataSetIndex)
        {
            return value + "%";
        }
    }

FireBase error Exception occured while processing the request

$
0
0

Hello everyone, this is my first post.

I have some trouble that I use FirebaseDataBase.Net api to implement auth and query data, but it always crash. I have spent quite time on google, but no solution I found.

this is my code:

var client = new FirebaseClient("https://testforpatientdb.firebaseio.com", 
                        new FirebaseOptions { AuthTokenAsyncFactory = async() => 
                        await auth.LoginWithEmailPassword(AccountEntry.Text, PasswordEntry.Text) });
//auth.login is refer from "https://medium.com/firebase-developers/firebase-auth-on-xamarin-forms-171432aa3d76"
var firebase = client.Child("Patients");

var child = await firebase.OrderByKey().OnceAsync<Patient>();
//I use step by step execute, and I found this line is problem.

it will show exception message like:
Firebase.Database.FirebaseException: 'Exception occured while processing the request.
Request Data:
Response: [{"FamilyPhoneNumber":"4321-65","Name":"Xi","PatientStatus":"Danger","Pricipal":"SB","PricipalPhoneNumber":"1234-1"}]'

this is my firebase data:

{
  "Patients" : [ {
    "FamilyPhoneNumber" : "4321-65",
    "Name" : "Xi",
    "PatientStatus" : "Danger",
    "Pricipal" : "SB",
    "PricipalPhoneNumber" : "1234-1"
  } ]
}

I think I have actually gotten response data from firebase accroding to the exception. but I don't know how to fix it not to crash.
please give me some solution! thanks.

Path too long Xamarin iOS Distribute

$
0
0

Help me pls i can't distribute because my paths are too long.
I tried to change them but it didn't help.
I'm really out of ideas.
That's the error:
Unable to copy file "C:\Users\cunnin\AppData\Local\Xamarin\MonoTouch\Archives\2019-10-18\ZAsetMobile.iOS 10-18-19 10.22 AM.xcarchive\mSYMs\ZAsetMobile.iOS.app.mSYM\b5883af4fb74101e3ffa838fae7f2094\Microsoft.Extensions.DependencyInjection.Abstractions.dll.msym" to "obj\iPhone\AppStore\archives\ZAsetMobile.iOS 10-18-19 10.22 AM.xcarchive\mSYMs\ZAsetMobile.iOS.app.mSYM\b5883af4fb74101e3ffa838fae7f2094\Microsoft.Extensions.DependencyInjection.Abstractions.dll.msym". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

I don't finds a way to change the path in xamarin settings.

ITMS-90809:Deprecated API Usage-Apple will stop accepting submissions of apps that use UIWebView API

$
0
0

Yesterday, I uploaded my App to TestFlight and after a while, Apple sent me this warning:

ITMS-90809: Deprecated API Usage - Apple will stop accepting submissions of apps that use UIWebView APIs. See https://developer.apple.com/documentation/uikit/uiwebview for more information.

I am using WebView for showing HTML data in my app. Also, I have used WebView for playing audio and video. So is this warning reject my app when submitting for review or should I change these features with some other APIs?

In this link provided by AppStore, telling about use WKWebView instead of UIWebView, I tried that and no such property found on XAML. Should I need to install any packages for getting that feature? Also, by using WKWebView, is it possible to play audio, video and showing HTML data in the app?

DeserializeObject

$
0
0

Hi guys,
How do I deserialize this : {"status":1,"status_message":"Questioos inserted successfully."}

I am not able to write data into NfcV ISO15693 tag.

$
0
0

Hi,

I am trying to write data into NfcV ISO15693 tag using the below mentioned command,

    NfcV iso15693 = NfcV.Get(tag);

    byte[] arrByt = new byte[7];

                arrByt[0] = 0x02;
                arrByt[1] = 0x21;
                arrByt[2] = (byte) 10;
                arrByt[3] = 0x01;
                arrByt[4] = 0x02;
                arrByt[5] = 0x03;
                arrByt[6] = 0x04;

    iso15693.Connect();
    byte[] returnData = iso15693.Transceive(arrByt);

The above command will erase the data in the mentioned block ( Here in this example the 10th block), but it is not writing data into that block after erasing. When I read back I will get empty result in that block.

Please help me to fix this issue.

Thanks in advance.

Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED in Android. Works in iOS

$
0
0

Hi,

Please go through the below exception and suggest the resolution of this error.

  • Happens only when calling any API and only in Android. Works in iOS without any exceptions.
  • Using XF v4.0.30319
    Approaches tried:
    As mentioned in some forums, tried to change the HTTPClient of Android project to Android but didn't worked out.

Attached the complete exception

08-20 09:46:34.678 E/mono (13095): Unhandled Exception:
08-20 09:46:34.678 E/mono (13095): System.Net.Http.HttpRequestException: An error occurred while sending the request ---> System.Net.WebException: Error: TrustFailure (A call to SSPI failed, see inner exception.) ---> System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> Mono.Btls.MonoBtlsException: Ssl error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED
08-20 09:46:34.678 E/mono (13095): at /Users/builder/jenkins/workspace/xamarin-android-d15-8/xamarin-android/external/mono/external/boringssl/ssl/handshake_client.c:1132
08-20 09:46:34.678 E/mono (13095): at Mono.Btls.MonoBtlsContext.ProcessHandshake () [0x00038] in :0
08-20 09:46:34.678 E/mono (13095): at Mono.Net.Security.MobileAuthenticatedStream.ProcessHandshake (Mono.Net.Security.AsyncOperationStatus status) [0x0003e] in :0
08-20 09:46:34.678 E/mono (13095): at (wrapper remoting-invoke-with-check) Mono.Net.Security.MobileAuthenticatedStream.ProcessHandshake(Mono.Net.Security.AsyncOperationStatus)
08-20 09:46:34.678 E/mono (13095): at Mono.Net.Security.AsyncHandshakeRequest.Run (Mono.Net.Security.AsyncOperationStatus status) [0x00006] in :0
08-20 09:46:34.678 E/mono (13095): at Mono.Net.Security.AsyncProtocolRequest+d__24.MoveNext () [0x000ff] in :0
08-20 09:46:34.678 E/mono (13095): --- End of stack trace from previous location where exception was thrown ---
08-20 09:46:34.678 E/mono (13095): at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <43dbbdc147f2482093d8409abb04c233>:0
08-20 09:46:34.678 E/mono (13095): at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <43dbbdc147f2482093d8409abb04c233>:0
08-20 09:46:34.678 E/mono (13095): at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <43dbbdc147f2482093d8409abb04c233>:0
08-20 09:46:34.678 E/mono (13095): at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <43dbbdc147f2482093d8409abb04c233>:0
08-20 09:46:34.678 E/mono (13095): at Mono.Net.Security.AsyncProtocolRequest+d__23.MoveNext () [0x0008b] in :0
08-20 09:46:34.678 E/mono (13095): --- End of inner exception stack trace ---


BindableProperty compilation error

$
0
0

After upgrading to Xamarin.Forms version 4.3 the bindable properties that I create are giving the following error:

Error: Position 33:74. No property, bindable property, or event found for 'Image', or mismatching type between value and property.

Here is my code:

 public partial class BehaviorAnimalComponentUserControl : Frame
 {
        public ImageSource Image
        {
            get { return (ImageSource)GetValue(ImageProperty); }
            set { SetValue(ImageProperty, value); }
        }

        private static readonly BindableProperty ImageProperty = BindableProperty.Create(nameof(Image),
                                                                                           typeof(ImageSource),
                                                                                           typeof(BehaviorAnimalComponentUserControl),
                                                                                           null,
                                                                                           BindingMode.TwoWay,
                                                                                           null,
                                                                                           OnImagePropertyChanged,
                                                                                           null,
                                                                                           null,
                                                                                           null);

        private static void OnImagePropertyChanged(BindableObject bindable, object oldValue, object newValue)
        {
            var control = bindable as BehaviorAnimalComponentUserControl;

            if (control != null)
                control.profileImage.Source = (ImageSource)newValue;
        }
}

this problem is also happening for primitive properties.

In my project I have several user controls and had never given a problem, I do not know what happened after updating, I may not have seen any change that is necessary to make, but this makes no sense because the old ones that already worked continue.

iOS Xamarin.Forms.Editor does not scroll

$
0
0

Hi
I am using Xamarin.Forms.Editor with height request given.
When I edit it or enter new line I am able to scroll till end.
But when we launch it with pre-filled text (where text is more than its height) then it does not scroll and only few lines are visible.
If we edit and add some more lines to text, then it enables its scroll, but not on launch.

        var stackEditor = new StackLayout()
                             {
                                  BackgroundColor = Color.LightGray,
                                  Padding = 1,
                                  HeightRequest = 80,
                                 Margin = new Thickness(10, 30, 10, 10),
                                  VerticalOptions = LayoutOptions.Start
                              };

        var textEditor = new Editor()
                         {
                             FontSize = 15,
                             Keyboard = Keyboard.Text,
                             HeightRequest = 80,
                             BackgroundColor = Color.White,
                         };

        textEditor.Text = "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14";
        stackEditor.Children.Add(textEditor);

        Content = stackEditor;

Here on launch of the editor we can not go to more than 5 number.

Anyone knows the solution for this?

UWP Listview binding data template binding to page view model instead of ItemsSource class

$
0
0

I have a Xamarin forms project with Android and UWP targets. The Android version has been fully tested and released and works great. I'm using the latest versions of Xamarin (4.2.0.848062). I'm currently working on the UWP version and have run into an issue in the shared project. As stated, everything works fine on Android, but not in UWP. Here's the scenario and the pertinent information:

I have a viewmodel that derives from a class that has the following:
public ICommand IncrementCommand { get { // blah, blah, blah } }

The viewModel is bound to my page with the following xaml (only showing pertinent code).
Test

 <ListView ItemTapped="OnListViewTapped" 
        ItemsSource="{Binding CarriageMotorCfg}" 
        HasUnevenRows="true">

        <ListView.ItemTemplate>
          <DataTemplate>
            <ViewCell>
                            <StackLayout Orientation="Vertical">

                                    <local:ImageButton 
                        Source="{local:ImageResource EclipseDiag.images.plus.png}" Command="{Binding IncrementCommand}" CommandParameter="MotorCountString" Aspect="AspectFit" Margin="0" />

                                    <Entry Text="{Binding MotorCountString, Mode=TwoWay}" 
                            Placeholder="xxxx"
                            Keyboard="Numeric" 
                            VerticalOptions="Center"/>
...

CarriageMotorCfg is an ObservableCollection of a class that happens to contain the following (note, it is the same name as in the viewmodel above:
public ICommand IncrementCommand { get { // blah, blah, blah } }

When I try to load the page while running on UWP, the Binding of 'IncrementCommand' 'within the listview data template ends up getting mapped to the page's ViewModel instead of the class of CarriageMotorCfg. All of the other bindings in the template get mapped to the 'CarriageMotorCfg' class as desired. It is like the Xamarin UWP implementation is first checking the ViewModel for a match of 'IncrementCommand' before checking the class of 'CarriageMotorCfg'. If I change the name of the command within the 'CarriageMotorCfg' class to 'IncrementCommand2' and also change the XAML, then everything works as expected.

As stated above, this code works fine on Android so it seems to be this is a bug in Xamarin UWP. Any thoughts on fixing this without having to rename the commands?

[0:] Binding: can not be converted to type 'System.Double'

$
0
0

Hello, i updated to the newest Xamarin.Forms Version and not get the following Error:

[0:] Binding: can not be converted to type 'System.Double'

The binding is on a Label where i show a value from a dictionary. The Value is converted to string with a custom IValueConverter.
Before the update everything worked perfectly. I already tried alot but nothing worked.

That's the binding in Codebehind:

value.SetBinding(Label.TextProperty, new Binding(string.Format("InputRegisters[{0}]", parameterOrSubemnu.Parameter.ModbusRegisterItem.RegisterAddress),
converter: registerItemConverter, converterParameter: parameterOrSubemnu.Parameter, source: CurrentDevice.DataStore));

The dictionary: InputRegisters = new ConcurrentDictionary<ushort,ushort>();

I'm looking forward for any help.

Kind Regards,
David

Best way to avoid "Locked" or "Busy" using SQLite with concurrency and BeginTransaction and Dispose

$
0
0

This post is to try to find the best way to avoid the SQLite exceptions "Locked" or "Busy" in an enviroment with concurrency using BeginTransaction, Commit, Close and Dispose.

As we know, if there are two or more operations in the database at the same time, it is possible to get the errors Locked" or "Busy".

I did see that the best way to work in an enviroment with concurrency is create the connection once and never close, but using this way I'm get other errors when I try to crete a new Transaction when I'm in one, so I need to commit first before begin a new transaction.

For a company request, we need to use the "Rollback Transaction" when one DB operation fails, for that reason I'm using BeginTransaction, Commit, Close and Dispose.

This are a resume of the methos that I'm using.

Connection in Shared project:

    public static SQLiteConnection conn;


        public static SQLiteConnection ObtenerConexion()
        {
             conn = DependencyService.Get<AccesoDatosI>().ObtenerConexion();

            return conn;
        }

Connection in Android project:

public SQLite.SQLiteConnection ObtenerConexion()
        {
            lock (semaforo)
            {
                var sqliteFileName = "BD.db3";
                string documentsPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
                var path = Path.Combine(documentsPath, sqliteFileName);
                var conn = new SQLite.SQLiteConnection(path, SQLiteOpenFlags.ReadWrite | SQLiteOpenFlags.Create | SQLiteOpenFlags.SharedCache);

                return conn;
            }
        }

Logic method:

public async void Save(List<Office> lista)
        {
            try
            {
               // Get the conn and begin the transaction
                BeginTransaction();

                // Objeto DAO.
                OfficeDAO objOfficeDAO = new OfficeDAO(this.Connection);

                // We make the DB operation.
                objOfficeDAO.Save(this.Connection, lista);

                //  We apply the operation. Commit and Close Connection.
                ApplyTransaction(true);
            }
            catch (Exception e)
            {
                UndoTransaction(true, e);

                throw e;
            }
        }

Methods that interacts with the database:

// Save list of objects
public void Save(SQLiteConnection connection, List<Office> lista)
        {
            try
            {

                connection.InsertAll(lista);
            }
            catch (Exception e)
            {
                throw e;
            }
        }

// We begin the transaction.
public static SQLiteConnection BeginTransaction(SQLiteConnection connection)
        {
            connection.BeginTransaction();

            return connection;
        }

// We make the commit.
public static void ApplyTransaction(SQLiteConnection connection, bool close)
        {
            connection.Commit();

            if (close)
            {
                CloseConnection(connection);
            }
        }

// We close connection.
public static void CloseConnection(SQLiteConnection connection)
        {
            connection.Close();
            connection.Dispose();

        }
// We undo the trasaction.
public static void UndoTransaction(SQLiteConnection connection, bool close)
        {
            connection.Rollback();

            if (close)
            {
                CloseConnection(connection);
            }
        }

I think that I did everything to avoid thats errors, but I can't find a solution to this using the BeginTransaction and Dispose the connection.

We are try to find the best way to solve this using the SQLite tools without to create another solution, I mean, we try to SQLite can deal with this erros without create another solution that don't involve SQLite.

I'm going to glad to read your comments.

Thanks in advance.

Images with url source not showing on Android

$
0
0

I have used the visual studio with version 16.2, yesterday I updated Visual Studio to the new 16.3 version and now, all the images that have an url source, don't show it on Android. Before to update the visual studio version, all the images work perfectly.

  • I checked the HttpClient Implementation, and I have (Android) but I had tested with (Administrativo).
  • I checked the SSL/TLS Implementation, and I have (Native TLS 12+)
  • I checked all the Xamarin.Android packages and I had to update it to the v28.0.0.3 and now I have all the android packages at the last version

In the iOS emulator, I can see the images, but Android no...

Can anyone help me???

Listview, scrolling position.

$
0
0

Good Afternoon, Morning, Evening

I have a 3 list views in three columns, I have it set up this way for spacing issues.

Essentially, the 3 lists are the same list just different parts of the same class.

I want the three lists to scroll synchronously

Is there any way to bind the "scrolled percentage" to the other 2 listviews?


listview with groups System.ArgumentException: 'An item with the same key has already been added

$
0
0

Hi,
In my xamarin forms app i have a listview with grouping but every time i try to render it i get
System.ArgumentException: 'An item with the same key has already been added

Looked all over the internet for a few days now tried a lot of solutions but nothig seems to be working

anybody has any idea what is wrong
Here is my code
XAML

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
         xmlns:d="http://xamarin.com/schemas/2014/forms/design"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         mc:Ignorable="d"
         x:Class="SubiektRPC.Views.PurcheseInvioceDetailsPage"
         Title="{Binding Title}"
         x:Name="InviceDetail">
<StackLayout>
        <ListView
           x:Name="MainDetailsListViem"
           HasUnevenRows="True"
           VerticalOptions="FillAndExpand"
           IsPullToRefreshEnabled="True"
           SelectionMode="None"
           IsRefreshing="{Binding IsBusy, Mode=OneWay}"
            RefreshCommand="{Binding LoadInvioceDetails}"
            IsGroupingEnabled="True"
            GroupDisplayBinding="{Binding Key}"
            GroupShortNameBinding ="{Binding ShortKey}"
            >
        <d:ListView.ItemsSource>
            <x:Array Type="{x:Type x:String}">
                <x:String>First Item</x:String>
                <x:String>Second Item</x:String>
                <x:String>Third Item</x:String>
                <x:String>Forth Item</x:String>
                <x:String>Fifth Item</x:String>
                <x:String>Sixth Item</x:String>
            </x:Array>
        </d:ListView.ItemsSource>

        <ListView.ItemTemplate>
                <DataTemplate>
                <ViewCell>
                    <StackLayout Padding="10">
                        <Label Text="{Binding ItemTitle}" 
                            d:Text="{Binding .}"
                            LineBreakMode="NoWrap" 
                            Style="{DynamicResource ListItemTextStyle}"
                            FontSize="Large" />
                        <Label Text="{Binding ItemDescriptionLineOne}" 
                            d:Text="Item descripton"
                            LineBreakMode="NoWrap"
                            Style="{DynamicResource ListItemDetailTextStyle}"
                            FontSize="Large" />
                        <Label Text="{Binding ItemDescriptionLineTwo}" 
                            d:Text="Item descripton"
                            LineBreakMode="NoWrap"
                            Style="{DynamicResource ListItemDetailTextStyle}"
                            FontSize="Large" />
                        <Label Text="{Binding ItemDescriptionLineThree}" 
                            d:Text="Item descripton"
                            LineBreakMode="NoWrap"
                            Style="{DynamicResource ListItemDetailTextStyle}"
                            FontSize="Large" />
                    </StackLayout>
                </ViewCell>


                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
    </StackLayout>

`

Code behind

public partial class PurcheseInvioceDetailsPage : ContentPage
{
InvoiceDetailsViewModel viewModel;
public PurcheseInvioceDetailsPage()
{
InitializeComponent();
}

    public PurcheseInvioceDetailsPage(ListItem item)
    {
        InitializeComponent();
        BindingContext = viewModel = new InvoiceDetailsViewModel(item);
        MainDetailsListViem.ItemsSource = viewModel.Data;

    }

}

view model

` public class InvoiceDetailsViewModel : BaseViewModel
{
public ObservableCollection Data { get; set; }
public Command LoadInvioceDetails { get; set; }
ListItem doc;

    public InvoiceDetailsViewModel(ListItem doc)
    {
        Data = new ObservableCollection<ListItemGrouped>();
        this.doc = doc;
        LoadInvioceDetails = new Command(async () => await ExecuteLoadInvoiceDetailsCommand());

        Title = doc.ItemDescriptionLineOne;
        ExecuteLoadInvoiceDetailsCommand();


    }


    async Task ExecuteLoadInvoiceDetailsCommand()
    {
        if (IsBusy)
            return;

        IsBusy = true;

        try
        {
            Data.Clear();
            App.hub.OnGetDocContentResponseRecived += OnGetDocContentResponseRecived;
            GetDocContentReqest getDocContentReqest = new GetDocContentReqest();
            getDocContentReqest.docId = doc.id;

            App.hub.SendPacketOnConnection(getDocContentReqest);
        }
        catch (Exception ex)
        {
            Debug.WriteLine(ex);
        }

    }

    private void OnGetDocContentResponseRecived(object sender, GetDocContentResponseEventArgs e)
    {
        if(e.response.Success)
        {
            Data.Clear();
            ListItemGrouped client = new ListItemGrouped("test","t");

            client.Add(e.response.docContent[0]);
            Data.Add(client);
            ListItemGrouped doccontent = new ListItemGrouped("Adat","e");
            //doccontent.Key = "Pozycje dokumentu";
            //doccontent.ShorKey = "1";
           for(int i =1;i<e.response.docContent.Count;i++)
            {
                doccontent.Add(e.response.docContent[i]);
            }
            Data.Add(doccontent);
            IsBusy = false;

        }
    }

}`

ListItem

`public class ListItem : INotifyPropertyChanged
{
public int id
{
get
{
return Id;
}
set
{
SetProperty(ref Id, value);
}
}
private int Id;

    public string ItemTitle
    {
        get
        {
            return itemTitle;
        }
        set
        {
            SetProperty(ref itemTitle, value);
        }
    }
    string itemTitle;
    public string ItemDescriptionLineOne
    {
        get
        {
            return itemDescriptionLineOne;
        }
        set
        {
            SetProperty(ref itemDescriptionLineOne, value);
        }
    }
    string itemDescriptionLineOne;
    public string ItemDescriptionLineTwo
    {
        get
        {
            return itemDescriptionLineTwo;
        }
        set
        {
            SetProperty(ref itemDescriptionLineTwo, value);
        }
    }
    string itemDescriptionLineTwo;
    public string ItemDescriptionLineThree
    {
        get
        {
            return itemDescriptionLineThree;
        }
        set
        {
            SetProperty(ref itemDescriptionLineThree, value);
        }
    }
    string itemDescriptionLineThree;


    protected bool SetProperty<T>(ref T backingStore, T value,
        [CallerMemberName]string propertyName = "",
        Action onChanged = null)
    {
        if (EqualityComparer<T>.Default.Equals(backingStore, value))
            return false;

        backingStore = value;
        onChanged?.Invoke();
        OnPropertyChanged(propertyName);
        return true;
    }


    public event PropertyChangedEventHandler PropertyChanged;
    protected void OnPropertyChanged([CallerMemberName] string propertyName = "")
    {
        var changed = PropertyChanged;
        if (changed == null)
            return;

        changed.Invoke(this, new PropertyChangedEventArgs(propertyName));
    }
}`

grouping class
` public class ListItemGrouped : ObservableCollection
{
public string Key { get; set; }
public string ShorKey { get; set; }
public ListItemGrouped()
: base()
{

    }
    public ListItemGrouped(string key, string shortkey) : base()
    {
        Key = key;
        ShorKey = shortkey;
    }

    public override string ToString()
    {
        string ret = "Header" + Key;
        foreach(var item in this)
        {
            ret += item.id + Environment.NewLine;
            ret += item.ItemTitle + Environment.NewLine;
            ret += item.ItemDescriptionLineOne + Environment.NewLine;
            ret += item.ItemDescriptionLineTwo + Environment.NewLine;
            ret += item.ItemDescriptionLineThree + Environment.NewLine;
            ret += "======================================================";
        }
        return ret;
    }
}`

swipe popup xamarin forms

$
0
0

after serching i find this negut popup from buttom but i have a problem control hieght of this popup github. com/JimmyPun610/Plugin.XF.Backdrop
there is a method for swipe popup from buttom use Rg.Plugins.Popup or any other idea

ListView items not completely loaded using xamarin.forms

$
0
0

My List View controller doesn't load all the elements, just it loads 1 element in this case, in other cases it loads like 4 but the others don't

As I have test where the problem occurs i have known that the problem is over the Frame controller, thanks to the frame most of my items on my List View dont load

image of the current problem:

Right align Switch rendering in UWP not correct

$
0
0

I have a Xamarin Forms project with Android and UWP targets. I have a page that requires left and right aligned switch controls. On Android it works as expected. On UWP, the switch that is supposed to be end aligned has a large space to the right. Here's some code that demonstrates the problem:

<StackLayout >
    <Label Text=" "/>
    <Label Text="This example shows poor alignment of switch with EndAndExpand on UWP"/>
    <Label Text="How can I get the switch to right-align on the page?"/>
    <Label Text=" "/>
    <StackLayout Orientation="Horizontal">
        <Label Text="Left Justified" HorizontalOptions="StartAndExpand"/>
        <Label Text="Right Justified" HorizontalOptions="EndAndExpand"/>
    </StackLayout>
    <StackLayout Orientation="Horizontal">
        <Switch HorizontalOptions="StartAndExpand"/>
        <Switch HorizontalOptions="EndAndExpand" />
    </StackLayout>

    <Label Text="Flow Direction changed to RightToLeft"/>
    <StackLayout Orientation="Horizontal">
        <Switch HorizontalOptions="StartAndExpand" FlowDirection="RightToLeft"/>
        <Switch HorizontalOptions="EndAndExpand" FlowDirection="RightToLeft" />
</StackLayout>
    <Label Text="Switch now aligns completely to right but on/off direction is backwards"/>    
</StackLayout> 

Here is the rendered page:

How can I get my UWP code to right-align the switch so it shows up under my label (and thus match the Android rendering)?

Debugger won't start app on iOS device

$
0
0

Since updating to the current Beta, when I start an application in Debug under Visual Studio 2015 Update 2, it won't start in debug on a physical device iOS, works fine in the simulator. I thought it could be something wrong with my application, so I create the "default" Welcome to Xamarin Forms app, and have the same result. Works fine in the iPhoneSimulator, but not with a real device. Error message in the output window is "Launch failed. The app 'xxxApp' could not be launched on 'iPhone 6'. Please check the logs for more details." Anyone else having this same issue?

The log is full of exceptions starting with:
Xamarin.Messaging.Exceptions.MonotouchException: warning HE0041: Error while processing device notifications: NotificationCallback with unknown message : 5 at Xamarin.Messaging.IDB.MTouch+d__6.MoveNext () <0x7955390 + 0x007c3> in :0

Viewing all 79144 articles
Browse latest View live


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