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

How to set DataPicker Date in code?

$
0
0

DatePicker's Date property has both get and set methods but setting doesn't work or invoke DateSelected method tho. Here is my code:

        DateTime yesterday = DateTime.Today.AddDays(-1);
        datePicker.Date = yesterday;

So how can I set that in code?


Xamarin UWP Map is blank

$
0
0

my maps on UWP is blank, just a black screen with the zoom buttons. i have given capabilities, put the init codes in the UWP app.xaml.cs.
HELP

How to create a bindable view property inside a custom control

$
0
0

Hi guys,

I am trying to create a view that can contain another view but for unknown reason, I get weird behaviours!
This is what I have so far:

CustomView.xaml:

<?xml version="1.0" encoding="UTF-8"?>
<Grid xmlns="http://xamarin.com/schemas/2014/forms" 
      xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
      x:Class="AppTest.CustomView"
      HorizontalOptions="FillAndExpand"
      VerticalOptions="FillAndExpand"
      BackgroundColor="Aqua">
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="1*" />
        <ColumnDefinition Width="1*" />
        <ColumnDefinition Width="1*" />
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="1*" />
        <RowDefinition Height="1*" />
        <RowDefinition Height="1*" />
    </Grid.RowDefinitions>

    <Label Grid.Column="0"
           Grid.Row="0"
           Grid.ColumnSpan="3"
           BackgroundColor="Chartreuse"
           Text="fdtyu7osrtjsrdytj"/>
    <ContentView x:Name="ViewContent"
                 Grid.Column="1"
                 Grid.Row="1"
                 HorizontalOptions="FillAndExpand"
                 VerticalOptions="FillAndExpand"
                 BackgroundColor="Coral"/>
</Grid>

CustomView.xaml.cs:

using System.Diagnostics;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace AppTest
{
    [ContentProperty(nameof(Content))]
    [XamlCompilation(XamlCompilationOptions.Skip)]
    public partial class CustomView : Grid
    {
        public CustomView()
        {
            Debug.WriteLine(nameof(InitializeComponent) + " started!");
            InitializeComponent();
            Debug.WriteLine(nameof(InitializeComponent) + " ended");
        }

        #region Content (Bindable Xamarin.Forms.View)

        /// <summary>
        /// Manages the binding of the <see cref="Content"/> property
        /// </summary>
        public static readonly BindableProperty ContentProperty
            = BindableProperty.Create(propertyName: nameof(Content)
                                    , returnType: typeof(Xamarin.Forms.View)
                                    , declaringType: typeof(CustomView)
                                    , defaultBindingMode: BindingMode.OneWay
                                    , propertyChanged: Content_PropertyChanged
                                    );

        public Xamarin.Forms.View Content { get => (Xamarin.Forms.View)GetValue(ContentProperty); set => SetValue(ContentProperty, value); }

        private static void Content_PropertyChanged(BindableObject bindable, object oldValue, object newValue)
        {
            var control = (CustomView)bindable;
            var value = (View)newValue;

            if (control.ViewContent == null) Debug.WriteLine("ViewContent null!");
            if (ReferenceEquals(newValue, control)) Debug.WriteLine("New value is myself!!!!");
            if (newValue is Label label)
            {
                Debug.WriteLine("Added label with text: " + label.Text);
                if (label.Text.Equals("abc")) control.ViewContent.Content = (View)newValue;
            }
        }

        #endregion Content (Bindable Xamarin.Forms.View)
    }
}

CustomPage.xaml:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="AppTest.CustomPage"
             xmlns:local="clr-namespace:AppTest">
    <local:CustomView x:Name="view">
        <Label Text="abc"/>
    </local:CustomView>
</ContentPage>

That's it. The app just launches a CustomPage.
I have a bunch of weird behavior when launching the windows emulator API 19.
Depending on the XamlCompilationOptions, I get different behaviours but always an Aqua coloured page with no labels as a final result :

  • For Skip:

    [0:] InitializeComponent started!
    [0:] ViewContent null!
    [0:] Added label with text: fdtyu7osrtjsrdytj
    [0:] ViewContent null!
    [0:] InitializeComponent ended
    [0:] Added label with text: abc

  • For Compile:

    [0:] InitializeComponent started!
    [0:] Added label with text: fdtyu7osrtjsrdytj
    [0:] InitializeComponent ended
    [0:] Added label with text: abc

I can't get my mind around it! It should basically say InitializeComponent started=>ended then Added label with text: abc.
The project settings are: .Net Standard 1.4 core library, Xamarin.Forms nuget v2.5.0.280555, Xamarin.Android.Support nuget v25.4.0.2, Windows emulator for android.
Can anyone reproduce this behaviour and explain this to me or have an idea, please?

Cheers,

G.

How to open default contacts app in xamrin forms?

$
0
0

How to open default contacts app in xamrin forms?

How to recover lost keystore

$
0
0

Hi Guys,

i have published some apps in Google Play store. Recently i have upgraded my OS and VS. Now when i go to project i am not able to see my keystore files. Please help me to resolve this issue. How to get those keystore files or i can create new keystore file and can i publish that apk as new version? I don't want publish new app.

REST APIs are working in postman and browser but not working when applied on project.

$
0
0

Hi,

I have a strange problem.

I am working on a xamarin forms app. My REST APIs are working in postman and browsers, but when I apply these REST APIs to project they are not working. Already run many REST APIs in the project, but don't know why it is not working now. I am using the following code:

            HttpClient client = new HttpClient();
            Debug.WriteLine("Enter here");
            var siteIdResponse = await client.GetAsync(My REST API);
            Debug.WriteLine("siteIdResponse:>" + siteIdResponse);
            if (siteIdResponse.IsSuccessStatusCode)
            {
                   //codes
            }

Output:

[0:] Enter here
Thread started:  #7
07-09 18:48:10.231 D/Mono    (21753): Image addref Mono.Security[0xb8ebcc80] -> Mono.Security.dll[0xb8e9be58]: 2
07-09 18:48:10.231 D/Mono    (21753): Prepared to set up assembly 'Mono.Security' (Mono.Security.dll)
07-09 18:48:10.231 D/Mono    (21753): Assembly Mono.Security[0xb8ebcc80] added to domain RootDomain, ref_count=1
07-09 18:48:10.232 D/Mono    (21753): AOT: image 'Mono.Security.dll.so' not found: dlopen failed: library "/mnt/asec/com.pagematics.Business_App-1/lib/arm/libaot-Mono.Security.dll.so" not found
07-09 18:48:10.233 D/Mono    (21753): AOT: image '/usr/local/lib/mono/aot-cache/arm/Mono.Security.dll.so' not found: dlopen failed: library "/mnt/asec/com.pagematics.Business_App-1/lib/arm/libaot-Mono.Security.dll.so" not found
07-09 18:48:10.233 D/Mono    (21753): Config attempting to parse: 'Mono.Security.dll.config'.
07-09 18:48:10.234 D/Mono    (21753): Config attempting to parse: '/usr/local/etc/mono/assemblies/Mono.Security/Mono.Security.config'.
07-09 18:48:10.234 D/Mono    (21753): Assembly Ref addref System[0xb851f108] -> Mono.Security[0xb8ebcc80]: 2
07-09 18:48:10.234 D/Mono    (21753): Assembly Ref addref Mono.Security[0xb8ebcc80] -> mscorlib[0xb82cfaf0]: 58
Loaded assembly: Mono.Security.dll [External]
07-09 18:48:10.297 D/Mono    (21753): Assembly Ref addref System.Net.Http[0xb8e80b50] -> System.Core[0xb844e178]: 7
07-09 18:48:10.388 D/Mono    (21753): Assembly Ref addref Mono.Android[0xb834d360] -> System[0xb851f108]: 15
07-09 18:48:10.790 I/Choreographer(21753): Skipped 100 frames!  The application may be doing too much work on its main thread.
Thread started: <Thread Pool> #8
Thread started: <Thread Pool> #9
Thread finished: <Thread Pool> #5
The thread 'Unknown' (0x5) has exited with code 0 (0x0).
Thread finished: <Thread Pool> #9
The thread 'Unknown' (0x9) has exited with code 0 (0x0).
Thread finished: <Thread Pool> #2
Thread started: <Thread Pool> #10
The thread 'Unknown' (0x2) has exited with code 0 (0x0).

Thanks in advance :)

Editor inside Scrollview not scrolling.

$
0
0

I have an editor control inside a StackLayout which is inside a ScrollView. I can scroll all the controls but when I go into an editor control if the text superpasses the editor's height I cannot scroll into the previously added text. So if the line goes out of the visible part of the editor I cannot go back to it, the only way is to erase the whole text and write something up again. So basically trying to scroll inside the editor results in scrolling out the controls inside the scrollview but I just want to scroll inside the editor. By the way editors are added to the stacklayout dynamically.

<ScrollView>
                <StackLayout x:Name="content" Orientation="Vertical"></StackLayout>
            </ScrollView>

Any suggestions?

Thank you.

Issue with Creating Card Connect SDK Xamarin binding Library for iOS

$
0
0

I created a Xamarin Binding Library project to map the card connect sdk for ios and was successful in it. But when I try to create a sample project to test the function its giving me the following error.

Could not create an native instance of the type 'CardConnect.CCCPaymentRequest': the native class hasn't been loaded. It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.

You can find the Objective C & Swift sample and documentation in the link below https://developer.cardconnect.com/mobile-sdks#iOS

Also I am trying to bind an Objective C framework library


How to get the children of a ContentPage or in a View?

$
0
0

Hello,

Is there a way to get the children (controls) contained in a ContentPage or in a View?

Thanks in advance!!

How to add SearchBar and NavigationPage.PrefersLargeTitles IOS using xaml?

$
0
0

Hello! How to add SearchBar and NavigationPage.PrefersLargeTitles IOS using xaml?

Issue creating APK in VS 2017

$
0
0

Hi,
My Xamarin.Forms app works in debug mode, but if I build in release mode and I try to create an APK from VS 2017, it doesn't work.
The build process succeeded but the APK is not yet created.
My Xamarin.Forms version is 3.4.0.1008975 and my VS is up to date.

Target Android version is 9.0.

Here above the application logs:

Xamarin.VisualStudio.Publishing.ArchiveManager|Error|0|System.NotSupportedException: This type of CollectionView does not support changes to its SourceCollection from a thread different from the Dispatcher thread.
at System.Windows.Data.CollectionView.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
at System.Collections.ObjectModel.ObservableCollection1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at Microsoft.VisualStudio.PlatformUI.HierarchyItem.HierarchyItemCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ObservableCollection1.InsertItem(Int32 index, T item)
at System.Collections.ObjectModel.Collection1.Add(T item) at Microsoft.VisualStudio.PlatformUI.HierarchyItem.AppendChildren(IVsHierarchy hierarchy, UInt32 itemID, List1 appendedChildren)
at Microsoft.VisualStudio.PlatformUI.HierarchyItem.FillChildren()
at Microsoft.VisualStudio.PlatformUI.HierarchyItem.get_InternalChildren()
at Microsoft.VisualStudio.PlatformUI.HierarchyItem.get_Children()
at Clide.SolutionExplorerNode.get_Nodes() in E:\A_work\184\s\src\Clide\Solution\SolutionExplorerNode.cs:line 166
at Clide.ITreeNodeExtensions.<>c.b__1_0(ISolutionExplorerNode x) in E:\A_work\184\s\src\Clide.Interfaces\Extensions\ITreeNodeExtensions.cs:line 33
at Traverser.d__21.MoveNext() in E:\A\_work\184\s\src\Clide.Interfaces\Extensions\Traverser.cs:line 70 at System.Linq.Enumerable.<OfTypeIterator>d__951.MoveNext()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Clide.AndroidClideExtensions.GetAndroidResources(IProjectNode projectNode) in E:\A_work\293\s\src\Core\VisualStudio.Android\ProjectSystem\Extensions.cs:line 128
at Xamarin.VisualStudio.Android.Publishing.AndroidArchiveToolsService.CreateParameters(IProjectNode project) in E:\A_work\293\s\src\Core\VisualStudio.Android\Services\Publishing\Archival\AndroidArchiveToolsService.cs:line 186
at Xamarin.VisualStudio.Android.Publishing.AndroidArchiveToolsService.ArchiveAsync(IProjectNode project, IProgressReport progress, CancellationToken cancellationToken) in E:\A_work\293\s\src\Core\VisualStudio.Android\Services\Publishing\Archival\AndroidArchiveToolsService.cs:line 113
at Xamarin.VisualStudio.Publishing.ArchivableProjectBase.d__8.MoveNext() in E:\A_work\293\s\src\Core\VisualStudio.Publishing\Archival\ArchivableProjectBase.cs:line 30
--- End of stack trace from previous location where exception was thrown ---

Help needed making a custom frame control with SkiaSharp

$
0
0

I want to make a new frame control, that is just like the Xamarin Forms Frame control. I want to use SkiaSharp Canvas as the background so I can draw different things in the background of the frame.

To start, I just want to replicate the default Frame class but allow a gradient fill. The problem I am having is how to implement the "Frame" part of it, meaning, how to add the content view. I have the gradient working beautifully.

In xaml, I would use it like this:

    <custom:GradientFrame  VerticalOptions="FillAndExpand"
                        HorizontalOptions="FillAndExpand"
                        OuterBackgroundColor="Transparent"
                        InnerBackgroundColorStart="DarkBlue"
                        InnerBackgroundColorEnd="LightBlue"
                        BorderColor="Black"
                        BorderWidth="2"
                        BorderRadius="25" 
                        FillOrientation="Vertical">

        <StackLayout Orientation="Vertical">

            <Label Text="Sample Text 1" />

            <Label Text="Sample Text 2" />

        </StackLayout>

    </custom:GradientFrame >

Since SkiaSharp is cross platform, I shouldn't need to write a custom renderer. I can use a SKCanvasView to draw my background frame, but not sure how to add the child view, i.e. the frame content.

Can someone point me in the right direction?

Here's my control so far ...

public class GradientFrame : SKCanvasView
{
    #region Outer
    public static readonly BindableProperty OuterBackgroundColorProperty =
        BindableProperty.Create("OuterBackgroundColor", 
            typeof(Color), 
            typeof(GradientFrame), 
            Color.Green, 
            propertyChanged: (currentControl, oldValue, newValue) =>
            {
                var thisControl = currentControl as GradientFrame;
                thisControl.OuterBackgroundColor = (Color)newValue;
            });

    public Color OuterBackgroundColor
    {
        get { return (Color)GetValue(OuterBackgroundColorProperty); }
        set
        {
            SetValue(OuterBackgroundColorProperty, value);
            thisOuterBackgroundColor = value.ToSKColor();
            InvalidateSurface();
        }
    }

    private SKColor thisOuterBackgroundColor;
    #endregion

    #region Inner Start
    public static readonly BindableProperty InnerBackgroundColorStartProperty =
        BindableProperty.Create("InnerBackgroundColorStart", 
            typeof(Color), 
            typeof(GradientFrame),
            Color.Red,
            propertyChanged: (currentControl, oldValue, newValue) =>
            {
                var thisControl = currentControl as GradientFrame;
                thisControl.InnerBackgroundColorStart = (Color)newValue;
            });

    public Color InnerBackgroundColorStart
    {
        get { return (Color)GetValue(InnerBackgroundColorStartProperty); }
        set
        {
            SetValue(InnerBackgroundColorStartProperty, value);
            thisInnerBackgroundColorStart = value.ToSKColor();
            InvalidateSurface();
        }
    }

    private SKColor thisInnerBackgroundColorStart;
    #endregion

    #region Inner End
    public static readonly BindableProperty InnerBackgroundColorEndProperty =
        BindableProperty.Create("InnerBackgroundColorEnd",
            typeof(Color),
            typeof(GradientFrame),
            Color.Red,
            propertyChanged: (currentControl, oldValue, newValue) =>
            {
                var thisControl = currentControl as GradientFrame;
                thisControl.InnerBackgroundColorEnd = (Color)newValue;
            });

    public Color InnerBackgroundColorEnd
    {
        get { return (Color)GetValue(InnerBackgroundColorEndProperty); }
        set
        {
            SetValue(InnerBackgroundColorEndProperty, value);
            thisInnerBackgroundColorEnd = value.ToSKColor();
            InvalidateSurface();
        }
    }

    private SKColor thisInnerBackgroundColorEnd;
    #endregion

    #region Border Color
    public static readonly BindableProperty BorderColorProperty =
        BindableProperty.Create("BorderColor",
            typeof(Color),
            typeof(GradientFrame),
            Color.Blue,
            propertyChanged: (currentControl, oldValue, newValue) =>
            {
                var thisControl = currentControl as GradientFrame;
                thisControl.BorderColor = (Color)newValue;
            });

    public Color BorderColor
    {
        get { return (Color)GetValue(BorderColorProperty); }
        set
        {
            SetValue(BorderColorProperty, value);
            thisBorderColor = value.ToSKColor();
            InvalidateSurface();
        }
    }

    private SKColor thisBorderColor;
    #endregion

    #region Border Width
    public static readonly BindableProperty BorderWidthProperty =
        BindableProperty.Create("BorderWidth",
            typeof(int),
            typeof(GradientFrame),
            1,
            propertyChanged: (currentControl, oldValue, newValue) =>
            {
                var thisControl = currentControl as GradientFrame;
                thisControl.BorderWidth = (int)newValue;
            });

    public int BorderWidth
    {
        get { return (int)GetValue(BorderWidthProperty); }
        set
        {
            SetValue(BorderWidthProperty, value);
            InvalidateSurface();
        }
    }
    #endregion

    #region BorderRadius
    public static readonly BindableProperty BorderRadiusProperty =
        BindableProperty.Create("BorderRadius",
            typeof(float),
            typeof(GradientFrame),
            25f,
            propertyChanged: (currentControl, oldValue, newValue) =>
            {
                var thisControl = currentControl as GradientFrame;
                thisControl.BorderRadius = (float)newValue;
            });

    public float BorderRadius
    {
        get { return (float)GetValue(BorderRadiusProperty); }
        set
        {
            SetValue(BorderRadiusProperty, value);
            InvalidateSurface();
        }
    }
    #endregion

    #region Fill Orientation
    public enum FillOrientations
    {
        Horizontal,
        Vertical
    }

    public static readonly BindableProperty FillOrientationProperty =
        BindableProperty.Create("FillOrientation",
            typeof(FillOrientations),
            typeof(GradientFrame),
            FillOrientations.Horizontal,
            propertyChanged: (currentControl, oldValue, newValue) =>
            {
                var thisControl = currentControl as GradientFrame;
                thisControl.FillOrientation = (FillOrientations)newValue;
            });

    public FillOrientations FillOrientation
    {
        get { return (FillOrientations)GetValue(FillOrientationProperty); }
        set
        {
            SetValue(FillOrientationProperty, value);
            InvalidateSurface();
        }
    }
    #endregion

    public GradientFrame()
    {
    }

    protected override void OnPaintSurface(SKPaintSurfaceEventArgs e)
    {
        base.OnPaintSurface(e);

        SKImageInfo info = e.Info;
        SKSurface surface = e.Surface;
        SKCanvas canvas = surface.Canvas;

        canvas.Clear(thisOuterBackgroundColor);

        int width = info.Width;
        int height = info.Height;

        SKRect rect = new SKRect
        {
            Left = 1 + BorderWidth,
            Top = 1 + BorderWidth,
            Right = width - 1 - BorderWidth,
            Bottom = height - 1 - BorderWidth
        };

        SKPaint paintBorder = new SKPaint
        {
            Style = SKPaintStyle.Stroke,
            StrokeWidth = 3,
            Color = thisBorderColor,
            IsAntialias = true
        };
        canvas.DrawRoundRect(rect, BorderRadius, BorderRadius, paintBorder);

        var colors = new SKColor[] { thisInnerBackgroundColorStart, thisInnerBackgroundColorEnd };
        SKShader shader = null;
        if (FillOrientation.Equals(FillOrientations.Vertical))
        {
            shader = SKShader.CreateLinearGradient(
                new SKPoint(0, 0),
                new SKPoint(0, 100),
                colors,
                null,
                SKShaderTileMode.Clamp);
        }
        else
        {
            shader = SKShader.CreateLinearGradient(
                new SKPoint(0, 0),
                new SKPoint(100, 0),
                colors,
                null,
                SKShaderTileMode.Clamp);
        }

        var paintFill = new SKPaint()
        { 
            Shader = shader,
            Style = SKPaintStyle.Fill,
            IsAntialias = true
        };

        canvas.DrawRoundRect(rect, BorderRadius, BorderRadius, paintFill);
    }       

}

Binding stackLayout's visible property in a list with Toggle switch

$
0
0

I have a toggle button and list which contains stack layout in it. Toggle(Switch) and List View are declared in Xaml file where list's Data-cell is generated programatically in cs file. I need to hide/show this stack layout in the list based on the toggle switch

Xaml code:

`<Switch  IsToggled="{Binding IsToggled, Mode=TwoWay}" Grid.Row = "0" Grid.Column = "1" HorizontalOptions = "Start" Margin = "10,8,8,0"></Switch>

<ListView x:Name="lvItemSigns" HasUnevenRows="True" SeparatorVisibility="Default" SeparatorColor="Gray">`

cs file code:

lvItemSigns.ItemTemplate = new DataTemplate(typeof(DataCell));
lvItemSigns.ItemsSource = VM.ItemSignsList;

    `class DataCell : ViewCell
    {
Label label;
 public DataCell()
{
    // has grid
    var label = new Label();
        label.TextColor = Color.Black;
        label.Margin = 4;
        label.Text = "test";
        grid.Children.Add(label, 2, 1);
        label.SetBinding(Label.IsVisibleProperty, new Binding("BindingContext.IsToggled", BindingMode.TwoWay, new BooleanConverter(), null, null, "cs-          file_name"));

grid.Children.Add(stackLayout, 0, 3);

        grid.Margin = new Thickness(8,0,0,0);
        View = grid;
}
}`

In ViewModel:

public bool _IsToggled; public bool IsToggled { get { return _IsToggled; } set { _IsToggled= value; OnPropertyChanged("_IsToggled"); } } public ItemSignsTabViewModel() { ItemSignsList = new ObservableCollection<TicketItem>(daItemSign.GetItemSigns(Ticket.MobileID)); }
~~~~
I'm binding the visible property to Label but still I can see the label all the time (when toggle switch is on or off).

I know I'm doing something wrong. Any help?

How to change the state of a switch with the change of the text of a Label?

$
0
0

As mentioned, I want to toggle the state of a Switch based on the text value changes of a label, i.e. if the text value goes from 0 to 1, switch will change the state from "True" to "False".
I am thinking applying a trigger on Label that will control the state of the switch, but not sure what kind of trigger I should use. Any help is appreciated.

emmanpogi23

$
0
0

Hi, this error always pop out: Unhandled Exception: System.TypeLoadException: Could not resolve type with token 01000007 from typeref (expected class 'Xamarin.Forms.Xaml.XamlResourceIdAttribute' in assembly 'Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null') occurred. Is there somebody who can help me to solve this problem? Thanks :smile:


ListView only showing object name

$
0
0

I'm about to pull my hair out. I have a dozen or so other ListViews that work just fine. I can't figure out what is different about this one. I initially had it more complicated, so I started pairing it down do see if I could isolate the issue, no luck.

XAML:

<ListView ItemsSource="{Binding ItemObsCollection, Mode=OneWay}" 
                      VerticalOptions="FillAndExpand" 
                      HasUnevenRows="true"   
                      IsPullToRefreshEnabled="False" 
                      IsGroupingEnabled="True"
                      CachingStrategy="RecycleElement" 
                      BackgroundColor="{DynamicResource accentColor}">
                <ListView.ItemTemplate>
                    <DataTemplate>

                        <ViewCell>

                            <Label Text="{Binding JobNumber}"/>
            </ViewCell>

                    </DataTemplate>
                </ListView.ItemTemplate>
</ListView>

ViewModel:

private ObservableCollection<LabeledEquipmentStatusPost> _itemObsCollection;
    public ObservableCollection<LabeledEquipmentStatusPost> ItemObsCollection
    {
        get => _itemObsCollection;
        set
        {
            if (_itemObsCollection == value) return;
            _itemObsCollection = value;
            OnPropertyChanged();
        }
    }

LabeledEquipmentStatusPost is derived from EquipmentStatusPost and you guessed it, adds a field that labels it. EquipmentStatusPost has an Int field named JobNumber

ActivityIndicator in Stacklayout show error with Invalid arguments

$
0
0

Dear All.
I am new to this forum and I don't know how to post question. I opened discusstion also for this and again I am asking this question.

Please help me in this regards. I get following error in .cs file when I add ActivityIndicator to Stacklayout.
It shows me red line with msg Argument 1: cannot not convert from .ActivityIndicator to Xamarin.Forms.Views.
Below is my code
ActivityIndicator ai = new ActivityIndicator() { IsVisible = true };
StackLayout sl = new StackLayout() {
Spacing = 0,
Margin = new Thickness(0, 0, 0, 0),
Padding = new Thickness(0, 0, 0, 0),
Children = { ai, periodgrid } // error here. Red line appears under ai
};
Thanks and best regards,

Is it possible to load resx file on Runtime dynamically?

$
0
0

If i download resx file as string from remote, is it possible to load on Runtime dynamically? Similar to LoadXaml option that we can load xaml from string? there is ResourceLoader but I am not sure if it related and if yes, how to use it?

Could someone help me how to create a ipa file from visual studio 2017 MAC

$
0
0

I am new to xamarin forms and need some guidance creating an inhouse app IPA file to host on our company portal

Token 01000007 Problem

$
0
0

Hi, this error always pop out: Unhandled Exception: System.TypeLoadException: Could not resolve type with token 01000007 from typeref (expected class 'Xamarin.Forms.Xaml.XamlResourceIdAttribute' in assembly 'Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null') occurred. Is there somebody who can help me to solve this problem? Thanks :smile:

Viewing all 91519 articles
Browse latest View live


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