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

Bind List View from Bottom to Top

$
0
0

HI all,
I want to BInd data to my List view from Bottom to Top, Is there any Custom Renderer to do it? or any way?
please give me suggestions.

Thanks


Debugging Session issues.

$
0
0

A number of versions ago I started noticing odd debugging to device behaviours, I'm wonder if someone here can shed light on my situation. I'm debugging my Xam Forms PCL project to a Sony Xperia Android device. On the device I use SQLite to store some local data for the app. In the past, no matter how many times I unplug my device and plug it back in - the SQLite data source always persisted between debugging sessions. Recently I've started noticing this data being cleared whenever I unplug and replug in the device... Its frustrating as I have to keep re-entering credentials each time. If I leave the device plugged in it does keep the sqlite details for multiple debug sessions, but once I go for a break - unplug the phone and then re-plug it in - my local data source vanishes?

Furthermore - after initial plug-in and on first debug session - it is taking the Visual Studio 2017 8 minutes....YES 8 MINUTES to start the app... Once it has started this delay shortens drastically, but once I replug it in - its again 8 minutes for the first debug session.... Wasting lots of my time....

Anyone else experienced this? Any suggestions of how to find the cause of the problem also welcomed...

Showing a picker after a button click

$
0
0

Hi,

I want to show a picker after a buttonclick to change the color of a boxview. How can I show/hide a picker in a button click event? This is my code:

public partial class MainPage : ContentPage
{
public MainPage ()
{
InitializeComponent ();
}

    Dictionary<string, Color> nameToColor = new Dictionary<string, Color>
    {
        { "Aqua", Color.Aqua },         { "Black", Color.Black },
        { "Blue", Color.Blue },         { "Fuschia", Color.Fuschia },
        { "Gray", Color.Gray },         { "Green", Color.Green },
        { "Lime", Color.Lime },         { "Maroon", Color.Maroon },
        { "Navy", Color.Navy },         { "Olive", Color.Olive },
        { "Purple", Color.Purple },     { "Red", Color.Red },
        { "Silver", Color.Silver },     { "Teal", Color.Teal },
        { "White", Color.White },       { "Yellow", Color.Yellow }
    };

    private void ChangeColorButton_Click(object sender, EventArgs e)
    {
        _showColorPicker ();
    }

    private void _showColorPicker() {
        Picker picker = new Picker
        {
            Title = "Color",
            VerticalOptions = LayoutOptions.CenterAndExpand
        };

        foreach (string colorName in nameToColor.Keys)
        {
            picker.Items.Add(colorName);
        }

        picker.SelectedIndexChanged += (sender, args) =>
        {
            if (picker.SelectedIndex > -1)
            {
                string colorName = picker.Items[picker.SelectedIndex];
                ColorBox.Color = nameToColor[colorName];
            }
        };
    }
}

How to get live/continious audio stream from mobile microphone

$
0
0

is it possible to get live audio stream from mobile mic with specified PCM format, so that I can use that stream in a socket connection.

Image above tabbedpage

$
0
0

How can I put an image above tabbedpage?

What alternatives do I have for an equal design?

Xaml set property conditionally

$
0
0

I have the following XAML:

<ffimg:CachedImage HeightRequest="400" WidthRequest="400" Source="{Binding ImageUrl}">
    <fffimg::CachedImage.Transformations>
        <fftransformations:CircleTransformation/>
    </ffimg::CachedImage.Transformations>
</ffimg::CachedImage>

I would like to set the <fftransformations:CircleTransformation/> only if : {Binding IsRoundImage}. Is it possible to do this directly in XAML? I have tried DataTriggers but it doesn't work.

Can you have a generic MessagingCenter subscripton that will accept messages from classes

$
0
0

Hi,

in my application I have multiple implementations of RFID readers and I have created an Interface than encapsulates common reader actions. So for example I have interface IReader, and then classes ReaderA, ReaderB which each holds it's own implementation of different reader and their action. The reader is a singleton inside my App class. Each Reader sends a message via MessagingCenter everytime when a new tag is detected.
Example of .Send method inside ReaderA class:

MessagingCenter.Send(this, "Rfid", new CustomTag
{
    Id = "123",
    ScannedDate = DateTime.UtcNow
});

So when I subscribe to the message inside my ContentPage, this will work:

MessagingCenter.Subscribe<ReaderA, CustomTag>(this, "Rfid", (sender, item) => {
    //TODO: process result
});

But since the actual implementation of reader will vary, this won't work when my reader will use an instance of ReaderB class. I tried to use the IReader as the sender type inside the subscribe method, but with no success. I also tried to create a base class (BaseReader) and to subscribe to it, send as it, etc. and nothing works. So the botton examples will never fire:

class ReaderA : BaseReader, IReader
{
    //...

}

MessagingCenter.Subscribe<IReader, CustomTag>(this, "Rfid", async (sender, item) => {
    //TODO: process result
});
MessagingCenter.Subscribe<BaseReader, CustomTag>(this, "Rfid", async (sender, item) => {
    //TODO: process result
});

Sure I could just have a separate subscription call for my ReaderB, but I would prefer to just make one generic subscription. Is it possible to do this and how to accomplish it? Thank you for all suggestions and provided answers :)

[UWP] ToolBarItem icon is not shown on first page

$
0
0

When my application loads, no icon is shown in my ToolBarItem. See below screenshot:

If I click a menu item that opens the same page again, then the icon shows correctly:

There isn't a lot of magic to my page, and the ToolBarItem is pretty simple:

Any ideas for why it doesn't show on first load?


Scrolling is not working in xamarin.Ios Editor control

$
0
0

we are displaying simple text in editor control when we assign the text to control from code section. scrolling is not working when i try to edit the text in editor control in ios application but for android it is working fine..

GoogleMaps custom renderer in iOS -> NPE

$
0
0

I'm writing a project with a pcl and ios components. I'm following this sample:

https://github.com/xamarin/xamarin-forms-samples/blob/master/CustomRenderers/Map/Pin

Using it in conjunction with Xamarin.Forms.GoogleMaps NuGet package.

I'm facing a problem inside iOS renderer, because on row number 37 https://github.com/xamarin/xamarin-forms-samples/blob/master/CustomRenderers/Map/Pin/iOS/CustomMapRenderer.cs#L37 i will get always

var nativeMap = null

I can't understand what I'm missing

EDIT:
Debugging I get some more information. The problem seems to be Control as MKMapView casting, infact that casting returns null, Control seems to be GMSMapView type instead of MKMapView.

How to go ahead of this problem???

Setting button's IsEnabled to false does not disable button

$
0
0

I have observed that when setting a button's IsEnabled property to false, the button continues to be enabled.

This button is located at the bottom of the grid. I do not observe this behavior in other views though.

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition />
        <RowDefinition Height="auto" />
    </Grid.RowDefinitions>

    <Grid.ColumnDefinitions>
        <ColumnDefinition />
    </Grid.ColumnDefinitions>

    <ListView Grid.Row="0"  ItemsSource="{Binding Services}" SelectedItem="{Binding SelectedService}" HasUnevenRows="true">
        <ListView.ItemTemplate>
            <DataTemplate>
                <ViewCell>
                    <ViewCell.View>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition />
                                <RowDefinition />
                                <RowDefinition />
                                <RowDefinition />
                                <RowDefinition />
                            </Grid.RowDefinitions>

                            <Grid.ColumnDefinitions>
                                <ColumnDefinition/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>

                            <Label Grid.Row="0" Grid.ColumnSpan="2"  Text="{Binding Name}" />
                            <Label Grid.Row="1" Grid.Column="0" Text="Labor:" />
                            <Label Grid.Row="1" Grid.Column="1" Text="{Binding LaborCost, StringFormat='{}{0:c}'}"  />

                            <Label Grid.Row="2" Grid.Column="0" Text="Materials:" />
                            <Label Grid.Row="2" Grid.Column="1" Text="{Binding Materials, Converter={StaticResource MaterialsToCostConverter}, StringFormat='{}{0:c}'}}" />

                            <Label Grid.Row="3" Grid.ColumnSpan="2" Text="{Binding Description}" />
                        </Grid>
                    </ViewCell.View>
                </ViewCell>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>

    <Button Grid.Row="1" Grid.Column="0"  Text="Details" IsEnabled="False"
            Command="{Binding ViewService}"/>

</Grid>

How to add swiping dots to Tabbed/Carousel page?

$
0
0

I'm wondering how to add dots indicating to swipe screens in either TabbedPage or CarouselPage like in the below image?

I tried adding images for that but they don't look natural so is there a real way for doing that?

My above workaround explanation in an example with 3 page:

I create 3 images each image has 3 dots one of them is highlighted:

First image highlighted dot is the first one.

Second image highlighted dot is the second one.

and etc.

How to Create Nuget packages for Xamarin forms ( custom views / services)??

$
0
0

Hi all can someone please shed some light on creating Nuget packages for xamarin.forms

I'm currently looking into trying to make some Custom view controls / services's for Xamarin.Forms, has any one got helpful tips like from which starting project to setup and adding the proper config files such as the nuspec file in some step by step fashion.

I did use James Montemagno plugin https://marketplace.visualstudio.com/items?itemName=vs-publisher-473885.PluginForXamarinTemplates which i was able to generate the nuget package file but could install the nuget package in my project with an error

Could not install package ''. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile111', but the package does not contain any assembly references or content files that are compatible with that framework.

So james plugin is also kinda old with no VS 2017 support and Xamarin moves so fast these days is this the preferred method developers follow?? I really wanna starting contributing some open source projects but where do i start.

Also whats up with NuGetizer 3000 can i use this? https://github.com/NuGet/Home/wiki/NuGetizer-3000 - The goal of the NuGetizer 3000 project is to make it as easy as possible to create and publish a NuGet package, including bait-and-switch packages, and provide guidance to users along the way.

I'm using a window 10 machine with VS 2017 but also setup VS 2015 for Jame's plugin

Autocomplete Entry box in xamarin forms

$
0
0

Hi, I want to add Autocomplete entry box in my project. I have search a lot in internet but didn't find useful. how can i do this.

OpenTok Xamarin.Forms nuget Video Chat


Context Menus, built-in or custom?

$
0
0

I am trying to create a context menu control in my Xamarin.Forms app, a bit like the Apple Assistive Touch button, or like this, where the additional options are shown on tap, ideally with the sort of animation that these controls typically have. Is this something which Xamarin supports, or is it something that I could code myself on Xamarin, if so how would I do this?

Thanks.

How to create a service in xamarin.forms?

$
0
0

I want to create a application where i wanted to send message just after the call is disconnected. When the callee places a call and disconnects it, the message should automatically be sent from the application to the caller.The message content would be the text configured in the app itself. The call could be a miscall or complete call. How can i achieve this in xamarin.forms?

Content-Page OnAppearing-Event fired too early

$
0
0

Hello,

I have normal TabbedPage:

<TabbedPage.Children>
    <NavigationPage Title="Page1">
        <x:Arguments>
            <views:Page1 />
        </x:Arguments>
    </NavigationPage>

    <NavigationPage Title="Page2">
        <x:Arguments>
            <views:Page2 />
        </x:Arguments>
    </NavigationPage>

....

</TabbedPage.Children>

Expected Behaviour:
When I touch Page2, I expect to get an OnAppearing-Event.

Actual (bug?) Behaviour:
When the app starts, OnAppearing-Events are immidiatly fired for all NavigationPages (Content-Page1,Content-Page2,..).
When I touch on Page2, no OnAppearing gets fired. When I touch Page3, then OnDisappearing gets fired and afterwards, when touching Page2, I get the desired OnAppearing only directly when I open the page (so my code fails on first open of page and works on re-open).

How can I get a delayed event, that only gets fired, when I really touch the Tab-Page2.

After Removing Page from Stack, Again Going to Same Page By PushAsync(), controls are not clickable

$
0
0

I am implementing Video Calling functionality for that i am calling form one other app and passing parameter to my app
when i am opening my App's
1)Incoming Call Page (has Accept/Reject Button) => For first time Accept/Reject Button is working perfect.
a) when i am clicking Accept Button
i am Navigating to OnGoingCallPage and Removing IncomingCallPage from Stack.
after disconnecting call
when i am calling again i am opening IncomingCallPage and (Accept/Reject button )
my problem is Accept/Reject Button is not clickable for second time.

When I am Removing (Killing) my App from RecentTask List then Accept/Reject button clicked every time .
What i am doing mistake.

Please Help,

fixed view over NavigationPage

$
0
0

Hi,
how can I add a fixed view over NavigationPage ?

Something like

ContentPage
-StackLayout
--Label
--NavigationPage

I cannot use ToolbarItem because I don't want that this bar slide when page change

Viewing all 91519 articles
Browse latest View live


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