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

How do to REST API with xmarin.forms

$
0
0

Hi there

I have used RestSharp and wrapped an api into a nice NET Standard library
the library takes username, password and platform as arguments and then api outputs api key which library uses internally it also had data models in it

now it works fine, but I don't know how to integrate it into Xmarin.Forms, where to initiate it to be able to acsess its methods and its data from every xmarin.forms subpage (I am using a AppShell)

if we start with Shell Template that visual studio 2019 provides

should I initiate my API in AppShell.xaml.cs or in App.xaml.cs
but then if I do that in there how would I acsess it in for instance AboutPage View Model (I can make it static but this doesn't seem right and it wierd you have to call AppShell.myApi everytime you want to use an api)?

How would I access it in Xmarin.Android portion (I could use MessageCenter(but I can only call void methods with this I cannot(or don't know how) return data) or I could create some static classes in Xmarin.Forms portion, but I don't know if it is the right approach)

what is the best way to handle exeptions (for now my library only throws Exeption with message: throw new Exception("Message Here"))
API has errors like this:

200 - Request successful. More information is returned in json object. Object schema depends on method.
201 - Request successful. No result returned.
400 - Error occurred. Additional information provided in json response (ErrorResponse format: more info below)
401 - Authentication failure. There are two possible reasons: disabled API access or invalid ApiKey provided
403 - Access forbidden
404 - Invalid method URL
405 - HTTP method not allowed, please verify HTTP method of the request
429 - Too many requests in a given amount of time. API limits are 20 requests/second, 1500 requests/hour, 10000 requests/day
5xx - Something wrong happened in Calamari backend. Please wait a while and repeat your request. If error still occurs, drop us a line.

If status 4xx is returned, you can read additional information from returned json object.
{
"message": string,
"code": string,
"field": string
}

message - Human readable error explanation.
code - Error code. Possible value depends on method but there is few common error codes.
field - Which field of payload object caused error. NULL when error is not related to particular field

What is the best aproach to throw appropriate exeption for this, at the end I would like to show an alert to the user if exeption accures, so my library would trow 500Exeption for instance and user would get an error

how would I do this globally, so I don't need to wrap every button in try/catch block

All theese are more of a design questions that bother me and I don't know where to find anwsers to them, as I never saw an example with Xmarin.Forms and REST api that takes username/password api then sends api key which app uses in all subsequent API requests

Hopefully someone can give me some advice on all this, (particulary how to handle exeption and inform the user and where in the project to construct the api so I can easly acsess it from all subpages)

Thannks for Anwsering and Best Regards


Integrating login page in Master Detail Page Xmarin.Forms example

$
0
0

Hi there
I created Master-Detail example app when creating new Xmarin.Forms project

but then I wanted to integrate this login screen: mallibone.com/post/creating-a-login-screen-with-xamarinforms

Now He is using A simple Navigation Service for Xamarin.Forms: mallibone.com/post/a-simple-navigation-service-for-xamarinforms
to show login page and navigate

now the problem is I cannot seem to integrate this into my app

now in the xmarin.forms master-detail page example, main page(app.xaml.cs) it started like this: MainPage = new MainPage();

but the SimpleNavigationService requires the page to be started like this:

_navigationService.Configure(PageNames.LoginPage, typeof(Views.LoginPage));
_navigationService.Configure(PageNames.MainPage, typeof(Views.MainPage));
MainPage = _navigationService.SetRootPage(nameof(Views.MainPage));

if I do that then Hambuger menu navigation doesn't work (I get System.NullReferenceException: 'Object reference not set to an instance of an object.', but it doesn't show where) any more and app looks weird (cannot post picture, but there are 2 hambuerger menu icons it looks like MainPage in MainPage)

Hopefully someone can tell me how I can use A simple Navigation Service for Xamarin.Forms with Master-Detail page (cuz it looks like a neat library)

Thanks for Anwsering and Best Regards

Usage of ImageSource.FromFile for Android Assets

$
0
0

Hi,

I just updated Xamarin.Forms, so I'm using the current (Xamarin.Forms.1.0.6197).

I have the following code:

public string BuildFlagPath(string flagName) {
    return String.Format("{0}{1}.png", Device.OnPlatform("Flags/", "Flags/", "Assets/Flags/"), flagName);
}

// For the image source
Source = ImageSource.FromFile(BuildFlagPath(_currency));

This is working well for iOS and Windows Phone, but I can't get it working for Android.

Just for the complete picture:

  • Assets are a bunch of png files
  • Windows Phone

    • Assets are in "/Assets/Flags/" folder
    • Build action: Content
    • Copy to output directory: always
  • iOS

    • Assets are in "/Resources/Flags/" folder
    • Build action: BundleResource
    • Copy to output directory: Do not copy
  • Android

    • Assets are in "/Assets/Flags/" folder
    • Build action: AndroidAsset
    • Copy to output directory: Do not copy

What am I missing here to get it working?

responsive control

$
0
0

hi

2 item in mobile
tablet 3 or 4

how responsive control in page :/

search inside picker xamarin forms (Custom Renderer)

$
0
0

i need filter picker any idea ?

i try Xfx.Controls negut but not workin for me

PushModal doesn't seem to be working as it used to iOS

$
0
0

I have been using Navigation.PushModalAsync for sometime, however recently i have noticed a change where the user can swipe down to dismiss the page - which is not the behaviour i need for the flow I am implementing.

Not sure if this is a change in iOS or Xamarin Forms but how can i get the previous behaviour back (i.e. user cannot dismiss the page by swiping away)?

I've seen this behaviour on iPhone 8 & iPhone 11 iOS 13.3 simulator.

Visual Studio Community 2019 for Mac
Version 8.3.11 (build 1)
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 5.16.1.24 (d16-3 / 08809f5b)
Xamarin.iOS
Version: 13.6.0.12 (Visual Studio Community)

Support to convert the HTML to PDF in Xamarin Forms

$
0
0

Support to convert the HTML to PDF in Xamarin Forms

open street map tile display method

$
0
0

I am a Xamarin beginner

I want to display an open street map as a tile, but it doesn't work

In the source below, only one image is displayed

Please tell me how to display tiles


[Obsolete]
private async void  Pic()
{

    for (int i = 1; i <= 10; i++)
    {
        string url = "";

        url = "http://c.tile.openstreetmap.org/" + 18 + "/" + (233891 + i) + "/" + 100481 + ".png"

        try
        {
            using (Stream stream = await httpClient.GetStreamAsync(url))
            using (MemoryStream memStream = new MemoryStream())
            {
                await stream.CopyToAsync(memStream);
                memStream.Seek(0, SeekOrigin.Begin);
                helloBitmap = SKBitmap.Decode(memStream);
            }

            using (SKCanvas bitmapCanvas = new SKCanvas(helloBitmap))
            {
                bitmapCanvas.DrawBitmap(helloBitmap,i * 256,0,null);
            }
        }
        catch
        {
        }
    }

    SKCanvasView canvasView = new SKCanvasView();
    canvasView.PaintSurface += OnCanvasViewPaintSurface;
    Content = canvasView;

}

[Obsolete]
private void OnCanvasViewPaintSurface(object sender, SKPaintSurfaceEventArgs args)
{

    SKImageInfo info = args.Info;
    SKSurface surface = args.Surface;
    SKCanvas canvas = surface.Canvas;

    using (surface = SKSurface.Create(width: 1000, height: 1000, SKImageInfo.PlatformColorType, SKAlphaType.Premul))
    {
        canvas.DrawBitmap(helloBitmap, 256, 256, null);

    }           
}


Why ImageSource.FromFile() doesn't work on UWP ?

$
0
0
    public static readonly BindableProperty ImageProperty =
        BindableProperty.Create(propertyName: nameof(Image),
                                returnType: typeof(string),
                                declaringType: typeof(ProductWithDetailsCustomControl),
                                defaultValue: default(string),
                                defaultBindingMode: BindingMode.TwoWay,
                                propertyChanged: (bindable, oldValue, newValue) =>
                                {
                                    if (bindable is ProductWithDetailsCustomControl x &&
                                       newValue is string stringValue)
                                    {
                                        x.ItemImage.Source = ImageSource.FromFile(stringValue);
                                    }
                                });

    public string Image
    {
        get { return (string)GetValue(ImageProperty); }
        set { SetValue(ImageProperty, value); }
    }

The stringValue is = C:\Users\salar\Desktop\New folder\MilkTea.png and its exist

This is my custom property to bind the image source to my ItemImage, and I want to fetch the image from a certain path to set as an image source using ImageSource.FromFile();

I'm using UWP platform and my idea is to save all the images in a certain folder and fetch it. Is there any way how to set the image from the file to ImageSource? or I have missing steps to reach my goal.?

TabbedPage with Bottombar

$
0
0

Hello,

is it possible to make a Bottombar on a TabbedPage tag instead on each Contentpage?

I have different Contentpages, the amount varies depending on the Task which coming in.
Problem the Bottombar has Bindings with Actions which will be split if I add on each individual ContentPage.

Custom Picker not initializing

$
0
0

Hello, everyone!

I need some help. I have spent all day trying to make a "simple" custom control, just a Picker with a down arrow button. I could put a normal picker and a button on a StackLayout, and add to the onClick button event a simple myPicker.Focus()... but I want to do things right, and also learning a bit more on how to do custom controls, bindable properties, etc.

I attached the code of my control, just a view and its code behind. I'm still working on it, fixing errors as long as I change all Pickers from my project with this one.
Right now, the problem I have is that I have the "ArrowPicker" in my page like this:

<customControls:ArrowPickerView x:Name="pkr_Marca" HorizontalOptions="FillAndExpand" ToolsBackgroundColor="{x:Static statics:Palette._MainColor}" TextColor="{x:Static statics:Palette._MainColorDark}" ItemsSource="{Binding MarcasList}" ItemDisplayBinding="{Binding Name}" SelectedIndex="{Binding MarcaSelected, Mode=TwoWay}" IsEnabled="{Binding IsNewOrder}" ArrowIconColor="Dark"/>

And I have this method to initialize values in ViewModel:

```async Task ExecuteLoadMarcasListCommand(string _cardCode = null)
{
int pos;

        IsBusy = true;
        LoadMarcasListCommand.ChangeCanExecute();

        //Getting Marcas List
        tempList = await WebApiMarcasData.GetMarcasList();

        if (tempList != null)
        {

            //tempList.Add(new BaseModel() { Id = "222", Name = "Test2" });
            //tempList.Add(new BaseModel() { Id = "333", Name = "Test3" });
            //tempList.Add(new BaseModel() { Id = "444", Name = "Test4" });
            MarcasList = new ObservableCollection<BaseModel>(tempList); //if tempList is null, it creates an exception
            if  (!string.IsNullOrWhiteSpace(Order.marcaId))
            {
                pos = MarcasList.IndexOf(MarcasList.FirstOrDefault(x => x.Id == Order.marcaId));
                if (pos >= 0)
                    MarcaSelected = pos;
                else
                    MarcaSelected = 0;
            }
            else
                MarcaSelected = 0;

        }
        else
            if (MarcasList != null)
            MarcasList.Clear();

        IsBusy = false;
        LoadMarcasListCommand.ChangeCanExecute();
    }```

Well, I have a list from my WebApi with one element, so when I execute the IndexOf function, there is a match with the first element of the list, and pos is equal to 0. But when MarcaSelected is assigned with a zero, nothing happens. The inner Picker don't raise an event, it don't show the "Name" field of the first value, nothing, is blank.
However, I can tap it, select the element of the list, and then it shows, but for some reason, is not initialized by code. And using just a Picker is working fine.

I traced the code, and it sets MarcaSelected from -1 to 0 in the page initialization, then load the list with this code, but it does nothing when "MarcaSelected = pos". Maybe because is the same value?

I'm sure you'll find more errors in my code (I wasn't able to make ItemDisplayBindingProperty work properly, it only shown the Model class name on the list, instead the field I wanted... I mean "Models.BaseModel" instead "Nuka Cola", or to overwrite IsEnabled), and I will appreciate any suggestions to fix it, but right now, I need to fix that initialization problem to keep working.

If you need more info, just ask. Thank you.

Files required for app gets deleted from LocalStorage on popping a navigation page

$
0
0

Hi,

I am working on an app which uses "WKWebview"(ios customrenderer) to play embedded YouTube videos.
It has two navigation pages Page-1 and Page-2.
Page-1 is root page.

Page-1 contains : Wkwebview (To show advertisement video and this link always remains same) and ListView-1 (category links)
Page-2 contains : Wkwebview (To show videos) and ListView-2 (Actual video links)

It work like:

  1. I am using Same WkWebview CustomRendere for both Pages.

  2. Working on Simulator with ios version 12.0

  3. When i visit page-1 it loads advertisement video and populate category links in ListView-1 . (Here it automatically stores https_www.youtube.com_0.localstorage, https_www.youtube.com_0.localstorage-wal and https_www.youtube.com_0.localstorage-shm) in local storage.

  4. On clicking any item in ListView-1 it uses Navigation.PushAsync() to load Page-2 and shows corresponding Video links in ListView-2 and a video in Wkwebview corresponding to first video in ListView-2. And then we can choose any video and it displays quit well. (Here no we files are created in local storage, as they use existing files).

Problem:

  1. On clicking the Back button of Page-2 following Message appears three times. (For https_www.youtube.com_0.localstorage, https_www.youtube.com_0.localstorage-wal and https_www.youtube.com_0.localstorage-shm)

[logging] BUG IN CLIENT OF libsqlite3.dylib: database integrity compromised by API violation: vnode unlinked while in use: /Users/ZZZ/Library/Developer/CoreSimulator/Devices/5BA-702-44C-9B-4465FA982/data/Containers/Data/Application/A1F-B71-1FA-A-D43BA9C/Library/WebKit/com.companyname.ZZZ/WebsiteData/LocalStorage/https_www.youtube.com_0.localstorage

When i looked in LocalStorage the files were actually deleted.

This happens only once when we navigate from Page-1 to page-2 and back for first time, if we perform the same repeatedly no message appears (even though files are still getting deleted.)

What Should i do?

Managing dependencies of a external SDK

$
0
0

Hi!

I've started a process of building a java binding on top of a SDK provided for us by one of our partners. I'm struggling a bit but little by little I'm managing to make progress. However, the point of this post is not the java binding, but one curious fact that made me wonder about managing dependencies of a SDK, be it one provided for us or one that we have to build ourselves.

The curious fact is: I'm having to import some dependencies that are specific for Android on the front-end application that is consuming the SDK. Why is this happening? For example, in order to run a method from the SDK, the compiler (Visual Studio) asks me to import GoogleGson, Kotlin, Koin, etc. Which are dependencies specific for Android. Shouldn't the SDK wrap them within itself without forcing the application to import them as well? If that situation is to be expected, why does that happen?

I'm pretty sure this is something more in line with the concept of managing dependencies than Java Bindings specifically, which is why I'm posting here. Any light on this subject would be really appreciated.

Set accessibility focus after button click

$
0
0

Hi all,

I am trying to figure out how one would get the accessibility cursor to change focus to an element after a button click. For example when I press a button in my app that is hiding content I want to focus on those new elements that have recently become visible after a button click. Im aware of tab index in XF 4.0, but my understanding of TabIndex is that it only sets the order in which the focus is supposed to follow. I want to set the accessibility cursor on an element that has just been made visible to the user, and then set the order on those new elements. Is anyone aware of how I could accomplish this?

Thanks!

Issue: InstallFailedException

$
0
0

I am currently having an issue with running my Xamarin.Forms app on my mobile device whether it be emulated or my physical test device.
I am on Visual Studio 2019 and it is a new app project and I have had it running before but usually after the first run it does not work again after that if it did.
The error code is as follows:

ADB0010: Mono.AndroidTools.InstallFailedException: Failure [INSTALL_FAILED_INVALID_APK: Package couldn't be installed in /data/app/com.companyname.appname-w4jR_g7Ki-eDsfg24hSJUA==: Package /data/app/com.companyname.appname-w4jR_g7Ki-eDsfg24hSJUA==/base.apk code is missing]
   at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) in E:\A\_work\254\s\External\androidtools\Mono.AndroidTools\Internal\AdbOutputParsing.cs:line 341
   at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass95_0.<InstallPackage>b__0(Task`1 t) in E:\A\_work\254\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:line 753
   at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at AndroidDeviceExtensions.<PushAndInstallPackage>d__11.MoveNext() in E:\A\_work\254\s\External\androidtools\Xamarin.AndroidTools\Devices\AndroidDeviceExtensions.cs:line 187
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at AndroidDeviceExtensions.<PushAndInstallPackage>d__11.MoveNext() in E:\A\_work\254\s\External\androidtools\Xamarin.AndroidTools\Devices\AndroidDeviceExtensions.cs:line 203
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Xamarin.AndroidTools.AndroidDeploySession.<InstallPackage>d__112.MoveNext() in E:\A\_work\254\s\External\androidtools\Xamarin.AndroidTools\Sessions\AndroidDeploySession.cs:line 414
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Xamarin.AndroidTools.AndroidDeploySession.<RunAsync>d__106.MoveNext() in E:\A\_work\254\s\External\androidtools\Xamarin.AndroidTools\Sessions\AndroidDeploySession.cs:line 217
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.AndroidTools.AndroidDeploySession.<RunLoggedAsync>d__104.MoveNext() in E:\A\_work\254\s\External\androidtools\Xamarin.AndroidTools\Sessions\AndroidDeploySession.cs:line 119

I have tried many things including:
Repairing the SDK
Uninstalling Visual Studio, Android Studio, Android SDK and then re-installing them


Version bumping for for DevOps builds

$
0
0

I used to use a script to
1. Check out appmanifest.xml / info.plist
2. Add +1 to the versioncode
3. Check the file back in again

Now we moved to Azure devops and I'm redoing some of the build-strategies. One thing I came across was James Montemagnos Mobile App Tasks.

From what I can tell, this tasks does not use the old version+1. Instead it uses $Build.BuildId from Azure DevOps (at least as it's example). Nor does it check out/in anything.

Just want to check with the rest of you. What strategy do you use? Checking in the new VersionCode or not?

Getting a white screen while navigating.

$
0
0

Hi.

I am building a Xamarin.Forms app using PRISM and I am getting the weirdest behavior.
I am pretty sure that it started right after I updated PRISM when the made their IInitialize breaking change.

Here is the flow of my app.
The first screen is the Login page and I am navigating to it in my OnInitialized method in App.xaml.cs

await NavigationService.NavigateAsync("NavigationPage/MainPage");

Once the user is logged in I am using the following line to navigate to the "home" page:

await NavigationService.NavigateAsync("/MainMasterPage/NavigationPage/PlayersHomePage");

This is where I get the white screen for a second and then the tabbed page loads up OK.
I notices that if I remove the Navigation page the white screen does not show up, but I cant do without it.

the PlayersHomePage is a TabbedPage with 3 tabs:

<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
            xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
            xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms"
            xmlns:views="clr-namespace:FplMatchdayLive.Views"
            prism:ViewModelLocator.AutowireViewModel="True"
            Title="{Binding Title}"
            x:Class="xxx.Views.PlayersHomePage">
    <TabbedPage.Children>
        <views:TeamPage></views:TeamPage>
        <views:LeaguesPage></views:LeaguesPage>
        <views:FixturesPage></views:FixturesPage>
    </TabbedPage.Children>
</TabbedPage>

in the PlayersHomePage code behinde I am using IInitalize to initialize all the tabs:

public partial class PlayersHomePage : TabbedPage, IInitialize
{
    public PlayersHomePage()
    {
        InitializeComponent();
    }
    public void Initialize(INavigationParameters parameters)
    {
        if (parameters.GetNavigationMode() == NavigationMode.New)
        {
            // Prism always raises OnNavigatedTo on 1st tabbed page so this prevents the first tab being initialised twice
            if (Children.Count == 1)
            {
                return;
            }
            for (var pageIndex = 1; pageIndex < Children.Count; pageIndex++)
            {
                var page = Children[pageIndex];
                (page?.BindingContext as INavigationAware)?.OnNavigatedTo(parameters);
            }
        }
    }
}

I tried removing all the tabs from the TabbedPage thinking its the initialization that is causing this but it did not help.

Any ideas as to how to solve it?

How to deal with this binding is ListView ?

$
0
0

Hi all,

My main page is a ListView of some available scores. I am making a favorites system, but I can't do it easily... For now, I have an ObservableCollection, and Score is defined by 4 properties : PageName, DisplayName, Detail, and IsFavorite.

I have a FavoritesManager to manage favorites list (singleton access for multiple pages, and extraction of favorites list from user preferences at startup). My actual system is : when Favorites list changes, it raises OnCollectionChanged event ==> my entire ObservableCollection is rebuilt, just to make one change, the new favorite...

I have this:

public class Score
{
    public string PageName { get; set; }
    public string DisplayName { get; set; }
    public string Detail { get; set; }
    public bool IsFavorite { get; set; }

    public Score(string pageName, string displayName, string detail, bool? isFavorite = null)
    {
        // Do the job
    }
}

public class Category : List<Score>
{
    public string Name { get; set; }
    public Category(string name) { Name = name; }
}


// My ViewModel
public class ScoreListViewModel : ViewModelBase
{
    private ObservableCollection<Category> _categories;
    public ObservableCollection<Category> Categories
    {
        get => _categories;
        set => _categories = SetFieldValueAndNotify(value); // Home-made method to raise event PropertyChanged
    }

    // Access FavoritesManager via Singleton instance
    public FavoritesManager Favorites { get => FavoritesManager.Instance; }

    public ScoreListViewModel()
    {
        this.InitializeCategories();
        this.Favorites.FavoritesList.CollectionChanged += OnFavoritesChanged;
    }

    // Reload Categories when favorites have been updated
    public void OnFavoritesChanged(object sender, NotifyCollectionChangedEventArgs e)
    {
        this.InitializeCategories();
    }

    // Declare / initialize list of categories and scores
    public void InitializeCategories()
    {
        this.Categories = new ObservableCollection<Category>
        {
            new Category ("Foo")
            {
                // Note that I use an indexer here for FavoritesManager, but I can also do it with Favorites.List.Contains();
                new Score("Bar", "Bar_DisplayName", "Bar_Detail", this.Favorites["Bar"])
            }
        };
    }
}

And my XAML:

<ListView
    ItemsSource="{Binding Categories}"
    GroupDisplayBinding="{Binding Name}"
    IsGroupingEnabled="True">

    <ListView.ItemTemplate>
        <DataTemplate>
            <ViewCell>
                <StackLayout Orientation="Horizontal">
                    <StackLayout Orientation="Vertical">
                        <Label Text="{Binding DisplayName}" />
                        <Label Text="{Binding Detail}" />
                    </StackLayout>
                    <Button Text="{Binding IsFavorite}"
                            Command="{Binding Source={x:Reference ThisPage}, Path=BindingContext.ToogleFavorites}" CommandParameter="{Binding PageName}" />
                </StackLayout>
            </ViewCell>
        </DataTemplate>
    </ListView.ItemTemplate>

</ListView>

My problem is : how can I make a Binging (or anything else ?) to avoid reloading the entire ListView each time I push on a button ?

Note that ideally, I want to keep Score and Category classes "Xamarin-free". So I did not test it with Score.IsFavorite as a bindable property...

Thanks for helping,
Galactose

Create Dropdown Button on Right Navbar

$
0
0

Hey guys, it's my first time asking in this forum so forgive me for my bad english and many more. I'm new in this Xamarin.Forms (android native java before), i want to create a Dropdown Button at right of my Navigation Bar but after few days research and googling i've no clue how to make it. Someone on this forum has make it? Can you please show me how to make it? Thanks before guys :)

What i want:

Share asp.net session between different webviews on iOS

$
0
0

Hello,

We built an application based on hierarchical navigation.
Each time we load a new page we have a webview in it loading an asp.net website.

On android, no problem, asp.net session is shared between all our page.

On iOS, the asp.net session is not shared. We have a different session each time we load a page in the application.
Of course, if we navigate into the same webview, the session is good.

Do you have any idea how we can share asp.net session between 2 different webview instances on iOS?
Why is it working fine on Android but not on iOS ? Where is the difference on the rendered webview ?

Thank you for your help,
Sincerely

Viewing all 77050 articles
Browse latest View live


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