Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all 204402 articles
Browse latest View live

System.Data.SqlClient

$
0
0

I want to add System.Data.SqlClient in Portable (not in iOS or Android), on a cross-platform aplication, is possible?


Activity indicator stops while running tasks in background

$
0
0

I have an activity indicator on a popup page(Rg.Plugin). On that popup, I am calling an await method which basically gets data from an API. The activity indicator stops/halths while the data is being fetched. How can I fix this?

Dropbox NSErrors (NSObject, NSString, NSUrl)

$
0
0

I'm getting these NSObject, NSString and NSUrl errors, telling me to add a reference but I don't know where to get this reference from.

Severity Code Description Project File Line Suppression State
Error CS0012 The type 'NSObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'monotouch, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'.

All three errors are asking for the same reference.

Getting Error while using PCLAppConfig

$
0
0

I got this error:

"unhandled Exception:
System.IO.FileNotFoundException: please link the 'App.config' file from your shared pcl project to
the 'Assets' directory of your android project, with build action
'AndroidAsset'"

any ideas ?

I have linked the App.config file in android assets , still the error is coming

How to add a reference to System.Configuration?

AppSettings Reader for Xamarin and Xamarin.Forms

$
0
0

Reading app.config files in a Xamarin.Forms Xaml project

While each mobile platforms do offer their own settings management api, there are no built in ways to read settings from a good old .net style app.config xml file; This is due to a bunch of good reasons reasons, notably the .net framework configuration management api being on the heavyweight side, and each platform having their own file system api.

So we built a simple PCLAppConfig library nicely nuget packaged for your immediate consumption.

This library makes use of the lovely PCLStorage library

This example assumes you are developing a Xamarin.Forms Xaml project, where you would need to access settings from your shared viewmodel.

FOR FILESYSTEM APP.CONFIG

Initialize ConfigurationManager.AppSettings on each of your platform project, just after the ‘Xamarin.Forms.Forms.Init’ statement, as per below:
iOS (AppDelegate.cs)

Xamarin.Forms.Forms.Init();
ConfigurationManager.Initialise(PCLAppConfig.FileSystemStream.PortableStream.Current);
LoadApplication(new App());

Android (MainActivity.cs)

Xamarin.Forms.Forms.Init(this, bundle);
ConfigurationManager.Initialise(PCLAppConfig.FileSystemStream.PortableStream.Current);
LoadApplication(new App());

UWP / Windows 8.1 / WP 8.1 (App.xaml.cs)

Xamarin.Forms.Forms.Init(e);
ConfigurationManager.Initialise(PCLAppConfig.FileSystemStream.PortableStream.Current);
LoadApplication(new App());

Add an app.config file to your shared PCL project, and add your appSettings entries, as you would do with any app.config file

<configuration>
  <appSettings>
    <add key="config.text" value="hello from app.settings!" />
  </appSettings>
</configuration>

Add this PCL app.config file as a linked file on all your platform projects. For android, make sure to set the build action to ‘AndroidAsset’, for UWP set the build action to ‘Content’
Access your setting:

ConfigurationManager.AppSettings["config.text"];

FOR EMBEDDED APP.CONFIG

Initialize ConfigurationManager.AppSettings on your pcl project like below:

Assembly assembly = typeof(App).GetTypeInfo().Assembly;
ConfigurationManager.AppSettings = new ConfigurationManager(assembly.GetManifestResourceStream("DemoApp.App.config")).GetAppSettings;

Add an app.config on your shared pcl project and ensure that Build Action:EmbeddedResource, and add your appSettings entries, as you would do with any app.config
The source code and demo app are available in github

Space between Listview cards

$
0
0

I have a listview. What I want is to insert space between the various cards of the listview. How can I achieve this?

wanted to know about Xamarin Game Snap Attack


Binding TextColor of label to a property in the viewmodel

$
0
0

I have a label and I want to dynamically bind the textcolor property of this label to a property in my viewmodel. I have two doubts - does the property in my viewmodel has to be of type string or Color? And how do I do this thing?
All the previously answered questions haven't worked for me even when I have tried using an IValueConverter.
Thanks!

PCLAppConfig

$
0
0

I got this error:

"nhandled Exception:
System.IO.FileNotFoundException: please link the 'App.config' file from your shared pcl project to
the 'Assets' directory of your android project, with build action
'AndroidAsset'"

any ideas ?

Trim/Crop/Split Video

$
0
0

Is there an easy way to implement video trimming/cropping functionality? (Having a bar at the bottom of the video, where the user can easily split the video).

Augmented Reality for Xamarin.Forms.

$
0
0

Augmented Reality for Xamarin.Forms.

Does Xamarin Profiler ignores build errors?

$
0
0

xamarin profiler runs even there is a build error. what does that mean? it ignore and runs based on last successful build?

How to acces object inside CarouselView Xamarin.Forms

$
0
0

I have a Xamarin.Forms app that displays a ViewFlipper (https://github.com/TorbenK/ViewFlipper) inside a CarouselView.

I would like the ViewFlipper to flip back to the front when changing pages inside the carousel. But I can't seem to figure out how to access the ViewFlipper.

I have the following working code:

public class CarouselContent
{
    public string FrontImg { get; set; }
    public string BackImg { get; set; }
}

public class MainPage : ContentPage
{
    public MainPage()
    {
        var pages = new ObservableCollection<CarouselContent>();

        var page1 = new CarouselContent();
        page1.FrontImg = "page1Front";
        page1.BackImg = "page1Back";

        var page2 = new CarouselContent();
        page2.FrontImg = "page2Front";
        page2.BackImg = "page2Back";

        pages.Add(page1);
        pages.Add(page2);

        var carouselView = new Carousel(pages);

        Content = carouselView;
    }
}

public class Carousel : AbsoluteLayout
{
    private DotButtonsLayout dotLayout;
    private CarouselView carousel;

    public Carousel(ObservableCollection<CarouselContent> pages)
    {
        carousel = new CarouselView();

        var template = new DataTemplate(() =>
        {
            //create page
            var absLayout = new AbsoluteLayout();

            //create images for the flipper
            var frontImg = new Image
            {
                Aspect = Aspect.AspectFit
            };
            frontImg.SetBinding(Image.SourceProperty, "FrontImg");

            var backImg = new Image
            {
                Aspect = Aspect.AspectFit
            };
            backImg.SetBinding(Image.SourceProperty, "BackImg");

            //create flipper
            var flipper = new ViewFlipper.FormsPlugin.Abstractions.ViewFlipper();
            flipper.FrontView = frontImg;
            flipper.BackView = backImg;

            //Add flipper to page
            absLayout.Children.Add(flipper);

            return absLayout;
        });

        carousel.ItemsSource = pages;
        carousel.ItemTemplate = template;

        Children.Add(carousel);
    }
}

I tried adding the ViewFlipper to the CarouselContent but I couldn't get that to work. Any ideas?

Windows Phone is Dead!


Change Hamburger Icon Xamarin.Forms Android

$
0
0

Good Morning. I'm struggling in finding a way to change the default hamburger icon in Xamarin.Forms Master-Detail Page on Android.
I tried both to change the icon for the master page (but it works just on iOS) and change it manually in the MainActivity.
I'm using the new FormsAppCompatActivity base class but I can't find a way to modify the ActionBarDrawerToggle as suggested at http://bit.ly/2gv3iZk and still use the ToolbarResource property from FormsAppCompatActivity.
I guess the problem in FormsAppCompatActivity base class.
Forms expect to inflate the ToolBar here from the ToolbarResource layout id. I also tried reproduce the OnCreate via reflection but nothing worked.

Wrong autowidth Label?

$
0
0

Hi, I have a strange problem about Label.

in my GridLayout, defined as:

<Grid x:Name="RowTest"
              BackgroundColor="white"
              RowSpacing="0" ColumnSpacing="0"  MinimumHeightRequest="130" >
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Label
        x:Name="title"
                FontAttributes="Bold"
                Margin="18,8,8,0"
                Grid.ColumnSpan="2"
                TextColor="Black"
                FontSize="24"

                Text="Lorem ipsum"  />
                <BoxView
                Margin="18, 0, 0, 0"
                Grid.Row="1"
                WidthRequest="30}"
                HeightRequest="5"
                BackgroundColor="Yellow" />
                <Label  Margin="18, 0, 0, 0"
                    Grid.ColumnSpan="2"
                    Grid.Row="2"
                    TextColor="Black"
                    FontSize="13"
                    Text="Lorem ipsum dolor sit amet "  />
                <Image
                Aspect="AspectFit"
                Grid.Column="2"
                Grid.RowSpan="3"
                VerticalOptions="Center"
                WidthRequest="28"
                HeightRequest="28"
                Margin="0,0,18,20"
                Source="ic_icon" />
            </Grid>

I don't understand why, but the text in the first label (title) sometimes is cropped and the last word disappear, rather than show the text on two lines.

Example:
Label "title" with Text="Lorem ipsum dolor" in my app it shows only "Lorem ipsum"
Label "title with Text = "Lorem ipsum dolor sit amen" in my app it shows "Lorem ipsum dolor sit amen" (on two rows)

I hope I explain myself.

Regards,

How to Create 3 layer Expadable Listveiw ??

$
0
0

Hi Xamarin Fiends ,
I have create a xamarin forums project and i wanted to ExpandableListView ,how can i do this approch
Plz Help.

How to Add share Extension.

$
0
0

Hi,
I need steps to Add share extension and debug the same in Xamarin.iOS/Android.

Which is the best and fastest idea on scripting MONGO DB with1) C# Or 2)PHP on my xamarin App

Viewing all 204402 articles
Browse latest View live


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