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

Data from local db is getting deleted on resuming network, without any explicit code to delete data

$
0
0

App supports offline capabilities and all data is being fetched from and saved to local SQL Lite DB. On resuming network, if the connectivity is very poor, intermittently the data from local db gets deleted. There is no explicit code to delete the data from local DB.

Has anyone of you encountered this problem? If yes, please suggest steps to avoid this


Toolbox problem in Visual Studio 2017 for xamarin

$
0
0

On xamarin forms app xaml did not support toolbox controller. All xaml controller are shown but are disabled. i tried to reset, reinstalled but nothing happened. Does xamarin forms support toolbox controller? plz, help me if anyone faced this problem and has got the solutions.

Xamarin.Forms CardsView nuget package

$
0
0

Hi all) I've released new package for Xamarin.Forms (Something like Tinder's CardsView)
Maybe, someone will be interested in it

nuget.org/packages/CardsView/ -- nuget
github.com/AndreiMisiukevich/CardView -- source and samples

Xamarin.Forms compilation error: Could not load assembly 'Xamarin.Android.Support.Compat, Version=1.

$
0
0

Error:
Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'Xamarin.Android.Support.Compat.dll'

  • VS2017
  • Xamarin.Forms 2.5.1 installed
  • Xamarin.Android.support.Compat v25.4.0.2 installed

Anyone?

Connect to a Rest web service

$
0
0

Hello,
How to connect to a rest web service from a Xamarin application ?
Thx

Beta test release app icon and name are defaults

$
0
0

I have a xamarin forms app. In the android manifest, the icon and application name are correctly set to my custom values but after downloading the beta release of the app from google play store (have set all the correct items in Google play store listing as well), the application on my android device still displays the default icon and default application name like XXX.Droid.

How to update UI after async Task in viewmodel

$
0
0

I have a xaml page with label. I want to update label after some async task. In my ViewModel constructor I set default text for my label. And create a async Task function named SomeTask().

Question 1: Where can I call SomeTask() function. Not able to call async Task function in constructor.
Question 2: How can I update Label text after async Task SomeTask() function.

    public class MyPageViewModel : ViewModelBase
    {  
        private String _selectedText;
        public String SelectedText
        {
            get { return _selectedText; }
            set {
                if (_selectedText != value)
                {
                    _selectedText = value;          
                }       
            }
        }

        public MyPageViewModel ()
        {
            _selectedText = "Welcome";   //Default text
        }

        private async Task<string> SomeTask()
        {            
            return await Task.Run(async () =>
            {
                await Task.Delay(3000); //Dummy task. It will return the status of Task.
                return "Thanks";         //Update Text       
            });         
        }
    }

System.Reflection.TargetInvocationException: Exception hasbeen thrown by the target of an invocation

$
0
0

Hi. I getting this erro when I run my application after adding the Xamarin.Forms.Maps.

I am trying to display a Map in my MapPage. I have hadded name space definitions to my XAML file.

I have and I have added Xamarin.FormsMaps.Init(this, bundle) to the Android project in the MainActivity and to the iOS project using Xamarin.FormsMaps.Init(); in the AppDelegate file.

I searched google and stackoverflow and couldn't find any useful document.

here is the MainPage.xaml code

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:local="clr-namespace:TravelRecord"
             x:Class="TravelRecord.MainPage">

    <StackLayout VerticalOptions="Center" Margin="20,0">
        <Entry Placeholder="Enter Your Email... " Keyboard="Email" x:Name="emailEntry" 
               TextColor="{StaticResource blueColor}" Text="Test"/>
        <Entry Placeholder="Enter Your Password... " TextColor="{StaticResource blueColor}"
               IsPassword="True"  x:Name="passwordEntry" Text="Test"/>
        <Button Text="Log in" x:Name="LoginButton" Clicked="LoginButton_Clicked" Margin="0,50,0,0"
                BackgroundColor="{StaticResource blueColor}" TextColor="White"/>
    </StackLayout>

</ContentPage>

and the MainPage.cs file

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;

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

        private void LoginButton_Clicked(object sender, EventArgs e)
        {
           bool emailIsNullOrEmpty =  string.IsNullOrEmpty(emailEntry.Text);
            bool passwordIsNullOrEmpty = string.IsNullOrEmpty(passwordEntry.Text);

            if (emailIsNullOrEmpty || passwordIsNullOrEmpty)
            {

            }

            else
            {

                    Navigation.PushAsync(new HomPage());
            }
        }
    }
}

from which I navigate to the MapsPage using the Login button.

here is the MapsPage.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="TravelRecord.MapPage"
             xmlns:maps="clr-namespace:Xamarin.Forms.GoogleMaps;assembly=Xamarin.Forms.GoogleMaps">

    <ContentPage.Content>
        <maps:Map />
    </ContentPage.Content>
</ContentPage>

and the MapsPage.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;

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

        private void LoginButton_Clicked(object sender, EventArgs e)
        {
           bool emailIsNullOrEmpty =  string.IsNullOrEmpty(emailEntry.Text);
            bool passwordIsNullOrEmpty = string.IsNullOrEmpty(passwordEntry.Text);

            if (emailIsNullOrEmpty || passwordIsNullOrEmpty)
            {

            }

            else
            {

                    Navigation.PushAsync(new HomPage());
            }
        }
    }
}

here MainActivity.cs of the android project:

using System;

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

namespace TravelRecord.Droid
{
    [Activity(Label = "TravelRecord", Icon = "@mipmap/icon", Theme = "@style/MainTheme", 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);
            Xamarin.FormsMaps.Init(this, bundle);

            string dataBaseName = "travelRecord.db";
            var dataBaseBath =  System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
            string fullPath = Path.Combine(dataBaseBath, dataBaseName);


            LoadApplication(new App(fullPath));
        }
    }
}

and the AppDelegate of the iOS project

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

using Foundation;
using UIKit;

namespace TravelRecord.iOS
{
    // The UIApplicationDelegate for the application. This class is responsible for launching the 
    // User Interface of the application, as well as listening (and optionally responding) to 
    // application events from iOS.
    [Register("AppDelegate")]
    public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
    {
        //
        // This method is invoked when the application has loaded and is ready to run. In this 
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();

            Xamarin.FormsMaps.Init();

            string dataBaseName = "travelRecord.db";
            var dataBaseBath =Path.Combine( System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal),"..","Library");
            string fullPath = Path.Combine(dataBaseBath, dataBaseName);



            LoadApplication(new App(fullPath));

            return base.FinishedLaunching(app, options);
        }
    }
}

I have also added this line to the AndroidManifest.xml file
<meta-data android:name="com.google.android.geo.API_KEY" android:value ="AIzaSyBXuv3VQ4-5pxLcbje-397wvmb3y6RoxsE"></meta-data>

Does anyone know how to solve this ? thanks


How to use TextView.SetAutoSizeTextTypeWithDefaults(AutoSizeTextType.Uniform) ?

$
0
0

Is it possible (and if so, how) to use TextView.SetAutoSizeTextTypeWithDefaults(AutoSizeTextType.Uniform) in a Xamarin.Forms Android custom renderer?

I am using v25.3.1 of the Xamarin.Android.Support.v4 NuGet package. When I try to use that method, I get a Java.Lang.NoSuchMethodError exception. My MainActivity subclasses FormsAppCompatActivity

How to preserve value of a List?

$
0
0

I retrieve a list but can't preserve its value.

public class PartMinMax
{
    public string PartName { get; set; }
    public string Key { get; set; }
    public int MainCount { get; set; }
    public int AltEndingCount { get; set; }
    public int MinChordID { get; set; }
    public int MaxChordID { get; set; }
}

Elsewhere...

public partial class MyPage : ContentPage
{
    List<PartMinMax> pmm { get; set; }

Further down in that class...

    public async void GetData()
    {
        int ID = 5;
        pmm = await App.TCDB.GetPartMinMaxAsync(ID);
        string sPartName = pmm[0].PartName;
        //Works fine; am able to use pmm throughout this procedure.
    }

    void UsePartMinMaxAgain()
    {
        string sPartName = pmm[0].PartName; //Fails
    }

Scalar properties, and lists created in code, will hold their value. But a list populated by a call to the database is set to null when the calling proc ends. I have tried "static" as well, to no effect. Also have tried having pmm be a static member of App.cs.

This is one of those "simple" things that can eat a whole day!

xamarin forms listview set selected item

$
0
0

Hi,
I am trying to select a row in a listview in code:

// i = new index after moving list item up
int i = ColumnMoveUP(dList, SelectedColLabel.Text);
DataView.ItemsSource = null;
DataView.ItemsSource = dList;
if (i > -1 && i < (DataView.ItemsSource as List).Count)
DataView.SelectedItem = (DataView.ItemsSource as List)[i];
this does not work.
If I change it to:
DataView.SelectedItem = (DataView.ItemsSource as List)[0];
this works? I can use any valid constant value for the index and it works but if i use an valid integer value it does not?

Detecting page orientation change for contentpages

$
0
0

Hi,

I came up with a custom content page to check if the device was rotated, my usage was I wanted to change the listview data template if the device rotated for a dashboard view.

Content page

using System;
using Xamarin.Forms;

namespace Foobar.CustomPages
{
    public class OrientationContentPage : ContentPage
    {
        private double _width;
        private double _height;

        public event EventHandler<PageOrientationEventArgs> OnOrientationChanged = (e, a) => { };

        public OrientationContentPage()
            : base()
        {
            Init();
        }

        private void Init()
        {
            _width = this.Width;
            _height = this.Height;
        }

        protected override void OnSizeAllocated(double width, double height)
        {
            var oldWidth = _width;
            const double sizenotallocated = -1;

            base.OnSizeAllocated(width, height);
            if (Equals(_width, width) && Equals(_height, height)) return;

            _width = width;
            _height = height;

            // ignore if the previous height was size unallocated
            if (Equals(oldWidth, sizenotallocated)) return;

            // Has the device been rotated ?
            if (!Equals(width, oldWidth))
                OnOrientationChanged.Invoke(this,new PageOrientationEventArgs((width < height) ? PageOrientation.Vertical : PageOrientation.Horizontal));
        }
    }
}

Enum

using System;

namespace Foobar.CustomPages
{
    public class PageOrientationEventArgs: EventArgs
    {
        public PageOrientationEventArgs(PageOrientation orientation)
        {
            Orientation = orientation;
        }

        public PageOrientation Orientation { get; }
    }

    public enum PageOrientation
    {
        Horizontal = 0,
        Vertical = 1,
    }
}

Usage

using System;
using System.Diagnostics;
using Foobar.CustomPages;
using Xamarin.Forms.Xaml;

namespace Foobar.Views
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class HomePagePhone : OrientationContentPage
    {
        public HomePagePhone()
        {
            InitializeComponent();
            OnOrientationChanged += DeviceRotated;
        }

        private void DeviceRotated(object s, PageOrientationEventArgs e)
        {

            switch (e.Orientation)
            {
                case PageOrientation.Horizontal:
                    break;
                case PageOrientation.Vertical:
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }
            Debug.WriteLine(e.Orientation.ToString());
        }
    }
}

Seems to work okay on hardware, tested with Forms 2.3.3.180 on iPhone6, IPad, Sansumg S6, S2 Tablet and UWP on a nokia 650 lumia.

Might be useful for someone but would be good if it was added to the Forms framework, I'll add a new idea on the evolution forms if there's interest and post up any issues.

@ClintStLaurent @DavidOrtinau @PierceBoggan

Error when binding to a single property of a single item of a collection

$
0
0

When I try to bind to a property of an item in my collection, I get:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.

My Code:

<Label Text="{Binding MyCollection[0].Name}" Grid.Row="5"/>

Any suggestions?

Coming from Native - Please tell me what to expect

$
0
0

Hey there guys, I am coming from native and already developed my first app in Xamarin. I programmed the Android and iOS separately but on the same project with some shared code.
Things that were hard to do:
1. iPhone adaptive to iPad and other iPhone versions. I know it can be done through constraints but it didn't work out well for me.
2. Design each platform a separate Design and coding.

My question is:
What is different? Is the fact I'm coming from Native is a good start? I have a project to start now, and I think to go with Xamarin Forms with it. Is it easier than Native? I'm going to take Udemy course on that anyway, but please share your thoughts! It's important.

Program crashing and freezing when calling GetAsync from TextChanged event handler

$
0
0

Attempting to make a simple movie searching app using the moviedb api. When I hard code my search term and call GetAsync in the OnAppearing method it works perfectly. When I attempt to call it in a TextChanged event handler and passing the users search string to the query, the app hangs and never gets beyond the call to GetAsync. Here is my code:

``public partial class MovieSearch : ContentPage
{
private HttpClient _client = new HttpClient();
private const string URL = "movie?api_key=9d9cb312367f0f2deaa383f9a8fd64d2&query=";//not the full link

public MovieSearch()
{

    InitializeComponent();
}

async void SearchBar_TextChanged(object sender, Xamarin.Forms.TextChangedEventArgs e)
{
    if (e.NewTextValue == null)
        return;
    if (String.IsNullOrEmpty(e.NewTextValue))
        return;

    var response = await _client.GetAsync(URL + e.NewTextValue);
    var content = await response.Content.ReadAsStringAsync();
    var root = JsonConvert.DeserializeObject<RootObject>(content);
    movieListView.ItemsSource = root.results;
    movieListView.IsVisible = root.results.Any();
    label.IsVisible = !movieListView.IsVisible;
}

}``


Handling Event of child in ListView

$
0
0

I have a ListView with custom ViewCell, inside that ViewCell i have a label that i have attached a TapGestureRecognizer to so that i can handle the event when the user presses that label differently then when they just select the entire Cell. However I have noticed that when I get my event one of the Properties which I (think) have bound to a string value from a DataContainer class is always null. I am not sure if this is because my binding is incorrect or if I need to push my Event handling up to the parent? Code below.

This is my ViewCell

namespace Exchange.ViewModels
{
    public class PersonalOrderViewCell : ViewCell
    {
        public static readonly BindableProperty GUIDProperty = BindableProperty.Create("GUID", typeof(string), typeof(DataContainer), null);
        public string GUID
        {
            get { return (string)GetValue(GUIDProperty);}
            set { SetValue(GUIDProperty, value); }
        }
        public EventArgs e = null;
        public event ButtonClickEvent ClickListener;
        public delegate void ButtonClickEvent(object m, EventArgs e);
        public PersonalOrderViewCell(ButtonClickEvent Listener)
        {
            ClickListener += Listener;
            StackLayout wrapper = new StackLayout();
            Grid horizontal = new Grid
            {
            };

            horizontal.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) });
            horizontal.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
            horizontal.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
            horizontal.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
            horizontal.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
            horizontal.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });

            Label Amount = new Label { HorizontalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.Gray};
            Label Price = new Label { HorizontalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.Gray };
            Label Time = new Label { HorizontalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.Gray };
            Label Status = new Label { HorizontalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.Gray,};

            //Bindings
            Amount.SetBinding(Label.TextProperty, "Amount");
            Amount.SetBinding(Label.TextColorProperty, "Color");
            Price.SetBinding(Label.TextProperty, "Price");
            Price.SetBinding(Label.TextColorProperty, "Color");
            Time.SetBinding(Label.TextProperty, "Time");
            Time.SetBinding(Label.TextColorProperty, "Color");
            Status.SetBinding(Label.TextProperty, "Status");
            Status.SetBinding(Label.TextColorProperty, "Color");
            var tgr = new TapGestureRecognizer();
            tgr.Tapped += OnButtonClicked;
            Status.GestureRecognizers.Add(tgr);

            //Properties
            wrapper.BackgroundColor = Color.White;

            horizontal.Children.Add(Amount,0,0);
            horizontal.Children.Add(Price,1,0);
            horizontal.Children.Add(Time,3,0);
            horizontal.Children.Add(Status, 5, 0);

            wrapper.Children.Add(horizontal);

            View = wrapper;
        }

        void OnButtonClicked(object sender, EventArgs e)
        {
            string hold = GUID;
            if (ClickListener != null)
                ClickListener(sender, e);
        }
    }

This is the Container Class

namespace Exchange.Data
{
    class DataContainer : INotifyPropertyChanged
    {
        private bool _sell;
        public string Amount { get; set; }
        public string Color { get; private set; }
        public string Price { get; set; }
        public string MyAmount { get; set; }
        public string Time { get; set; }
        public string Status { get; set; }
        private string _GUID;
        public string GUID
        {
            get { return _GUID; }
            set
            {
                _GUID = value;
                OnPropertyChanged("GUID");
            }
        }
        public bool Sell
        {
            get { return _sell; }
            set
            {
                _sell = value;
                if (_sell)
                {
                    Color = "Red";
                }
                else
                {
                    Color = "Green";
                }
            }
        }

This is the Page that I am using it in

namespace Exchange.Pages
{
    public class PersonalOrderPage
    {
        public StackLayout Layout { get; private set; }

        public PersonalOrderViewCell.ButtonClickEvent OrderButtonHandler { get; set; }
        public EventHandler<SelectedItemChangedEventArgs> OrderSelectedHandler { get; set; }
        public EventHandler CancelAllHandler { get; set; }

        private ListView list;

        public PersonalOrderPage(PersonalOrderViewCell.ButtonClickEvent OrderButtonHandler, EventHandler<SelectedItemChangedEventArgs> OrderSelectedHandler, 
            EventHandler CancelAllHandler)
        {
            this.OrderButtonHandler = OrderButtonClicked;
            this.OrderSelectedHandler = OrderSelectedHandler;
            this.CancelAllHandler = CancelAllHandler;

            SetLayout();
        }

        private void OrderButtonClicked(object m, EventArgs e)
        {
            //TODO: get GUID from this method so I can update list
        }

        private void SetLayout()
        {
            StackLayout wrapper = new StackLayout();
            list = new ListView();
            list.HasUnevenRows = true;
            Grid titlesGrid = new Grid { };
            ObservableCollection<DataContainer> orders = new ObservableCollection<DataContainer>();

            //TODO: change this to a image 
            //Cancel All Button
            Button cancelAllButton = new Button { Text = "Cancel All", HorizontalOptions = LayoutOptions.FillAndExpand, FontSize = 8 };
            cancelAllButton.Clicked += CancelAllHandler;

            //Title Grid
            titlesGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) });
            titlesGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
            titlesGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
            titlesGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
            titlesGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
            titlesGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
            titlesGrid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
            titlesGrid.Children.Add(new Label { Text = "Amount" }, 0, 0);
            titlesGrid.Children.Add(new Label { Text = "Price" }, 2, 0);
            titlesGrid.Children.Add(new Label { Text = "Time" }, 4, 0);
            titlesGrid.Children.Add(cancelAllButton, 5, 0);

            //Set to custom view cell
            list.ItemTemplate = new DataTemplate(() => new PersonalOrderViewCell(OrderButtonHandler));

            orders.Add(new DataContainer { Amount = "1.0", Price = "10", Time = "9:00pm", Status = "open", Sell = true, GUID = "01010" });
            orders.Add(new DataContainer { Amount = "1.0", Price = "70.0", Time = "9:00pm", Status = "open", Sell = false, GUID = "01010" });
            orders.Add(new DataContainer { Amount = "1.0", Price = "200", Time = "9:00pm", Status = "open", Sell = true, GUID = "01010" });

            list.ItemsSource = orders;
            list.ItemSelected += OrderSelectedHandler;

            wrapper.Children.Add(titlesGrid);
            wrapper.Children.Add(list);

            Layout = wrapper;
        }
    }

Displaying user's FirstName and Last Name

$
0
0

Hi Xamarin Forum how to display user's First and Last Name upon logging in my xamarin.forms app for further explanation here is the scenario

I have an app made out of xamarin.forms that consist of registration and login
so upon registration I have to login then upon logging in my next interface is a MasterDetailPage on the sliding box on the left side I will see for example You are log in as Magnvm

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 :)

Local Notification with custom sound

Handling events in a controltemplate

$
0
0

I'm trying to handle an event on a control in a ControlTemplate. I'm using the ControlTemplate as a way of creating a custom navigation page. I've design a few controls within the header in the ControlTemplate and I've added a TapGesture to my back button image which routes to a method in the page class. I've tried doing this multiple ways but I simply can't get it to fire an event. Firstly, I tried adding the ControlTemplate to the App.xaml file with an event declared in App.xaml.cs - no event fired.

I then tried creating another ContentPage with its own ControlTemplate with a TapGesturizer declared in that class. No event fired. I then tried getting hold of the Image control in the constructor of the page (which I managed to do), so I could programmatically add the Tap Gesturizer. No event fired.

Does anyone have any idea of how to handle an event defined within a ControlTemplate? Ben on this for 3 days now and one step short of pulling my hair out!

Thanks

Viewing all 91519 articles
Browse latest View live


Latest Images

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