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

System.IO.Compression It does not work - Microsoft.Bcl.Compression

$
0
0

I've a xamarin form project, when i use this code
...
var re =await client.Execute(request);
var gs = new GZipStream(new MemoryStream(re.RawBytes), System.IO.Compression.CompressionMode.Decompress);
..

to call a web api service that return a compress GZipStream json but xamarin studio debug return me this
"The underlying implementation for System.IO.Compression.dll could not be loaded. Make sure to add a reference to the Microsoft.Bcl.Compression NuGet package from your main application project."

but in my project i've Microsoft.Bcl.Compression and i use FubarCoder.RestSharp.Portable

How can i risolve this problem ?

Thanks
Alex


Dynamic Xaml and JSON support in Xamarin Forms

$
0
0

Hello, I am impressed with the technology loading Xaml and JSON dynamically in Xamarin.Forms using https://www.nuget.org/packages/Xamarin.Forms.Dynamic as described in below link.

http://www.cazzulino.com/dynamic-forms.html

But while loading the xaml dynamically from string
but nothing loads in view (Android). Also if load JSON object from string and
set it as BindingContext, exceptions throws “System.NotImplementedException”.

Is there any code or any settings I have missed? Or is it a
bug in Xamarin.Forms version (v2.3.2.127)?

I have used ListItems.xaml and ListItems.json from the provided example.

https://github.com/MobileEssentials/FormsPlayer/blob/master/Demo/HelloForms/ListItems.xaml
https://github.com/MobileEssentials/FormsPlayer/blob/master/Demo/HelloForms/ListItems.json

Here is my code to load xaml and json into the page.

`public App()
{
var page = new ContentPage();
var xaml = ReadXaml();
var json = ReadJson();
Initialize();
page.LoadFromXaml(xaml);
page.BindingContext = JsonModel.Parse(json);
MainPage = page;
}

private string ReadXaml()
{
var assembly = typeof(App).GetTypeInfo().Assembly;
var stream = assembly.GetManifestResourceStream("ListViewDemo.ListItems.xaml");
using (var reader = new StreamReader(stream))
{return reader.ReadToEnd();}}

private string ReadJson()
{
var assembly = typeof(App).GetTypeInfo().Assembly;
var stream =
assembly.GetManifestResourceStream("ListViewDemo.ListItems.json");
using (var reader = new StreamReader(stream))
{
return reader.ReadToEnd();
}}
`

Thanks in advance.

Is there a way to handle opacity differently at some point?

$
0
0

I am using the skiasharp library to create an image editor in xamarin forms.

Is there a way to handle opacity differently at some part?

For example, you can divide the area of the background canvas, one of which looks like the original image and the other looks opaque. Is this possible?

ex

Xamarin.forms.maps not visible in UWP

$
0
0

I am new to Xamarin.forms and need to use maps for UWP platform. I have installed Xamarin.Forms.Maps nuget package in my PCL. And have called the init function in the App.xaml.cs of UWP section as follows:

Xamarin.Forms.Forms.Init(e); Xamarin.FormsMaps.Init("TokenKey");

However, the maps is not visible on deploying. I have added some pins as well and what I see is some blue screen, with the pins. I have tried lot of options, but have found no luck yet. Below is the code snippet for calling maps:

Map map = new Map(MapSpan.FromCenterAndRadius(new Position(51.5074, 0.1278), Distance.FromMiles(10)));
        map.MapType = Xamarin.Forms.Maps.MapType.Hybrid;
        map.HeightRequest = 700;
        map.WidthRequest = 725;
        map.IsShowingUser = true;
        var position1 = new Position(51.5033, 0.1195);
        var pin1 = new Pin { Type = PinType.Place, Position = position1, Label = "label1", Address = "address1" };
        map.Pins.Add(pin1);
        var position2 = new Position(51.5014, 0.1419);
        var pin2 = new Pin { Type = PinType.Place, Position = position2, Label = "label1", Address = "address1" };
        map.Pins.Add(pin2);
        this.mapGrid.Children.Add(map);

Am I doing anything wrong ? Or is there any missing reference that I should be adding to make this work ? Please help me out. Attached a snapshot of the map view for your reference.
P.S- The same solution loads a map on my colleague's machine, but doesn't work on others' machines.

Regards, Swati

ListView Swipe Gestures left to right and right to left

$
0
0

Hello.

I am trying to implement a ListView using Xamarin.Forms which supports swiping in 2 directions.

right to left swipe -> offer a few custom actions
right to left swipe -> offer a few custom actions

Is it possible ? Any suggestions ?

Thanks

Does Xamarin.Form supports Java Written SDK

$
0
0

We have an complete SDK written in Java for android. Now we are about to start a project which we build an application that talks to existed SDK and we need to build for both iOS, and android. I suggested to move all our projects to Xamarin since we are able to build for all platforms. I asked at the work to find out if Kamaran is able to work and communities with an SDK written in Java for android.

I would appreciate your support.

Thanks

MasterDetailPage - Bar at the top of the Detail's Page

$
0
0

Hi,
In my project, i made a Master Detail Page with a Detail page, but on this page, i have a bar a the top and i don't know why.
Does anyone already had this problem ?

Thanks !

My service and board cast stop working if the apps killed

$
0
0

thank you on advance
I have Issue and I hope u can help me
I m trying to design a service on android to check the httpclient every 10s and notify the the user. the application working find until I kill the apps.

can anyone help me

this my activity :

`using System;
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

namespace Lawyer.Droid
{
[Activity(Label = "Lawyer.Droid",LaunchMode=Android.Content.PM.LaunchMode.SingleTop, Icon = "@drawable/icon", Theme = "@style/MyTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
protected override void OnCreate(Bundle bundle)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;

        base.OnCreate(bundle);

        global::Xamarin.Forms.Forms.Init(this, bundle);

        LoadApplication(new App());


        StartService(new Intent(this, typeof(myservice)));



    }
}

}
`

this is my service

using System.Threading;
using System.Threading.Tasks;
using Android.App;
using Android.Content;
using Android.Widget;
namespace Lawyer.Droid
{
[Service(Enabled = true,Exported = true, Name = "lawyer.Droid.myservice")]
class myservice : IntentService
{
public override StartCommandResult OnStartCommand(Intent intent, StartCommandFlags flags, int startId)
{

        new Task(() =>
            {
                while (true)
                {
                     Intent intents = new Intent();
                     intents.SetAction("com.alr.text");
                        //intents.PutExtra("MyData", "Data from service");
                     SendBroadcast(intents);
                    Toast.MakeText(this, "sufyan", ToastLength.Long);
                    Thread.Sleep(10000);
                }

            }).Start();


        return StartCommandResult.Sticky ;
    }

    protected override void OnHandleIntent(Intent intent)
    {

    }

}

this is my board cast :

using System.Collections.Generic;
using System.Net.Http;
using Android.App;
using Android.Content;

using Newtonsoft.Json;

namespace Lawyer.Droid
{
public class Myreciver
{

    //public Myreciver()
    [BroadcastReceiver(Exported = true, Label = "SMS Receiver")]

    [IntentFilter(new string[] {"com.alr.text"})]
    [IntentFilter(new[] { Android.Content.Intent.ActionBootCompleted })]


    //[IntentFilter(new string[] {  "Android.Content.Intent.ActionBootCompleted" })]
    public class SMSReceiver : Android.Content.BroadcastReceiver
    {

        string content1;
        public int d1;
        public override void OnReceive(Context context, Intent intent)
        {

            // Log.Info(Tag, "Intent received: " + intent.Action);
            // read the SendBroadcast data
            if (intent.Action == "com.alr.text")
            {
                // check the data count is null
                if (Lawyer.EmptyClass.Data_count_1 == "")
                {
                    Lawyer.EmptyClass.Data_count_1 = "0";
                }
                // call the php code
                sendtophp();
                if (d1 <= System.Convert.ToInt32(Lawyer.EmptyClass.Data_count_1))
                {

                }
                else {


                    // Start main Activity (you can replace with whatever Activity you want here)
                    var intent1 = context.PackageManager.GetLaunchIntentForPackage(context.PackageName);
                    intent1.AddFlags(ActivityFlags.ClearTop);

                    var pendingIntent = PendingIntent.GetActivity(context, 0, intent, PendingIntentFlags.UpdateCurrent);

                    var context1 = Android.App.Application.Context;
                    var builder = new Android.App.Notification.Builder(context1)
                        .SetSmallIcon(Resource.Drawable.icon)
                        .SetContentTitle("My application")
                        .SetDefaults(NotificationDefaults.Sound)
                        .SetContentText(Lawyer.EmptyClass.Data_count_1)
                        .SetOngoing(true);
                    var not = builder.Build();
                    NotificationManager notManager = (NotificationManager)context.GetSystemService(Context.NotificationService);
                    notManager.Notify(1, not);
                    Lawyer.EmptyClass.Data_count_1 = d1.ToString();


                }
            }
            //read incomming sms

        }
        public async void sendtophp()
        {


            var client = new HttpClient();
            try
            {
                var response = await client.GetAsync("url");
                if (response.IsSuccessStatusCode)
                    content1 = await response.Content.ReadAsStringAsync();
                var result = JsonConvert.DeserializeObject<List<MSG>>(response.Content.ReadAsStringAsync().Result);

                d1 = result.Count;
            }
            catch (System.Exception e)
            {

            }
        }



        public class MSG
        {
            public string date { get; set; }
            public string text { get; set; }
            public string text1 { get; set; }
            public string user { get; set; }
            public string password { get; set; }
        }
    }

}

}


Listview with Entry - Select the listview row(item) and Entry.Text when tap the Entry.

$
0
0

My app is a Xamarin.Forms PCL and I have this challenge that is driving me crazy to solve:

Every time I tap an item of the listview, I need to focus the entry and select everything inside it ("0" at this time).
I also need to select the item if I tap the Entry.

I think the key is get the elements inside the <ViewCell.View> to get access to the Entry and solve the problem with that, but who knows how to get those elements?

My screen is this:

My XAML listview is this:

<ListView x:Name="countsheetListView"
    IsGroupingEnabled="True"
        GroupDisplayBinding="{Binding InventoryGroupName}"
        ItemTapped="countsheetListView_ItemTapped">
        <ListView.GroupHeaderTemplate>
            <DataTemplate>
                <ViewCell>
                    <ViewCell.View>
                            <Grid BackgroundColor="#EAEAEA" >
                            <Label Text="{Binding InventoryGroupName}" Style="{StaticResource labelGroupTitleStyle}" />
                            </Grid>
                    </ViewCell.View>
                </ViewCell>
            </DataTemplate>
        </ListView.GroupHeaderTemplate>
        <ListView.ItemTemplate>
            <DataTemplate>
                <ViewCell>
                    <ViewCell.View>
                            <Grid HeightRequest="30">
                                <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="60*" />
                                        <ColumnDefinition Width="15*" />
                                        <ColumnDefinition Width="15*" />
                                        <ColumnDefinition Width="10*" />
                                </Grid.ColumnDefinitions>
                                <Label Grid.Column="0" Text="{Binding Description}" Style="{StaticResource labelStyle}"/>
                                <Entry Grid.Column="1" x:Name="txtCount" Text="0"  TextColor="Black" FontSize="15" HorizontalTextAlignment="End"    Focused="txtCount_Focused"/>
                                <Label Grid.Column="2" Text="{Binding RecipeUom}"  Style="{StaticResource labelStyle}"/>
                                <Image Grid.Column="3" Source="ic_info.png" HorizontalOptions="End" x:Name="imgSelectCountsheet">
                                        <Image.GestureRecognizers>
                                            <TapGestureRecognizer  NumberOfTapsRequired="1"/>
                                        </Image.GestureRecognizers>
                                </Image>
                            </Grid>
                    </ViewCell.View>
                </ViewCell>
            </DataTemplate>
        </ListView.ItemTemplate>
   </ListView>

This is that kind of irritating issue. Visually extremely simple, but I think I have a lot of work to do to achieve that.
Can anyone help me please?
Thank you anyway

Button in AbsoluteLayout not clickable on iOS 8

$
0
0

I have an AbsoluteLayout with a series of buttons positioned to overlay an image. I gave each button a Command binding which is resolving fine, and a CommandParameter. This works when the button is not placed within an AbsoluteLayout.

When I press the button on the AbsoluteLayout, however, the touch is not recognised at all. This is true even for the Clicked event, and there is no visual feedback on the device either when I hold my finger on the button as there is in buttons that aren't contained within the AbsoluteLayout.

Am I missing something here? Do I have to wire up the buttons differently perhaps in a container view?

Targeting .NET Standard

$
0
0

I read this article a while ago:
https://blog.xamarin.com/net-standard-library-support-for-xamarin/

So, I converted all of our libraries from portable libraries to .NET Standard (1.4). I did this because the article says "This PCL now needs to be upgraded to target the .NET Standard Library, which can be found in the projects properties.".

However, I can't figure out how to build a Xamarin Forms project that targets .NET Standard. I cloned the Xamarin Forms samples, and opened up the MasterDetailPage project. I went in to the project properties and switched from portable to .NET Standard as per the instructions. Immediately, I get an error telling me that I need to opt in to NuGet 3.0 support. I'm fine with this, but how do I do it?

I found that if I remove the Xamarin Forms NuGet package, I am able to switch over to .NET Standard. However, once I have done this, I can't add the Xamarin Forms NuGet package back. It just keeps failing. Contrary to what the article says, I cannot add references to .NET Standard libraries. When I try to add a reference to existing .NET Standard libraries in my Solution, Visual Studio just gives me an error saying that the library is not compatible. Which version of .NET Standard should I be targeting for Xamarin Forms?

How do I get a .NET Standard library compiling with Xamarin Forms support?

How to create a 1 row and 2 column layout?

$
0
0

Hi! i would like to ask if how can i achieve this kind of layout..
please see attached file... thank you

height should be equally divided into two column..

How do I create a list of SwitchCell elements in a ListView?

$
0
0

Please forgive the general and basic level of this question, but - even though I have looked at lots of examples - I am really struggling to come up with working syntax for creating a ListView of SwitchCell elements in C# code (not XAML).

Could anyone post a short piece of code, showing how I would put this together?

Kind wishes ~ Patrick

Listbox custom grouping

$
0
0

Hello!
I have problem with understanding grouping in listview. I have such class

class BaseActionModel
    {
        [PrimaryKey, AutoIncrement]
        public int Id { get { return _id; } set { _id = value; } }
        public double Value { get { return _value; } set { _value = value; } }
        public DateTime Time { get { return _time; } set { _time = value; } }
        public string TextColor { get { return _textColor; } set { _textColor = value; } }
   }

I have binded this list to xaml as ObservableCollection and it works.
Now I would like to create custom groping like here in middle image - create proper time interval (eg. "Today", "Yesterday", "This week".. and so) and classify observation to right group due to its Time value.

How could I achieve it? It is important to make this dynamic - new observations will be added very often and it is needed that group of observation will be calculated in runtime.

Thanks in advance for your tips.

Image not showing in UWP

$
0
0

Hi everyone

I'm developing an application that can be deployed to Android and iOS, and everything is working fine. I also want the same application to be deployed to Windows 10 (UWP), so I added the UWP-project.

The application itself uses a MasterDetailPage: a menu at the left of the screen and a page as Detail. The Detail has an image that is located as a resource in my PCL-project. In both Android and iOS this image is shown perfectly, but for some reason the UWP-project raises an UnhandledException-error because of this image...

The Exception:

Object reference not set to an instance of an object.

   at Xamarin.Forms.Platform.UWP.ImageRenderer.UpdateAspect()
   at Xamarin.Forms.Platform.UWP.ImageRenderer.<OnElementChanged>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
   at System.Threading.WinRTSynchronizationContext.Invoker.InvokeCore()

I don't know why but it has something to do with that very Image-control. What could be the problem?

P.S.: the weird thing is, the menu of MasterDetailPage also has images and they show up perfectly.


Set binding from code dont work in xamarin.forms app

$
0
0

Im trying to use accordion in my xamarin.forms app.I can use it without any problems But when I want to use this with viewmodels.No data is shown in accordion
.My viewmodel is like this ;

     namespace xamarinapp
    {
       public class TestViewModel : ViewModelBase
        {
            private readonly IServiceWrapper _myServiceWrapper;
            private readonly IAuthenticationService _authenticationService;

            public string viemodelName { get; set; }

            private bool UserLogCheck = false;
            private ObservableRangeCollection<dataInfro> _Acclist;
            public ObservableRangeCollection<Models.dataInfro> Acclist
            {
                get
                {
                    return _Acclist;
                }
                set
                {
                    _Acclist = value;
                     RaisePropertyChanged(() => Acclist);
                }
            }

            public override async Task InitializeAsync(object navigationData)
            {
                UserLogCheck = DependencyService.Get<LoginInterface>().LoginExists();
                if (!UserLogCheck)
                {
                    NavigationService.NavigateToAsync<LoginViewModel>();
                }
                else
                {
                  await  getData();
                }
            }
            public ICommand ItemSelectedCommand2 => new Command<dataInfro>(OntaptedItem);
            private async void OntaptedItem(dataInfro item)
            {

                await NavigationService.NavigateToAsync<OgrenciNotViewModel>(item.ogrId.ToString());

            }
            public TestViewModel(IServiceWrapper myServiceWrapper)
            {
                _myServiceWrapper = myServiceWrapper;
                _Acclist = new ObservableRangeCollection<dataInfro>();

            }
            private async Task getData()
            {
                ServiceWrapper serviceWrapper = new ServiceWrapper();
                var loginUser = DependencyService.Get<LoginInterface>().getAccount();
                var data =  await _myServiceWrapper.GetDataSecure<Ogrencilik>("GetDataUrl", loginUser);
                Acclist =new ObservableRangeCollection<dataInfro>(data.dataCollect);
            }
        }

    }

And the accordion custom control is like this.(from https://kimsereyblog.blogspot.com.tr/2016/10/build-accordion-view-in-xamarinforms.html )

    namespace xamarinapp
    {
        public class DefaultTemplate : AbsoluteLayout
        {
            public DefaultTemplate()
            {
                this.Padding = 0;
                this.HeightRequest = 50;
                var title = new Label { HorizontalTextAlignment = TextAlignment.Start, HorizontalOptions = LayoutOptions.StartAndExpand };
                var price = new Label { HorizontalTextAlignment = TextAlignment.End, HorizontalOptions = LayoutOptions.End };
                this.Children.Add(title, new Rectangle(0, 0.5, 0.5, 1), AbsoluteLayoutFlags.All);
                this.Children.Add(price, new Rectangle(1, 0.5, 0.5, 1), AbsoluteLayoutFlags.All);
                title.SetBinding(Label.TextProperty, "name", stringFormat: "{0:c1}");
                price.SetBinding(Label.TextProperty, "balance", stringFormat: "{0:C2}");
            }
        }

        public class AccordionView : ScrollView
        {
            private StackLayout _layout = new StackLayout { Spacing = 1 };

            public DataTemplate Template { get; set; }
            public DataTemplate SubTemplate { get; set; }

            public static readonly BindableProperty ItemsSourceProperty =
                BindableProperty.Create(
                    propertyName: "ItemsSource",
                    returnType: typeof(IList),
                    declaringType: typeof(AccordionSectionView),
                    defaultValue: default(IList),
                    propertyChanged: AccordionView.PopulateList);

            public IList ItemsSource
            {
                get { return (IList)GetValue(ItemsSourceProperty); }
                set { SetValue(ItemsSourceProperty, value); }
            }

            public AccordionView()
            {
                var itemTemplate = new DataTemplate(typeof(DefaultTemplate));
                this.SubTemplate = itemTemplate;
                this.Template = new DataTemplate(() => (object)(new AccordionSectionView(itemTemplate, this)));
                this.Content = _layout;
            }

            void PopulateList()
            {
                _layout.Children.Clear();

                foreach (object item in this.ItemsSource)
                {
                    var template = (View)this.Template.CreateContent();
                    template.BindingContext = item;
                    _layout.Children.Add(template);
                }
            }

            static void PopulateList(BindableObject bindable, object oldValue, object newValue)
            {
                if (oldValue == newValue) return;
                ((AccordionView)bindable).PopulateList();
            }
        }

        public class AccordionSectionView : StackLayout
        {
            private bool _isExpanded = false;
            private StackLayout _content = new StackLayout { HeightRequest = 0 };
            private Color _headerColor = Color.FromHex("0067B7");
            private ImageSource _arrowRight = ImageSource.FromFile("ic_keyboard_arrow_right_white_24dp.png");
            private ImageSource _arrowDown = ImageSource.FromFile("ic_keyboard_arrow_down_white_24dp.png");
            private AbsoluteLayout _header = new AbsoluteLayout();
            private Image _headerIcon = new Image { VerticalOptions = LayoutOptions.Center };
            private Label _headerTitle = new Label { TextColor = Color.White, VerticalTextAlignment = TextAlignment.Center, HeightRequest = 50 };
            private DataTemplate _template;

            public static readonly BindableProperty ItemsSourceProperty =
                BindableProperty.Create(
                    propertyName: "ItemsSource",
                    returnType: typeof(IList),
                    declaringType: typeof(AccordionSectionView),
                    defaultValue: default(IList),
                    propertyChanged: AccordionSectionView.PopulateList);

            public IList ItemsSource
            {
                get { return (IList)GetValue(ItemsSourceProperty); }
                set { SetValue(ItemsSourceProperty, value); }
            }

            public static readonly BindableProperty TitleProperty =
                BindableProperty.Create(
                    propertyName: "Title",
                    returnType: typeof(string),
                    declaringType: typeof(AccordionSectionView),
                    propertyChanged: AccordionSectionView.ChangeTitle);

            public string Title
            {
                get { return (string)GetValue(TitleProperty); }
                set { SetValue(TitleProperty, value); }
            }

            public AccordionSectionView(DataTemplate itemTemplate, ScrollView parent)
            {
                _template = itemTemplate;
                _headerTitle.BackgroundColor = _headerColor;
                _headerIcon.Source = _arrowRight;
                _header.BackgroundColor = _headerColor;

                _header.Children.Add(_headerIcon, new Rectangle(0, 1, .1, 1), AbsoluteLayoutFlags.All);
                _header.Children.Add(_headerTitle, new Rectangle(1, 1, .9, 1), AbsoluteLayoutFlags.All);

                this.Spacing = 0;
                this.Children.Add(_header);
                this.Children.Add(_content);

                _header.GestureRecognizers.Add(
                    new TapGestureRecognizer
                    {
                        Command = new Command(async () =>
                        {
                            if (_isExpanded)
                            {
                                _headerIcon.Source = _arrowRight;
                                _content.HeightRequest = 0;
                                _content.IsVisible = false;
                                _isExpanded = false;
                            }
                            else
                            {
                                _headerIcon.Source = _arrowDown;
                                _content.HeightRequest = _content.Children.Count * 50;
                                _content.IsVisible = true;
                                _isExpanded = true;

                                // Scroll top by the current Y position of the section
                                if (parent.Parent is VisualElement)
                                {
                                    await parent.ScrollToAsync(0, this.Y, true);
                                }
                            }
                        })
                    }
                );
            }

            void ChangeTitle()
            {
                _headerTitle.Text = this.Title;
            }

            void PopulateList()
            {
                _content.Children.Clear();

                foreach (object item in this.ItemsSource)
                {
                    var template = (View)_template.CreateContent();
                    template.BindingContext = item;
                    _content.Children.Add(template);
                }
            }

            static void ChangeTitle(BindableObject bindable, object oldValue, object newValue)
            {
                if (oldValue == newValue) return;
                ((AccordionSectionView)bindable).ChangeTitle();
            }

            static void PopulateList(BindableObject bindable, object oldValue, object newValue)
            {
                if (oldValue == newValue) return;
                ((AccordionSectionView)bindable).PopulateList();
            }
        }
    }

And I'm trying to set binding like this (by the way im setting viewmodel while navigation)

     [XamlCompilation(XamlCompilationOptions.Skip)]
        public partial class PageOgrenciNotModal : ContentPage
        {
            public PageOgrenciNotModal()
            {
                InitializeComponent();
            }
            protected override void OnBindingContextChanged()
            {
                base.OnBindingContextChanged();
                Accorview.SetBinding(AccordionView.ItemsSourceProperty, "Acclist");
                Accorview.Template.SetBinding(AccordionSectionView.TitleProperty, "Title");
                Accorview.Template.SetBinding(AccordionSectionView.ItemsSourceProperty, "List");
            }
        }

But nothing is happen.(note:there is no problem in getting data ,I can use same approach with listview with no problems).Any help is appreciated ,thanks

How to make a checkbox?

$
0
0

Hello guys,

actually I'm trying to create a checkbox for each item in my listview. I don't know how to do it, so could you please help me? I thought that it could be looks like the following images.

Thank you!

Checkbox for Android

Checkbox for iOS

Xamarin Forms NuGet References Not Downloading (Android)

$
0
0

I have taken the basic MasterDetailPage sample and modified some stuff in the forms project. The Android project is basically exactly as it was when I got it from the Git Repo. It doesn't use project.json It uses packages.config (old school). I'm happy to upgrade to project.json but I can't find any examples of Android projects with project.json.

Anyway, this app was compiling and running fine. Then, I deleted the bin, and obj folders, and I just get compilation errors complaining that the Xamarin Forms library reference is missing. E.g.:
The type or namespace name 'Forms' does not exist in the namespace 'Xamarin' (are you missing an assembly reference?)

I've tried rebuilding, I've tried "Restore NuGet Packages". What can I do to get the references back through NuGet? And why is this still an issue? Why can't the most basic issues be ironed out so we don't end up wasting countless hours just trying to get things to compile?

ScrollView still overlapping its bounds on Android when contents are added to Visual Tree

$
0
0

So I am still having the same bug with the ScrollView in Android. When I add controls to the content of my ScrollView after its been added to the visual tree, it overflows its bounds.

This problem is not occurring in iOS.

Any idea when we can expect a fix for this?

How to hide the status bar in AppCompat

$
0
0

I can't seem to do this. I created a new project with the latest pre-release (2.3.0.46-pre3) and tried the following:

NavigationPage.SetHasNavigationBar(this, false);

RequestWindowFeature(WindowFeatures.NoTitle);
Window.AddFlags(WindowManagerFlags.Fullscreen);
global::Xamarin.Forms.Forms.SetTitleBarVisibility(Xamarin.Forms.AndroidTitleBarVisibility.Never);

I still see a blue strip at the top even though its text is gone.

Viewing all 91519 articles
Browse latest View live


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