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

Why a new project show me this error??

$
0
0

Hello Friends, i'm new in Xamarin, i have VS 2019 last update and Xamarin Last Update, but i a create a new mobile project the compiler show me this error

"Severity Code Description Project File Line Suppression State
Error CS1503 Argument 3: cannot convert from 'Xamarin.Android.Content.PM.Permission[]' to 'Android.Content.PM.Permission[]' Xamarin.Hola.Android \Experimental\Xamarin.Hola\Xamarin.Hola\Xamarin.Hola.Android\MainActivity.cs 32
"

This error come from MainActivity.cs on "override void OnRequestPermissionsResult", now if i comment this override the project work!!, but this is correct???, can you help to resolve this!

Thank's

Paramaconi


How to Play Youtube Video in Xamarin Forms?

$
0
0

In my app I want to create a list of video I have published on YouTube. I saw the common answer is to use a WebView. Then, I created the following code:

<WebView Source="{Binding VideoUrl}" 
                   HorizontalOptions="Fill" VerticalOptions="Fill"
                   IsVisible="{Binding ShowVideo}" />

It is ok is I use the share url like this one https://youtu.be/rAGh8iy9YnU but I see the entirely YouTube page. I want to display only the video and, if it is possible, some easy controls for play and stop.

I tried to use the embedded link from YouTube (like https://www.youtube.com/embed/rAGh8iy9YnU).

I can see the preview image but the video doesn't play and an error is displayed: "Video unavailable".

Why does the Xamarin Form frame not match the device resolution

$
0
0

This question is specific to Xamarin forms running on an Android tablet.

I have a device with a screen resolution of 1280x800. A call to Xamarin.Essentials.DeviceDisplay.MainDisplayInfo confirms this, however the width and height passed in the Xamarin forms page OnSizeAllocated is different. The end result is that the screens layouts do not show as anticipated for the device resolution.

For example, the below code (in the code behind) provides the following values:
widthx=1280 (From Essentials)
heightx=800 (From Essentials)
width=961.50229575812
height=600.938934848825

protected override void OnSizeAllocated(double width, double height)
    {
        base.OnSizeAllocated(width, height);

        var mainDisplayInfo = DeviceDisplay.MainDisplayInfo;
        // Width (in pixels)
        var widthx = mainDisplayInfo.Width;
        // Height (in pixels)
        var heightx = mainDisplayInfo.Height;
        // Screen density
        var densityx = mainDisplayInfo.Density;            
    }

I have seen this behavior before, but only when changing the Android screen Zoom setting, in my case the Zoom level is set for no Zoom. There are no screen accessibility settings enabled.
I tried this on several new Samsung tablets with similar result, however on one of my older Samsung tablets the values matched as expected. Also, some emulators have results where the values match (as expected) and some emulators have the same behavior I am seeing here.

Anyone have any ideas why I am seeing this seemingly random and unpredictable behavior?

Using a treeview to build a dynamic list of settings for an app.

$
0
0

Okay, I am trying to set up a settings page for my app. On this page I want the user to select a series of options for what fields to display on another page.
I have a settings system overloaded using the using Xamarin.Essentials; extensions, so I can handle lookup, generation, and clearing of various settings. I will then later in the target page use these functions to alter various IsVisible options.

When a switch is toggled (or eve checkbox checked unchecked) I want the StateChanged event to fire and run my custom callback using the dynamic data from the event to modify the internal stored settings for the app.

I am thinking that it should go something like this...

This is a dataclass to store a group of settings to be passed to the treeview.

public class SettingsOption : EventParent, INotifyPropertyChanged
{

    /// <summary>
    /// private storage Displayname
    /// </summary>
    private string displayname;

    /// <summary>
    /// private storage ImageIcon
    /// </summary>
    private ImageSource imageIcon;

    /// <summary>
    /// private storage PropertiesGroup
    /// </summary>
    private ObservableCollection<SettingsOption> propertiesGroup;

    /// <summary>
    /// private storage PropertyName
    /// </summary>
    private string propertyName;

    /// <summary>
    /// Gets or sets the value for Displayname
    /// </summary>
    public string Displayname
    {
        get => displayname;

        set
        {
            SetProperty(ref displayname, value, nameof(Displayname));
            OnPropertyChanged(nameof(Displayname));
        }
    }

    /// <summary>
    /// Gets or sets the value for ImageIcon
    /// </summary>
    public ImageSource ImageIcon
    {
        get => imageIcon;

        set
        {
            SetProperty(ref imageIcon, value, nameof(ImageIcon));
            OnPropertyChanged(nameof(ImageIcon));
        }
    }

    /// <summary>
    /// Gets or sets the value for PropertiesGroup
    /// </summary>
    public ObservableCollection<SettingsOption> PropertiesGroup
    {
        get => propertiesGroup;

        set
        {
            SetProperty(ref propertiesGroup, value, nameof(PropertiesGroup));
            OnPropertyChanged(nameof(PropertiesGroup));
        }
    }

    /// <summary>
    /// Gets or sets the value for PropertyName
    /// </summary>
    public string PropertyName
    {
        get => propertyName;

        set
        {
            SetProperty(ref propertyName, value, nameof(PropertyName));
            OnPropertyChanged(nameof(PropertyName));
        }
    }

    /// <summary>
    /// Defines the PropertyChanged
    /// </summary>
    public event PropertyChangedEventHandler PropertyChanged;
    /// <summary>
    /// The RaisedOnPropertyChanged
    /// </summary>
    /// <param name="_PropertyName"> The _PropertyName <see cref="string" /> </param>
    public void RaisedOnPropertyChanged(string _PropertyName)
    {
        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(_PropertyName));
    }
}

This is a function I created in order to make a lookup and toggle of the setting possible

    /// <summary>
    /// Bounce the setting by name if it does not exist, create it and return the default state
    /// </summary>
    /// <param name="settingName"> </param>
    /// <returns> </returns>
    private bool BounceSetting(string settingName)
    {
        if (!AppSettingsFunctions.CheckKey(settingName))
        {
            AppSettingsFunctions.SaveSettingData(settingName, true);
        }
        else
        {
            //Save the new setting as a process of the inverse of getting the existing data
            AppSettingsFunctions.SaveSettingData(settingName, !AppSettingsFunctions.GetBoolSetting(settingName));
        }

        return AppSettingsFunctions.GetBoolSetting(settingName);
    }

I want to then be able to setup the treeview like this.

    private void BuildSettingsTreegroups()
    {
        tvSettingsOptions.ChildPropertyName = "PropertiesGroup";
        tvSettingsOptions.ItemTemplateContextType = ItemTemplateContextType.Node;
        tvSettingsOptions.IsAnimationEnabled = true;
        tvSettingsOptions.Indentation = 20;
        tvSettingsOptions.AutoExpandMode = Syncfusion.TreeView.Engine.AutoExpandMode.RootNodesExpanded;
        tvSettingsOptions.ItemsSource = SettingsGroup;
        tvSettingsOptions.ItemTemplate = new DataTemplate(() =>
        {
            var displayName = new Label { VerticalTextAlignment = TextAlignment.Center };
            var slEntry = new StackLayout { Orientation = StackOrientation.Horizontal };
            var optionIcon = new Image { HeightRequest = 26, WidthRequest = 26 };
            var swSetting = new SfSwitch();

            optionIcon.SetBinding(Image.SourceProperty, new Binding("Content.ImageIcon"));

            displayName.SetBinding(Label.TextProperty, new Binding("Content.Displayname"));

            swSetting.SetBinding(SfSwitch.IsOnProperty, AppSettingsFunction.GetBoolSetting("Content.PropertyName"));
            swSetting.StateChanged += (s, e) => BounceSetting("Content.PropertyName");

            slEntry.Children.Add(optionIcon);

            slEntry.Children.Add(displayName);
            slEntry.Children.Add(swSetting);

            return slEntry;
        });
    }

The problem is that the swSetting binding. To get the current setting the app needs to call the settings function I overloaded in my AppSettingsFunction class.

With the above code I could theoretically build my settings page like this then building an ObservableCollection<SettingsOptions> object that I populate my settings into like this ...

...

        var mainOptionsgroup = new SettingsOption();

        var inventoryOptions = new SettingsOption();
        inventoryOptions.Displayname = "Select Inventory options to hide";
        inventoryOptions.ImageIcon = "InventoryIcon";
        inventoryOptions.PropertiesGroup.Add(new SettingsOption { Displayname = "Size", PropertyName = "inv_ShowSize" });
        inventoryOptions.PropertiesGroup.Add(new SettingsOption { Displayname = "SKU", PropertyName = "inv_SKU" });
        inventoryOptions.PropertiesGroup.Add(new SettingsOption { Displayname = "Price", PropertyName = "inv_Price" });

        var supplierPageOptions = new SettingsOption();
        supplierPageOptions.Displayname = "Select Supplier options to hide";
        supplierPageOptions.ImageIcon = "Suppliers";
        supplierPageOptions.PropertiesGroup.Add(new SettingsOption { Displayname = "Account#", PropertyName = "sup_Account" });
        supplierPageOptions.PropertiesGroup.Add(new SettingsOption { Displayname = "Phone Number", PropertyName = "sup_Phone" });
        supplierPageOptions.PropertiesGroup.Add(new SettingsOption { Displayname = "Address", PropertyName = "sup_Address" });

        mainOptionsgroup.Displayname = "Settings";
        mainOptionsgroup.PropertiesGroup.Add(inventoryOptions);
        mainOptionsgroup.PropertiesGroup.Add(supplierPageOptions);

...

The end result should be a treeview that would look something like this

Settings
    |
    |------  Select Inventory options to hide
    |           |
    |           |-- Size    [x]
    |           |-- SKU [x]
    |           |-- Price   [x]
    |
    |------ Select Supplier options to hide
    |           |
    |           |-- Account#        [x]
    |           |-- Phone Number    [x]
    |           |-- Address     [x]

I am not sure how I could go about implementing this, and will for the time being probably have to use a less elegant alternative, HOWEVER, I would really like to get something like this working, if anyone has any ideas?

As always any ideas, guidance, or suggestions are greatly appreciated!

error MT2001

$
0
0

error MT2001: Could not link assemblies. Reason: Error while processing references of 'ProjectName.iOS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
?

Released some Xamarin.Forms NuGet packages

$
0
0

Hi, I released the following NuGets in case anyone else needs the functionality:

Xamarin.Forms.Chips - Chip support for Xamarin.Forms
Xamarin.Forms.DragView - A draggable pane component for Xamarin.Forms
Xamarin.Forms.SlideView - A sliding view component for Xamarin.Forms
Xamarin.Forms.ExtendedLifecycleContentPage - Extended lifecycle support for Xamaring.Forms.ContentPage

Direct NuGet package URLs:
https://www.nuget.org/packages/Xamarin.Forms.Chips/
https://www.nuget.org/packages/Xamarin.Forms.DragView/
https://www.nuget.org/packages/Xamarin.Forms.SlideView/
https://www.nuget.org/packages/Xamarin.Forms.ExtendedLifecycleContentPage/

They are extremely lightweight and do only the thing it says on the tin can. Hope you find them useful.

Remove Navigation Bar Shadow/Line

$
0
0

I'd like to remove the line separating the navigation bar from the rest of the page in iOS.

Should I use Prism?

$
0
0

Hello! I've been developing for iOS and Android since Monotouch days and use Miguel's rapid UI coding tool from way back when (can't remember the name of it). I'm ready to do a complete rewrite on one of my iOS/Android apps and have been researching Xamarin Forms and think I'm going to use it, looks impressive. I was hesitant due to the restrictions I faced years ago with the prior rapid UI coding tool. I'm new to WPF, XAML, MVVM but have been reading a lot, watching a lot on Pluralsight and also stumbled on Prism for Xamarin Forms.

My question is should I use Prism or just use out of the box Xamarin Forms which seems mature on its own with its own MVVM tooling. My fear with more 3rd party dependencies is something that doesn't work or keep up with the Xamarin Forms upgrade cycles and I'm stuck waiting on updates.

What is your opinion on a new Xamarin Forms user, yet experienced mobile developer, using Prism?

Thank you.


How to Focus an Entry control in a unit test

$
0
0

I am writing unit tests for a Behavior that attaches to an Entry. One of the methods only performs its operation if the Entry is focused. I can't work out how to focus (or fake IsFocused) the Entry control. Is this possible?

As this is a unit test for the logic of the behavior itself I don't want to write a UI test.

Update Xamarin Andorid in VS

$
0
0

Buenas noches, tengo Visual Studio 2017 15.9.0, quería saber como puedo actualizar Xamarin Android de la versión 9.1.0 a la 9.4.0

En las actualizaciones de Visual Studio 2017 aparece la versión más reciente 15.9.22, pero no se si actualziandolo se me actualiza Xamarin Android a la versión 9.4.0 requerida.

Gracias por su ayuda.

Gravedad Código Descripción Proyecto Archivo Línea Estado suprimido
Error Android X migration requires a minimum Xamarin.Android version of 9.4.0. Your version is 9.1.0. Please upgrade your Xamarin installation to a newer version. ContableXamarin.Droid

How to implement material outlined Textfield with trailing icon in Xamarin.Forms

$
0
0

I have been trying to implement material visual for my app in Xamarin Forms. Right now i am focusing on outlined textfield with trailing icon. I have looked into customrenderer, but could not find any answer in Xamarin documentation, forums or any nuget package. Any help in this regard will be highly appreciated.

Xamarin Forms 4.5 AndroidX

$
0
0

With Forms 4.5 dependent on AndroidX, will there be problems if I need nuget that is pre-AndroidX ?

Set and get element by name in code behind or maybe another suggestion

$
0
0

So i have a List of MyModel which has hierarchical structure.

public class MyModel{
public int Id { get; set; }
public string Name{ get; set; }
public int ParentId{ get; set; }
}

I wanted to a create a simple hierarchical layout. So i used this method.

        private void CreateLayoutsHierarchical(List<MyModel> myModelList)
        {
            Dictionary<int, StackLayout> dict = new Dictionary<int, StackLayout>();
            dict.Add(0, RootLayout); //RootLayout is an empty stack layout in the xaml

            foreach (MyModel myModel in myModelList)
            {
                StackLayout parentLayout = null;
                dict.TryGetValue(myModel.ParentId, out parentLayout);

                StackLayout sL = new StackLayout();
                sL.Orientation = StackOrientation.Vertical;
                Label label = new Label();
                label.Text = myModel.Name;

                sL.Children.Add(label);
                dict.Add(myModel.Id, sL);

                parentLayout.Children.Add(sL);
            }

Well it worked but can i do this differently? Hopefully not using a dictionary? I tried setting and getting elements names(maybe HLayout1, HLayout2,..) in code but is that possible? I couldnt do it?

Sending email from app

$
0
0

Hello there!

I'm new to Xamarin.Forms and trying to write my first simple app. I want to email contents of a simple form. Form contains First Name, Last Name and Comments. I've been doing a lot of searching about what is latest and most proper way to create this form. I'm familiar with MVC but not with MVVM. I'm still trying to figure out how to implement this form using MVVM in Xamain.Forms since the apps work differently than a web application.

It seems that people have suggested to send form content to a web service and let the web service send email. I've not written a web service before so not sure if I should use SOAP, WCF or Web API in this context.

Any direction will be appreciated.

Joe

Picker Value not saving

$
0
0

HI i have a picker and the value is not saving.


Application crashes when we sent push notification from Firebase console

$
0
0

Dear All,
I developed xamarin forms androd application, implemented firebase console for push notification, whenever i send message from firebase application get crashed in debug mode am getting following error:

Java.Lang.RuntimeException: Unable to instantiate receiver com.google.firebase.iid.FirebaseInstanceIdInternalReceiver: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" on path: DexPathList[[zip file "/data/app/com.isat.GraduateGuru-tmLocHA5EVv0pwFs-XolYg==/base.apk"],nativeLibraryDirectories=[/data/app/com.isat.GraduateGuru-tmLocHA5EVv0pwFs-XolYg==/lib/arm64, /data/app/com.isat.GraduateGuru-tmLocHA5EVv0pwFs-XolYg==/base.apk!/lib/arm64-v8a, /system/lib64]]

I have enabled "Enable ProGuard" option in "Android options", Checked "Enabel Multi Dex" also. Added Proguard.cfg file and added bellow code

-dontwarn com.google.android.gms.**
-keep class com.google.android.gms.** { *; }
-keep class com.google.firebase.** { *; }

I make this file build action to "Progurad Configuration". but still getting that error. pls help me

thank you.

Navigating from one page to another blank content view is comes up

$
0
0

I'm navigating from one page to another using await NavigationService.NavigateAsync("index/root/mypage",params). The page gets navigated but there's blank content view from last page (i.e page 1) displayed while navigating from page 1 to page 2 and this issue is coming only in android.
The content view is used to display a list of values based on search condition in page1 and is shown/hidden based on conditions.

I'm not sure what is the issue. I checked the visibility of that popup in all the OnNavigatedTo() methods of page1 and 2 and its false.
Has anyone else faced this issue and were able to resolve it? Inputs appreciated. Thanks

BLE notifications on Android some packages get lost

$
0
0

Hello there,

I'm developing an App that connects via bluetooth LE to a peripheral using the Bluetooth LE by xabre plugin(sadly I'm not allowed to use links in my post).
As soon as the connection is established, I start listening to notifications of the peripheral, which is sending data in a 50Hz frequency.

Now using the App in iOS I have no problem and I receive all the packages. But when I run the app on Android I don't receive all the packages. It wouldnt be crucial to loose some packages, but I sometimes lose 50 packages in a row.

I'd like to know, if some of you know if thats an Android issue or my code implementation. Here the code:

    async Task GetCharacteristicsAsync(IService service)
        {
            Console.WriteLine($"Getting characteristics");
            try
            {
                controlCharacteristics = await service.GetCharacteristicAsync(Guid.Parse("***"));
                dataCharacteristics = await service.GetCharacteristicAsync(Guid.Parse("***"));

                dataCharacteristics.ValueUpdated += (o, args) =>
                {
                    ProcessData(args.Characteristic.Value);
                    CalculateData();
                };
            }
            catch (DeviceConnectionException e)
            {
                Console.WriteLine($"Exeption at GetCharacteristics: {e.Message}");
            }
        }
    private void ProcessData(Byte[] bytes) 
    {
    // Translate bytes into data types
    }

    private void CalculateData(Byte[] bytes) 
    {
    // Do Calculation
    }

Thank you for all the help in advance. :smile:

Navigate Problem (System.NullReferenceException Object reference not set to instance of an object)

$
0
0

As a result of an if evaluation, I want to open LoginPage. I really did a lot of search but I could not come to a conclusion. I need help.

*I am using Prism lib.
*MyTabbedPage is the mainpage.
*DownloadPage is child of MyTabbedPage but LoginPage is not.


Error:
System.NullReferenceException
Message=Object reference not set to an instance of an object.


[App.xaml.cs]
public partial class App : PrismApplication
{

    public static string AndroidExternalDirectory;
    public static string MyDateFormat { get; set; }

    public App(IPlatformInitializer initializer = null) : base(initializer)
    {
        InitializeComponent();
        MainPage = new MyTabbedPage();
        App.MyDateFormat = "dMMyyyy_hhmm";
    }

    protected override void RegisterTypes(IContainerRegistry containerRegistry)
    {
        containerRegistry.RegisterForNavigation<MyTabbedPage>();
        containerRegistry.RegisterForNavigation<DownloadPage>();
        containerRegistry.RegisterForNavigation<LoginPage>();
    }

    protected override void OnInitialized()
    {
    }
}

[DownloadPage.xaml.cs]
public partial class DownloadPage : ContentPage
{
public DownloadPage()
{
InitializeComponent();
BindingContext = new DownloadPageViewModel();
}
}


[DownloadPageViewModel.cs]

public class DownloadPageViewModel : BindableBase
{
    private string _title;
    public string Title
    {
        get
        {
            return _title;
        }

        set
        {
            SetProperty(ref _title, value);
        }
    }

    private readonly INavigationService _navigationService;
    private DelegateCommand _navigateCommand;
    public DelegateCommand NavigateCommand =>
        _navigateCommand ?? (_navigateCommand = new DelegateCommand(ExecuteNavigateCommand));
    public DownloadPageViewModel(INavigationService navigationService) 
    {
        Title = "DownloadPage";          
        _navigationService = navigationService;
    }
    async void ExecuteNavigateCommand()
    {
        await _navigationService.NavigateAsync("LoginPage");
    }

    public DownloadPageViewModel()
    {
        _parser = new HtmlParser();
        _webClient = new WebClient();
        Status = "Status: ";

        DownloadCommand = new DelegateCommand(async () =>
        {
            string extDir = App.AndroidExternalDirectory;
            string localFilesDir = Path.Combine(extDir, "InstagramPostFiles");

            if (!Directory.Exists(localFilesDir))
                Directory.CreateDirectory(localFilesDir);

            var doc = _parser.ParseDocument(_innerBody);
            var imgNodes = doc.QuerySelectorAll("img");
            var videoNodes = doc.QuerySelectorAll("video");

            await Task.Run(() =>
            {
                if (!_foundFileToDownload)
                {
                    Status = "Did not found any files in this link for downloading";

                    ExecuteNavigateCommand();
                }
            });

    }

Custom search-list using Linq freezes.

$
0
0

Hi everybody.

I'm building a search - function in Xamarin (see code below):
I'm filling a Listview with data ( public async void FillSearchList()).
When the user writes in the entry, the datalines,
which content corresponds to the search-text,
are shown in the listview (through private void SearchList_OnTextChanged(object sender, TextChangedEventArgs e)).
The user picks a data-line ((private void SearchList_OnTextChanged(object sender, TextChangedEventArgs e))),
and this is being shown in the entry.
The problem is as follows:
First time the user picks a data-line, there are no problems. However, when picking a dataline for the second time,
the program freezes, Visual Studio 2019 freezes, and after a while the message below (in the picture) appears.

I searched for the error for a long time, but sadly -> no luck. In VS 2019 I tried to "Empty symbol cache" and chose "Microsoft Symbol Servers"
under Debug->Options->Debugging->Symbols (picture 2 below). It did not help.

Does anybody have an idea, how to fix this?
Friendly regards
nbs

Xaml-design:

.cs - code -file:

`using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace test_multi.FrameWork.CustomControls
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class ListViewSearching : ContentView
{
ObservableCollection<KeyValuePair<string, string>> SearchDataList;
private DataManipulator dsg;
private AlertManager alert;
private string SqlFunction;
private string callMethod;
private string callObject;
public ListViewSearching()
{
InitializeComponent();
dsg = new DataManipulator();
}

    public ListViewSearching(String sqlFunction = "", string EntrySearchPlaceholder = "", string callingObject="", string callingMethod = "")
    {
        callMethod = callingMethod;
        callObject = callingObject;
        InitializeComponent();
         dsg = new DataManipulator();
        SqlFunction = sqlFunction;
        EntrySearch.Placeholder = EntrySearchPlaceholder;
        SearchDataList = new ObservableCollection<KeyValuePair<string, string>>();
        FillSearchList();
    }

    public async void FillSearchList()
    {
        try
        {
            SearchListValues poa = new SearchListValues();
            IDictionary<string, string> dict = new Dictionary<string, string>
            {
                { "COMPANY", Globals.Company }
            };
            var dataObjects = await dsg.GetDataAsync(SqlFunction, poa, dict, false);
            int count = 0;
            if (!dsg.IsNullOrEmpty(dataObjects))
            {
                // All sql-functions shall return 2 variables: ID and NAME
                foreach (SearchListValues searchVal in dataObjects)
                {
                    count++;
                    SearchDataList.Add(new KeyValuePair<string, string>(searchVal.ID, " " + searchVal.NAME));
                }
            }
        }
        catch (Exception ex)
        {
            alert = new AlertManager(Globals.ErrorOccured + Environment.NewLine + ex.Message.ToString(), Globals.AlertInfo);
        }
    }


    private void SearchList_OnTextChanged(object sender, TextChangedEventArgs e)
    {
        ListViewSearch.IsVisible = true;
        ListViewSearch.BeginRefresh();
        try
        {
            var dataSource = SearchDataList.Where(i => i.Key.ToLower().Contains(e.NewTextValue.ToLower()));
            if (string.IsNullOrWhiteSpace(e.NewTextValue))
                ListViewSearch.IsVisible = false;
            else if (dataSource.Any(s => string.IsNullOrEmpty(s.Key)))
                ListViewSearch.IsVisible = false;
            else
                ListViewSearch.ItemsSource = dataSource;
        }
        catch (Exception ex)
        {
            ListViewSearch.IsVisible = false;
        }
        ListViewSearch.EndRefresh();
        if (EntrySearch.Text.Trim().Equals(""))
            Globals._ValueChosen = "";
    }

    private void ListViewSearch_OnItemTapped(Object sender, ItemTappedEventArgs e)
    {       
        Globals.ChosenValues = (KeyValuePair<string, string>)e.Item;
        String listsd = Globals.ChosenValues.Key + " " + Globals.ChosenValues.Value;
        EntrySearch.Text = listsd;
        ListViewSearch.IsVisible = false;
        ((ListView)sender).SelectedItem = null;
    }

}

}`

Viewing all 89864 articles
Browse latest View live