When ItemDisappearing event is fired
When ItemDisappearing event is fired
How to apply animation in ItemAppearing on Content Page in Xamarin Forms
I need to apply some animation in Item Appearing on the ListView.
I need sample code.
ScrolView : scrolling to Top or Bottom
Am using xamarin forms , page which contain scrollview . how to know the page is scrolling to TOP or BOTTOM
Exception when using e.Result in Xamarin Forms
Hello, I have an ASMX Web Service and an Xamarin Forms Cross Platform application, in the web service i have this:
[WebMethod]
string GetMessage()
{
return "Working perfectly!";
}
and in the MainPage.xml i have a label named lbl1 and in the MainPage.xml.cs i have this code:
WebService.WebService1SoapClient client = new WebService.WebService1SoapClient();
client.GetMessageAsync();
client.GetMessageCompleted += Client_GetMessageCompleted;
}
private void Client_GetMessageCompleted(object sender, WebService.GetMessageCompletedEventArgs e)
{
Xamarin.Forms.Device.BeginInvokeOnMainThread(() =>
{
lbl1.Text = e.Result.ToString();
});
}
By doing this i get the following exception:
Unhandled Exception:
System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid. Check InnerException for exception details. occurred
work with WSDL service - why?
Good day for all!
WSorry for my bad english, but I hope you anderstand me...
I`m new for Xamarin developer... and I try call web service for login... but have a error - System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid. Check InnerException for exc…
I try do all as (video in spoiler)
https / www. youtube. com / watch ?v= vSxkOuBb8YY
but have a error when press login button ...
my web service - deployed on server on my work example: http / servername. company. local/ MobileService/ WebService.asmx?wsdl - it`s OK and if test it - all work, but not in android emulator (I use VS2017 Community with Xamarin 4.7.10.22 - all default)...
One what I do - change CSPROJ TargetFrameworkProfile to Profile78 (for adding Web references)
And that is all... got Error...
BUT! If I call http / www. webservicex. net/ country. asmx?wsdl - THIS WORK!!!
Comment - my service (not work)
` public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
btnLogin.Clicked += BtnLogin_Clicked;
}
private void BtnLogin_Clicked(object sender, EventArgs e)
{
MobileService.WebServiceSoapClient service = new MobileService.WebServiceSoapClient();
service.LoginCompleted += Service_LoginCompleted;
service.LoginAsync(usernameEntry.Text, passwordEntry.Text);
//CountryXService.countrySoapClient client = new CountryXService.countrySoapClient();
//client.GetCountriesCompleted += Client_GetCountriesCompleted;
//client.GetCountriesAsync();
}
private void Client_GetCountriesCompleted(object sender, CountryXService.GetCountriesCompletedEventArgs e)
{
Device.BeginInvokeOnMainThread(() =>
{
try
{
DisplayAlert("Mess", e.Result, "Ok"); // IT IS WORK!!!!
}
catch (Exception ex)
{
DisplayAlert(ex.Message, ex.InnerException.Message, "Ok");
}
});
}
private void Service_LoginCompleted(object sender, MobileService.LoginCompletedEventArgs e)
{
Device.BeginInvokeOnMainThread(() =>
{
try
{
if (e.Result.ValidUser) // <----- e.Rusult is Error!!!
{
Navigation.PushModalAsync(new Page2());
}
else
{
DisplayAlert("Error", "user name or pass is not valid", "Ok");
}
}
catch (Exception ex)
{
DisplayAlert(ex.Message, ex.InnerException.Message, "Ok");
}
});
}
}
`
Why it is?
CanDevelop app for Cinema Booking System?
Hi,
I want to develop app for Cinema Booking System in XAMARIN form. i don't know how is a stable for develop a large scale application.
Can anyone suggest me? Should i use a Xamarin form or native?
Thanks,
Pratius
Web service
my url is working fine,but data is not showing
It showing an error as "Thread unknown" after "host connection get()".
Debug:
Loaded assembly: Mono.Android.dll [External]
Loaded assembly: Java.Interop.dll [External]
Loaded assembly: System.Runtime.dll [External]
Loaded assembly: System.Collections.Concurrent.dll [External]
Loaded assembly: System.Threading.dll [External]
Loaded assembly: System.Runtime.InteropServices.dll [External]
Loaded assembly: System.Reflection.dll [External]
Loaded assembly: System.Collections.dll [External]
Loaded assembly: System.Linq.dll [External]
Loaded assembly: System.Core.dll [External]
Loaded assembly: System.Runtime.Extensions.dll [External]
Loaded assembly: System.Reflection.Extensions.dll [External]
Loaded assembly: System.ObjectModel.dll [External]
Loaded assembly: System.dll [External]
Loaded assembly: MonoDroidConstructors [External]
Loaded assembly: System.Threading.Tasks.dll [External]
Loaded assembly: System.Xml.ReaderWriter.dll [External]
Loaded assembly: System.Xml.dll [External]
Loaded assembly: System.IO.dll [External]
Loaded assembly: System.Linq.Expressions.dll [External]
Loaded assembly: System.Resources.ResourceManager.dll [External]
Loaded assembly: System.Globalization.dll [External]
Loaded assembly: System.Dynamic.Runtime.dll [External]
Loaded assembly: System.Text.RegularExpressions.dll [External]
Loaded assembly: System.Net.Http.dll [External]
Loaded assembly: System.ComponentModel.dll [External]
Loaded assembly: System.Diagnostics.Debug.dll [External]
Thread started: #2
Thread started: #3
Thread started: #4
Thread started: #5
Thread started: #6
Thread started: #7
Thread started: #8
Thread started: #9
Loaded assembly: System.Runtime.Serialization.Primitives.dll [External]
Loaded assembly: System.Runtime.Serialization.dll [External]
Loaded assembly: Anonymously Hosted DynamicMethods Assembly [External]
10-24 02:50:23.232 D/ ( 4854): HostConnection::get() New Host Connection established 0xd9c115e0, tid 4854
Thread finished: #6
The thread 'Unknown' (0x6) has exited with code 0 (0x0).
Thread finished: #7
The thread 'Unknown' (0x7) has exited with code 0 (0x0).
Thread finished: #8
The thread 'Unknown' (0x8) has exited with code 0 (0x0).
Thread finished: #3
The thread 'Unknown' (0x3) has exited with code 0 (0x0).
Thread finished: #4
Thread started: #11
The thread 'Unknown' (0x4) has exited with code 0 (0x0).
Thread finished: #5
The thread 'Unknown' (0x5) has exited with code 0 (0x0).
Thread finished: #9
Thread started: #12
Thread started: #13
The thread 'Unknown' (0x9) has exited with code 0 (0x0).
Thread finished: #11
Thread started: #14
iOS app Null Reference Exception; other platforms start fine!
I have a Xamarin Forms app which starts up fine on both UWP and Android but on iOS throws a NullReferenceException. Oddly though, it continues to run if I just resume execution, but i'd still like to fix it. Im struggling to pin down exactly where the problem is though due to a lack of details.
And if I hit F5 to continue execution, all I get in the debug window is:
Obviously this isn't much help.
I've stepped through the app startup and into the page that is on-screen when this happens, and both the constructor and onAppearing methods step through fine.
Has anyone got any tips on pinning down exactly what the cause is here?
Thanks
Xamarin.Forms MSSQL Query Directly
Hi Everyone,
I know this is wrong way, I should use Web Service. But I need learn quickly this way. I research before write here I try but can't.
I want to SQL Query (like Select C.Name From Customer C) on list view. Can you help me? This is so important for me.
Windows 8.1 TLS 1.2 support within Xamarin
Hi,
We use Xamarin to target IOS, Android and Windows 8.1 devices. We have recently had the need to allow the use of TLS 1.2 for all 3 of these platforms. IOS does this out of the box. For Android we are using ModernHTTPClient to achieve this. But for Windows 8.1 there doesn't currently seem to be any way of supporting TLS 1.2.
We have tried the following approaches without success:
- Making use of the ServicePointManager to define the TLS versions available - SPM is not supported in PCL or Windows target projects
- Upgrade to .NET 4.6 - Xamarin does not allow this and reverts the version back to 4.5 each time
- Upgrade to Visual Studio 2017 with .NET Core 2.0 - VS2017 does not support Windows 8.1 App/Phone projects.
Does anyone know if there is any way of achieving this within 8.1 as there currently doesn't seem to be any way of doing it?
Thanks in advance
Regards
Scott
How to import Facebook-SDK packages in Xamarin forms
Hello,
I'm currently developing an Xamarin Forms app that needs to authenticate users, using Facebook.
However, I'm having a hard time figuring out the steps to import and use the Facebook-SDK in my project.
My question is: How do I import the following code in point 6 to my Xamarin forms project?
I've already added the Facebook SDK using Gradle extention for Visual Studio 2017.
Nonetheless, I cant figure out point 6
Import the Facebook SDK
To use the Facebook SDK in a project, add it as a build dependency and import the Facebook SDK packages.
Important: If you're adding the SDK to an existing project, start at step 3.
- Go to Android Studio | New Project | Minimum SDK.
- Select API 15: Android 4.0.3 (IceCreamSandwich) or higher and create your new project.
- In your project, open your_app | Gradle Scripts | build.gradle (Project) and add the following repository to the buildscript
{ repositories {}}
section to >download the SDK from the Maven Central Repository:
mavenCentral()
- In your project, open your_app | Gradle Scripts | build.gradle (Module: app) and add the following compile statement to the
dependencies{}
section to >compile the latest version of the SDK:
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
- Build your project.
- Add the following statements to import the Facebook SDK packages:
import com.facebook.FacebookSdk;
import com.facebook.appevents.AppEventsLogger;
Thanks
How to create Chat Application for Xamarin Forms ?
Hi, I am Xamarin Developer. I want to create chat application for Xamarin Forms. Is there any link ? Which sdk support to Xamarin forms ? Thank you
mtouch error invalid bitcode signature
Since we are only going to support iPhone 5 and higher we changed the Supported Architectures from Armv7 + ARM64 to Armv7s + ARM64
Now when we build for release we get the following error: mtouch error invalid bitcode signature
Do we need to change anything else?
Thanks.
Make stack layout clickable
How to make stack layout clickable? tapped event take time ,i need click event instead of it.can any one help on it?
[PRISM] Unity App - Can't compile after creating a new project
Hello,
I'm using Visual Studio Community 2017 and i create a new cross-platform project with Prism Unity for Xamarin.Forms but i have this errors :
When i try to update "CommonServiceLocator" i got this:
Any idea? @BrianLagunas
Best regards
Websockets from Nuget: How to write backend?
Hi guys, it's my first post. I write little chat in Android Studio with Socket.io and write the backend in node.js using socket.io module.
Now I need to write little chat from using this Websockets for PCL project package. It's for PCL but on my shared project with xamarin forms works good (how is possible?) so I want to know: can I use the same backend in nodejs? Or I need different module import/implementation in my vps?
XAML - Change Label Text from code behind
Hi everybody,
I need to change a label text put into a Viewcell from codebehind but I receive an error dispayng "the name myLabel does not exist in the current context".
this is my 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="CarouselPageNavigation.EditOrderPage">
<ContentPage.Content>
<StackLayout VerticalOptions="FillAndExpand" Orientation="Vertical">
<Label x:Name="oName" Text="" />
<Label x:Name="countProducts" Text="" />
<ListView x:Name="ProductList" >
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell BindingContextChanged="OnBindingContextChanged">
<Grid>
<StackLayout Orientation="Horizontal" Padding="10,5,0,5" >
<StackLayout Orientation="Horizontal">
<Image Source="{Binding Img}" />
</StackLayout>
<StackLayout Orientation="Vertical">
<Label x:Name="myLabel" Text="ddddddd" IsVisible="false"/>
<Label Text="{Binding Name}" />
</StackLayout>
</StackLayout>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentPage.Content>
</ContentPage>
And this is the code behind:
public EditOrderPage(string name)
{
InitializeComponent();
OrderDataModel order = GetOrder(name);
myLabel.Text = "show this!";
oName.Text = order.orderName;
ObservableCollection<ProductsDataModel> ProductsInList = order.products;
countProducts.Text = "Tot Products: " + ProductsInList.Count.ToString();
ObservableCollection<ProductsDataModel> all_products = ProductsDataModel.All;
List<ProductsDataModel> myList= new List<ProductsDataModel>(ProductsInList);
...
...
...
ProductList.ItemsSource = myList;
}
Any Idea?
FontAwesome Label: Here's how!
Here's how you'll use the new FontAwesome label (Any Graphic font will work, but FontAwesome is Awesome):
var coolLabel = new FontAwesomeIcon(FontAwesomeIcon.Icon.Gear)
Here's how to set it up.
Download the FontAwesome font and unzip it. Rename the ttf to FontAwesome.ttf. Note the Case of the name. Copy it to Android /Assets and mark as a BundleAsset. Copy to iOS /Resources and mark as BundleResource and "Copy Always". In iOS edit the info.plist and add this:
<key>UIAppFonts</key>
<string>FontAwesome.ttf</string>
Now that we have the font in our projects we need to tell Android, and ONLY Android how to get to the Font. Here's a renderer you can just drop in FontAwesomeIconRenderer.cs:
[assembly: ExportRenderer(typeof(FontAwesomeIcon), typeof(FontAwesomeIconRenderer))]
namespace AAA.Android.Renderers
{
/// <summary>
/// Add the FontAwesome.ttf to the Assets folder and mark as "Android Asset"
/// </summary>
public class FontAwesomeIconRenderer: LabelRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<Label> e)
{
base.OnElementChanged(e);
if (e.OldElement == null)
{
//The ttf in /Assets is CaseSensitive, so name it FontAwesome.ttf
Control.Typeface = Typeface.CreateFromAsset(Forms.Context.Assets, FontAwesomeIcon.Typeface + ".ttf");
}
}
}
}
Here's the Label for your common UI project:
namespace AAA.Common.Views.Shared.FontAwesome
{
public class FontAwesomeIcon : Label
{
//Must match the exact "Name" of the font which you can get by double clicking the TTF in Windows
public const string Typeface = "FontAwesome";
public FontAwesomeIcon(string fontAwesomeIcon=null)
{
FontFamily = Typeface; //iOS is happy with this, Android needs a renderer to add ".ttf"
Text = fontAwesomeIcon;
}
/// <summary>
/// Get more icons from http://fortawesome.github.io/Font-Awesome/cheatsheet/
/// Tip: Just copy and past the icon picture here to get the icon
/// </summary>
public static class Icon
{
public static readonly string Gear = "";
public static readonly string Globe = "";
}
}
}
date picker stringFormat and CultureInfo
hello
<DatePicker x:Name="StartDatePicker" Date="{Binding TimeRoll.StartDate}" HorizontalOptions="CenterAndExpand"> <DatePicker.Format>ddd MMM yyyy</DatePicker.Format> </DatePicker>
when i change the the device language -
the text is showing in English,
when click the picker: its on the correct lang + culture.
thanks..
inserting translate on Binding StringFormat Syntax
hello,
<Label Text="{Binding MonthDuration, StringFormat='Monthly Duration: {0:hh\\:mm}'}" />
look on the StringFormat... on the "Monthly Duration:"
what the syntax for inserting my translation tag
{lng:Translate }
for example:
``
the translate signature:
[ContentProperty("Text")] public class TranslateExtension : IMarkupExtension
public object ProvideValue(IServiceProvider serviceProvider)
(is there another way than using a Spacial Converter - just for this label)
thanks