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

Appropriate an iOS distribution - certificates, profiles, ...

$
0
0

Hi all,

Context:
I have the task of putting into production an application made by a tier, which will be called TA to update an application made historically by the company CB. TA has recoded the entire application, so it is more like the old, but I want to release the version under the guise of an update to not lose the thousands of users of the application. It remains the same application. My problem is that I can't take ownership of the signature entities and make Visual Studio detect signing certificates.

Actual config:
Certificate
Provisionning Profile
App ID
Archive Visual Studio

I have test with XCode, and XCode in Auto Sign add CB in the Signing Certificate, but, this certificate not exist today and it is not linked with this App ID.

Today I am completely helpless and I really have no idea how to do it. I spent 2 days, so I passed my dead line. If a charitable soul could yell me, I thanked him for it.

Thanks for your help.


Open Source Zebra RFID SDK for Xamarin Forms

$
0
0

Hello,

Zebra Technologies have SDKs for their RFID Scanners on platforms including native iOS, native Android and Xamarin.Android however not for Xamarin.iOS or Xamarin.Forms.

We are currently building a Xamarin.Forms app which critically requires the use of the RFID Scanner (RFD8500 model to be precise) on iOS. Our understanding is that this can be achieved by creating an iOS Binding Library for Zebra's existing Objective-C iOS SDK. I have personally attempted to bind this library through two methods, one being the classic iOS Binding method and two, creating a local C# Nuget Package for consumption. Due to lack of Objective-C experience, both attempts were unsuccessful.

What we would like to know is:

  • Is what we are trying to do even possible? (i.e would a binding library be enough to get the RFID scanners to work with a .forms app)
  • If so, what is the scale of effort?
  • As we lack the technical skills for it, would anybody be up for getting involved in this Open Source? (doing the actual work)

I think this would be a great project to do as over the last few months, I have found that a LOT of developers/companies have suffered from this same issue.

Thank you
Ridhwan

Using the Minimum Width for CollectionView

$
0
0

I have a CollectionView which I want to use the minimum necessary width. The containing Grid has the following ColumnDefinitions:
<Grid.ColumnDefinitions><ColumnDefinition Width="Auto"/><ColumnDefinition Width="*"/></Grid.ColumnDefinitions>
And the code for the CollectionView is as follows:

<d:CollectionView.ItemsSource>

1
2
3
4
5
6
7
8
9
10
11
12

</d:CollectionView.ItemsSource>
<CollectionView.ItemTemplate>

Firebase Analytics-Manual Screen Views are not getting tracked in correct order for Xamarin.iOS

$
0
0

Hello,
I am integrating firebase analytics in Xamarin.Forms project.Screen views are not getting tracked in correct order for iOS project.I am using below line of code in respective file's on appearing method-

LoginPage.xaml- Analytics.SetScreenNameAndClass("LoginScreen", null);
Dashboard.xaml- Analytics.SetScreenNameAndClass("DashboardScreen", null);
Employee.xaml- Analytics.SetScreenNameAndClass("ViewEmployeeScreen", null);

The above line of code is written in xamarin ios project and I am using dependency service to call it from PCL of xamarin forms.
For eg user flow is Login->Dashboard->ViewEmployee
In DebugView
Expected scenario shoud be : LoginScreen-> DashboardScreen(screen_view1) & DashboardScreen-> ViewEmployeeScreen(screen_view2)

Result I am getting: LoginScreen-> DashboardScreen(screen_view1), DashboardScreen->LoginScreen(screen_view2),LoginScreen->EmployeeScreen(screen_view3) . (Which is incorrect It should not go to login screen again)

Packages installed:
Xamarin.Firebase.iOS.Analytics(6.0.4)
Xamarin.Firebase.iOS.Core(6.1.0)
Xamarin.Firebase.iOS.Crashlytics(3.14.0)
Xamarin.Firebase.iOS.InstanceID(3.4.0)
Can anyone please let me know where I am going wrong?

Thanks in advance!

Picker when placed inside Listview is not working properly.

$
0
0

Xamarin.Forms: I have used a ListView and created a DataTemplate as custom ViewCell with Grid inside the same.
In my Grid I have created 3 Columns with picker inside first column and Entry as second and third column.
Whenever I click upon entry cell or TextChanged event is triggered, Picker in other column is also focused and picker item selection pop up is displayed.

TitleView for ContentView

$
0
0

Hi,

How can assign NavigationPage.TitleView to a ContentView?

Thanks,
Jassim

Force Change of android:textColor at runtime

$
0
0

I have the a TabbedPage Application and want to change the textcolor at runtime.

<Label Text="Color change works for this label, as i set textcolor" TextColor="{DynamicResource MyTextColor}"/>
<Label Text="but i want to have it work for all labels and other elements without DynamicResource=MyTextColor"/>

public partial class TabPage : ContentPage
protected override void OnAppearing()
{
    // this works
    Resources["MyTextColor"] = DarkTheme ? Color.Red : Color.Blue;

    // this does not work at runtime, textcolor defined in styles <item name="android:textColor">#43d5e6</item> does not update at runtime
    SetTheme(DarkTheme ? Resource.Style.MainTheme_Dark: Resource.Style.MainTheme_Light);
}

item name="android:textColor> is differently defined in MainTheme_Dark and MainTheme_Light and gets at once applied to new Pages (for example Navigation.PushModalAsync(new NavigationPage(new NewPage())), but it gets not applied to existing TabPage. I have to close my app and only afterwards, it correctly applies the new "item name=android:textColor> from the selected MainTheme.

How can I force to change android:textColor at runtime in the OnAppearing()-event?

Adding Privacy statement in Sign in process in Azure AD

$
0
0

Hi,

I am using Azure AD sign process to my Mobile application, Here I added privacy policy link to user to accept before they go through the app.
When I click on the Privacy statement link and click back on Android device expectation is to go back to Consent screen, but right now whats happening is the sign in process is cancelling,


Error: System.AggregateException: 'One or more errors occurred. (Cannot create a table without colum

$
0
0

I am trying to use a local SQLite database in my Xamarin application

When loading the ListView page that I'm testing it on I always get the error: System.AggregateException: 'One or more errors occurred. (Cannot create a table without columns )'

Here is the applicable code:

PieceDatabase.cs

namespace TestApp1
{
  public class PieceDatabase
  {
    readonly SQLiteAsyncConnection _database;

    public PieceDatabase(string dbPath)
    {
        _database = new SQLiteAsyncConnection(dbPath);
        _database.CreateTableAsync<Piece>().Wait();
    }

    public Task<List<Piece>> GetPieceAsync()
    {
        return _database.Table<Piece>().ToListAsync();
    }

    public Task<int> SavePieceAsync(Piece temp)
    {
        return _database.InsertAsync(temp);
    }
}

}
App.xaml.cs

namespace TestApp1
{
public partial class App : Application
{

    static PieceDatabase database;

    public static PieceDatabase PieceDatabase
    {
        get
        {
            if (database == null)
            {
                database = new PieceDatabase(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "pieces.db3"));
            }
            return database;
        }
    }

    public App()
    {
        InitializeComponent();
        MainPage = new NavigationPage(new Page1());
    }

}
DatabaseTest.xaml.cs

namespace TestApp1
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class DatabaseTest : ContentPage
{

    protected override async void OnAppearing()
    {
        base.OnAppearing();

        /** The error does not occur if I add a piece here, but I'm trying to figure out why that is
        await App.PieceDatabase.SavePieceAsync(new Piece
        {
            Catagory = "Beams",
            PartNum = 1,
            Url = "whatever.com"
        }); */

        List<Piece> test = await App.PieceDatabase.GetPieceAsync();
        listView.ItemsSource = test;
    }

    public DatabaseTest()
    {
        InitializeComponent();

    }

    async void Handle_ItemTapped(object sender, ItemTappedEventArgs e)
    {
        if (e.Item == null)
            return;

        await DisplayAlert("Item Tapped", "An item was tapped.", "OK");

        //Deselect Item
        ((ListView)sender).SelectedItem = null;
    }
}

}

WebView Inside a ScrollView not working

$
0
0

Hi,

I have a simple WebView inside a ScrollView but the problem it's not scrolling anything.

here is my code:

<ScrollView Grid.Row="0">
    <Grid Grid.Row="0" RowSpacing="0">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <SyncfusionRotator:SfRotator x:Name="RotatorAdDetails" Grid.Row="0" EnableLooping="False" EnableAutoPlay="False" NavigationDelay="4000" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
            <SyncfusionRotator:SfRotator.HeightRequest>
                <OnIdiom x:TypeArguments="x:Double" Phone="300" Tablet="400" />
            </SyncfusionRotator:SfRotator.HeightRequest>
            <SyncfusionRotator:SfRotator.ItemTemplate>
                <DataTemplate>
                    <StackLayout ClassId="{Binding user_guid}">
                        <FFImageLoading:CachedImage Source="{Binding media_file}" ClassId="{Binding ad_guid}" LoadingPlaceholder="AdPlaceholder.png" FadeAnimationEnabled="True" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Aspect="AspectFill" DownsampleToViewSize="true">
                        </FFImageLoading:CachedImage>
                    </StackLayout>
                </DataTemplate>
            </SyncfusionRotator:SfRotator.ItemTemplate>
        </SyncfusionRotator:SfRotator>

        <WebView x:Name="WebViewAdDetailsDescription" Grid.Row="1" Margin="5" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" />
    </Grid>
</ScrollView>

How can I fix that please?

Thanks,
Jassim

How to notify or call viewmodel 's method from customview 's bindable property

$
0
0

Hi All, I need to call viewmodel method from customview whenever bindable property changed.

public class CustomPieChart : SupportPieChartExtended
{
    public static readonly BindableProperty SelectedValueProperty = BindableProperty.Create(nameof(SelectedValue), typeof(string), typeof(CustomPieChart), null);
    public string SelectedValue
    {
        get { return (string)GetValue(SelectedValueProperty); }
        set { SetValue(SelectedValueProperty, value);

        }
    }
}

I am setting this value from customrenderer of CustomPiechart which I am able to but I need to call a method of viewmodel .

public class PaySlipPageViewModel : BaseViewModel
{
     public string SelectedValuesSet
     {
        get => selectedValuesSet;
        set {
            SetProperty(ref selectedValuesSet, value); 
        Hello();}
     }

public void Hello(){
{
    Console.WriteLine("Hello");
}
}

In the UI

 <customControls:CustomPieChart x:Name="pieCharts"
                                         SelectedValue="{Binding SelectedValuesSet, Mode=TwoWay}"
                                             HeightRequest="350"
                                               WidthRequest="350"
                                              DrawCenterText="True"
                                              HorizontalOptions="FillAndExpand"
                                               VerticalOptions="FillAndExpand">

I need to reflect SelectedValuesSet from CustomPieChart Class whenever SelectedValue changed.

Please help

Can I have more than one ResourceDictionary?

$
0
0

I have now one ResourceDictionary with all my styles for buttons, frames, labels.. etc.
but I want to have now two or more then I would choose one of then to use.

CarouselPage: How to move to other page clicking on a button in the nav bar?

$
0
0

this is my CarouselPage:

My first page

If I slide "Right to left"

Goes to my second page

I want to move from the first page to the second in the same way as now but also clicking on that button (shopping cart) and if I click it send me to the other. That's possible?

Create spinner picker UI in xamarin forms

$
0
0

Is there any way to create this kind of UI (Like spinner) ?
Any idea would be appreciated.
Thanks.

Xamarin.Forms Events vs UWP Events

$
0
0

I am a UWP developer and am attempting to convert my apps to Xamarin.Forms for use by Android. I supposedly found enough of the XAML controls to make the UI, but the events are much more challenging. Is there anywhere that I can find a list with a comparison of UWP events & their suggested replacements in Xamarin.Forms? Some of the events that I have been told require the most rewriting for are the lifecycle (such as Page.Loaded). Are there pages anywhere with guidelines on portability for events? Thanks.


Scanning Multiple info in Single QR code and display the data in different fields

$
0
0

Hi,

Currently I am working on QR code scanner, I want the single QR code which contains multiple data (number, text, url) and display the data in different fields,

Shell close animation stuttering on Android

$
0
0

Hi,

today I experimented a bit with the "new" (not that new anymore) shell component in order to set up a simple hamburger menu.
I'm facing the same issue as with the MasterDetailPage in the past, were the animation of closing the menu is stuck for a second before actually closing.
For the Masterdetail it was solved by adding a delay (which was bad already) but I can't find a way to solve it for shell.

Does anyone know how to improve the closing animation? Right now it is unusable.

Here is my xaml setup:

<?xml version="1.0" encoding="UTF-8"?>
<Shell BackgroundColor="#D4503B"  xmlns="http://xamarin.com/schemas/2014/forms" xmlns:page="clr-namespace:MyApp.ContentPages" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="MyApp.AppShell">
    <FlyoutItem Title="Dashboard" >
            <Tab>
                <ShellContent ContentTemplate="{DataTemplate page:Page1}"/>
            </Tab>
    </FlyoutItem>
    <FlyoutItem Title="Train ticket request">
            <Tab>
                <ShellContent ContentTemplate="{DataTemplate page:Page2}" />
            </Tab>
    </FlyoutItem>
    <FlyoutItem Title="Parking spot reservation">
            <Tab>
                <ShellContent ContentTemplate="{DataTemplate page:Page3}" />
            </Tab>
    </FlyoutItem>
</Shell>

Page 1 is almost empty, just two buttons without any styling are shown there but the same problem. Page2 and 3 are a bit more complex but still not overwhelmingly crazy.

One of my ideas was to manually tell when to open and close and navigate but I didn't find a way how to implement it (For example, how to get the menu icon click event?)
Any ideas?

I'm using Xamarin.Forms 4.3.0.947036

References confirming the bug (One is marked as solved but clearly isn't):
https://github.com/xamarin/Xamarin.Forms/issues/7521
https://github.com/xamarin/Xamarin.Forms/issues/5216

References to fix MasterDetail in the past:
https://github.com/xamarin/Xamarin.Forms/issues/4398
https://stackoverflow.com/questions/48115810/how-can-i-make-the-masterdetailpage-faster-on-android

how do i make xamarin forms connect to a node js server on firebase hosting

$
0
0

im making a cross platform ios and android app and have a node js backend with firebase hosting and saving information to firebase database. how do i connect the xamarin forms front end to the node js backend and make them communicate. i can save info from the clientside but its not secure and i can save info in node js but i need to take strings from clientside such as username and email. how do i do this securly such as using crypto?

Creating a FontFamily for Xamarin.Forms & Android

$
0
0

I am trying to add a custom font (or actually fonts) to my Xamarin.Forms app. In my case, it is the Arial font. I have the *.ttf files for the regular, bold, italic, and bold italic variations, and want to create a font family for them as described at:
https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/resources-in-android/fonts
I have placed the files in the Assets folder of my Android project, and I am able to use them individually using the syntax such as FontFamily="arial.ttf#Arial". However, I am somewhat confused as to exactly how to create & use the *.xml file that includes the variations. The sample xml file does not have the font names or files anywhere in it, and I am not sure how to use the xml file after creating it. Can somebody help me? Thanks.

How to get audio file locations?

$
0
0

I am trying to get locations of audio files in Xamarin.Forms. I am currently using resources to play audio file, I put there myself, but want to search the phone for these files and save in a List with its locations?

Viewing all 91519 articles
Browse latest View live


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