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

How to assign Item template for Picker control in Xamarin Forms?

$
0
0

I have a Bindable picker control but for multi selection I need to use Check box as Item template for this picker control.
Please suggest how can I achieve this in Xamarin Forms.. kindly provide any links which can be useful for my criteria..

Thanks,


Xamarin.Forms UWP ImageRessources issue

$
0
0

(I'm sorry for my crappy english I'm French)
Hello , I have an issue with ImageRessources from Xamarin.Forms on my MainPage.xaml.g.cs InitializeComponent, on the line this.LoadFromXaml(typeof(MainPage));

i have this exeption :
'System.MissingMethodException' in Xamarin.Forms.Xaml.dll
Method not found: 'Xamarin.Forms.ImageSource Xamarin.Forms.ImageSource.FromResource(System.String)'.

when i delete this line : from my MainPage.xaml i have no problem but i need this line.

I have this exception problem only on UWP and not on iOs or Android

Thank you for your time.

IsVisible binding not changing visibility

$
0
0

Hi, I'm having trouble implementing a tabbed view inside a ContentPage. The reason I'm not using the TabbedPage is that I need a header with an image above the tab bar. I have a Grid which contains both a Grid and a ListView, both set to the same row and column, and I want to only make one visible at a time, depending on the ViewModel's Tab property, which is changed with SetTabCommand.
I have verified that SetTabCommand changes the value of Tab, that the converters are called and that they return the correct values. However, neither of the views who're supposed to toggle between visible and invisible change in any way. I've tried commenting out both the inner Grid and the ListView individually, and their visibility doesn't change when I press the navigation buttons. If I don't uncomment either I only see the ListView.

Here's the layout of my xaml:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage>
  <ContentPage.Resources>
    <ResourceDictionary>
      <converters:PropertyMatchToBoolConverter x:Key="TabToVisibilityConverter" />
    </ResourceDictionary>
  </ContentPage.Resources>
  <Grid>
    <Grid>
      <Image>
      </Image>
      <Grid>
        <Label>
        </Label>
        <Button Command="{Binding SetTabCommand}" CommandParameter="0">
        </Button>
        <Button Command="{Binding SetTabCommand}" CommandParameter="1">
        </Button>
      </Grid>
    </Grid>
    <ListView
      IsVisible="{Binding Tab, Converter={StaticResource TabToVisibilityConverter}, ConverterParameter=0}"
      >
      <ListView.ItemTemplate>
        <DataTemplate>
          <ViewCell>
          </ViewCell>
        </DataTemplate>
      </ListView.ItemTemplate>
    </ListView>
    <Grid
      IsVisible="{Binding Tab, Converter={StaticResource TabToVisibilityConverter}, ConverterParameter=1}"
      >
    </Grid>
  </Grid
</ContentPage>

I omitted row/column definition and a bunch of other irrelevant properties; if you feel like anything's missing I could add that back in or post the real xaml, though it is 150 lines.

Does anyone know what I'm doing wrong? I read about bugs concerning IsVisible, but they were supposed to have been fixed.

Issue with picker in iOS

$
0
0

I noticed an issue with the picker control in iOS and wanted to see if anyone else was experiencing the same problem. Once the chooser pops up after tapping the picker in iOS, if I adjust the selected item and press the "Done" button very quickly (i.e. before the "wheel" animation has completely finished moving), the newly selected item is not accepted by the picker and it still shows the previous value. Is anyone else seeing this same behavior?

(this is easiest to reproduce when there are just 2 items in the picker so you can quickly swipe to the other item and press Done)

How to place an ActionSheet on iPad?

$
0
0

Hey Guys,

i am trying to show an ActionSheet in the lower right corner (iPad). But i cannot find any placing options. It seems that the ActionSheet is only showing correct on an iPhone, but not on an iPad. Do i miss something?

        var sheetConfig = new ActionSheetConfig();

        if (picker.IsCameraAvailable)
            sheetConfig.Add("Kamera", () => this.FromCamera.Execute(null));
        if (picker.IsPhotoGalleryAvailable)
            sheetConfig.Add("Galerie", () => this.FromGallery.Execute(null));

        dialogs.ActionSheet(sheetConfig);

Would be nice, if someone could give me a hint.

Thanx in advance.
Chris

ImageSource.FromResource

$
0
0

Hi

If I try to load a image like described below in a Page I get a thread exception.

The image "Logo.png" is part of the PCL Library With build action 'BundleResource'.

var imageLogo = new Image
{
Source = ImageSource.FromResource("Logo.png")
};

Do I have to move the Resource to each Application (Android, iOS and Windows Phone ? )

Regards

Global try catch

$
0
0

Hello,
In a production context, is there a way to make sure my app won't crash no matter what ?
I was thinking about a (horrible) global try catch encompassing unhandled exceptions that could be raised but I don't know how to do it.
I'm working with PCL & Windows 10 Universal App projects.
Thank you.

New Xamarin.Forms Guides and Recipes for December

$
0
0

Recently we've published a significant amount of new Xamarin.Forms content on the Xamarin Developer Center. This content takes the form of new guides, updates to existing guides, and new recipes. In addition to the new content, there are also new samples. These are linked to from the guides, and can also be found in the Xamarin.Forms Samples Gallery and on GitHub.

New Guides

The following guides have recently been added, or updated:

Layouts

Xamarin.Forms has several layouts and features for organizing content on screen. The following articles explore the different layouts and features:

Navigation

Xamarin.Forms provides a number of different page navigation experiences, depending upon the Page type being used. The following articles explore the different page navigation experiences:

Custom Renderers

Xamarin.Forms user interfaces are rendered using the native controls of the target platform, allowing Xamarin.Forms applications to retain the appropriate look and feel for each platform. Custom Renderers let developers override this process to customize the appearance and behavior of Xamarin.Forms controls on each platform.

The following additional articles have been added to this guide:

DependencyService

Xamarin.Forms allows developers to define behavior in platform-specific projects. The DependencyService then finds the right platform implementation, allowing shared code to access the native functionality. The following articles describe and discuss using the DependencyService:

Performance

There are many techniques for increasing the performance of Xamarin.Forms apps. Collectively these techniques can greatly reduce the amount of work being performed by a CPU, and the amount of memory consumed by an app. This article describes and discusses these techniques.

Miscellaneous

New Recipes

The following recipes have recently been added to the Xamarin.Forms Recipes collection. The recipes cover controls, iOS, and maps:

The recipes come with code samples that can be found on GitHub. In addition, the samples are linked to from each recipe.


Project not uploading to Xamarin Android Player

$
0
0

Hello Guys

I've recently begun to play around with Xamarin.Forms. I've run across a problem where I cannot upload the app to Xamarin Android Player. I've selected "Upload To Device", Run With, nothing seems to be loading the app on to the emulator. Any help out there?

My Fault: Color display problem on Android

$
0
0

Sorry, this was my fault. By setting IsEnabled=false the system changes the color slightly. I'm not sure if this should be the case on Android for a ListView.

Hi,

Forms is always good for surprises :-(

I create a page with this BackgroundColor

        page3.BackgroundColor = Color.FromRgba(11, 204, 188, 255);

Wonderinf why the color did not look as on the sample picture I got from my designer I loaded the sample picture on the phone and made two screenshots, one with the sample picture and one of my running app. You won't believe it:

Left, the sample picture, right my App.

Any Idea?

Cheers
Thomas

How to use listview Context actions while using a Data template

$
0
0

Currently I have:

DataTemplate cell = new DataTemplate(typeof(ImageCell));
 cell.SetBinding(ImageCell.TextProperty, new Binding("serverName"));
        cell.SetBinding(ImageCell.DetailProperty, new Binding("username"));
        cell.SetBinding(ImageCell.ImageSourceProperty, new Binding("serverLogo"));
        cell.SetValue(ImageCell.CommandProperty, moreAction.Command);

I want to add in the feature that when I swipe a cell in my list, i get an option to delete that item from the list. I have searched read some examples online about how to do it in XAML, but i could not figure out how to translate that to the way I want it, which is using C# alone.

This is one of the articles: https://developer.xamarin.com/guides/xamarin-forms/user-interface/listview/interactivity/#Context_Actions,

if anyone can provide a detailed example of how they did this that would really help.

Thanks!

How to do the equivalent of {Binding Source} in code?

$
0
0

I'm extending a control to be able to reuse it across my current Xamarin project. As part of this control, I need to create a DataTemplate programmatically. I have this part figured out and it works ok.

The DataTemplate has a Label in it. I need to bind the Label's BindingContext property to {Binding Source}. I need to bind the Label's Text property to {Binding Path=Name}.

This works in XAML, but I don't want to have to copy it to a million different places in the code base.

<dxGrid:TemplateColumn FieldName="MyPropertyName"
                            Caption="MyColumn">
        <dxGrid:TemplateColumn.DisplayTemplate>
            <DataTemplate>
                <Label BindingContext="{Binding Source}"
                        Text="{Binding Source, Path=MyPropertyName}" />
            </DataTemplate>
        </dxGrid:TemplateColumn.DisplayTemplate>

My extended control looks like this right now:
`public class MyColumn : TemplateColumn
{
public MyColumn()
{
DataTemplate displayTemplate = new DataTemplate(() =>
{
BindingBase textBinding = new Binding(FieldName);

            Label label = new Label();

            // TODO: Bind BindingContextProperty to {Binding Source}
            //label.SetBinding(BindingContextProperty, binding);

            label.SetBinding(Label.TextProperty, textBinding);
            return new ViewCell
            {
                View = label
            };
        });

        DisplayTemplate = displayTemplate;
    }
}`

I'm getting hung up in the binding because I'm not sure how to do the equivalent of {Binding Source} in code. Any help would be appreciated.

This question was originally posted to StackOverflow here: http://stackoverflow.com/questions/35808706/how-to-do-the-equivalent-of-binding-source-in-code

How do I add the Platform specific parts to a PCL-libary project

$
0
0

Hi,

I have a PCL library project in my solution. I know want to implement a custom renderer in this PCL, but wonder where to put the platform specific code. How do I add the native project parts? When creating a PCL-Library in VS it's created as pure PCL.

I hope you understand what I mean .

Thomas

Best way to show Extreme high resolution images on mobile

$
0
0

I need to show extreme high resolution images on my mobile app.
I mean being able to look into images with resolutions over 10000x10000 on a non high end device.

Whats your advice on the best and the easiest aproach for this end?
Should i use the graphic library ?
Is it easier to send the image to a webview browser and let it manage all the work?

Xamarin.Forms and XWalkView compatibility issue on Android

$
0
0

Hi,

I'm trying to use Xamarin.Forms master details page with CrossWalk Web View (XWalkView) as the web control in the details page. The issue I'm facing is that the master page slide out is hidden by the XWalkView itself.

Here is the GitHub repo of the demo code: https://github.com/philieu/XamarinFormsXWalkViewTest
Here is the video that describes the issue: https://youtu.be/FW91eQos-8U

I used the latest Xamarin.Forms (v 2.1) in the demo code. Anyone facing the same issue or know of a fix / workaround?

Regards,
Phi


How to put images in tabbed page?

$
0
0

I wanna put some images in a xamarin forms tabbed page but i could not find any example of this, can anyone help me with that?

ERROR ITMS-90072: "The IPA is invalid. It does not include a Payload directory"

$
0
0

I'm trying to submit my app to the Apple Store, but when I try to send my IPA him of the following error

ITMS - 90072 ERROR: . " The IPA is invalid It does not include the Payload directory"

Anyone know how to solve?

Show Progress Dialog ( AndHUD / BTProgress )

$
0
0

How can these be integrated into Xamarin.Forms?

Should I create a renderer? I have been trying to use ViewRenderer but have not been able to get it working, or even compiling.

Can't find much documentation that is helpful.

All I need is a simple Progress.Show() / Progress.Hide()

How to Send SMTP Email Using Xamarin.Forms without user interaction?

$
0
0

Hello,

Can I send an email using Xamarin.Forms without user interaction? I tried using System.Net.Mail and MailKit and both are not working in xamarin.forms. MailKit cannot be added as a nuget package in the main project but can be added in the IOS and Android projects separately. Can I use an API for sending emails with the indie license? Any other alternatives?

Thank you.

Xamarin Forms ListView performance problems and wrong items on scroll

$
0
0

Hi all,

we are using Xamarin Forms version 1.5.0.6447 in our application.

We have a ContentPage with two ListViews. From the first ListView you can add items to the second ListView.

A ListViewItem has an image and a label.

The data is bound with a ObservableCollection.

For a better overall view please check the screenshot.

If I add several items to the right listview the performance is slow.
If I add more items than I can show at screen --> I have to scroll.

But scrolling is also slow and at the end of my scrollable list (not always sometimes also in the middle) my image are changed/wrong drawn (as you can see in screenshot).

Interesting: When I start to delete items from my ListView and the amount of items is significant reduced (or fit on my screen) --> the image is correct !

Any ideas?

Any help appreciated

Thank you in advance

Best Regards

Viewing all 58056 articles
Browse latest View live


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