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

MessagingCenter.Subscribe Multiple Call

$
0
0

I found my code Multiple call ,anyone who can help me find the reason

           MessagingCenter.Subscribe<SelectCitiesViewModel,string> (this, "Province", (sender, arg) => {
                Province = arg;
                MessagingCenter.Send (this, "Dismiss", sender);
            });

            static int i;
            MessagingCenter.Subscribe<CityViewModel> (this, "Dismiss", (sender) => {
                Navigation.RemovePage (this);
                Debug.WriteLine (sender.city_name + "excuted" + (i++));
            });

Here is the Application Output
2015-03-21 11:18:03.199 TescarManage.iOS[7332:466564] 重庆excuted0
重庆excuted0
2015-03-21 11:18:17.073 TescarManage.iOS[7332:466564] 北京excuted1
北京excuted1
2015-03-21 11:18:17.075 TescarManage.iOS[7332:466564] 北京excuted2
北京excuted2
2015-03-21 11:18:17.077 TescarManage.iOS[7332:466564] 北京excuted3
北京excuted3
2015-03-21 11:18:29.434 TescarManage.iOS[7332:466564] 随州excuted4
随州excuted4
2015-03-21 11:18:29.435 TescarManage.iOS[7332:466564] 随州excuted5
随州excuted5
2015-03-21 11:18:29.436 TescarManage.iOS[7332:466564] 随州excuted6
随州excuted6
2015-03-21 11:18:29.437 TescarManage.iOS[7332:466564] 随州excuted7
随州excuted7
2015-03-21 11:18:29.438 TescarManage.iOS[7332:466564] 随州excuted8
随州excuted8
2015-03-21 11:18:29.439 TescarManage.iOS[7332:466564] 随州excuted9
随州excuted9
2015-03-21 11:18:39.810 TescarManage.iOS[7332:466564] 黔西南excuted10
黔西南excuted10
2015-03-21 11:18:39.811 TescarManage.iOS[7332:466564] 黔西南excuted11
黔西南excuted11
2015-03-21 11:18:39.811 TescarManage.iOS[7332:466564] 黔西南excuted12
黔西南excuted12
2015-03-21 11:18:39.812 TescarManage.iOS[7332:466564] 黔西南excuted13
黔西南excuted13
2015-03-21 11:18:39.813 TescarManage.iOS[7332:466564] 黔西南excuted14
黔西南excuted14
2015-03-21 11:18:39.813 TescarManage.iOS[7332:466564] 黔西南excuted15
黔西南excuted15
2015-03-21 11:18:39.814 TescarManage.iOS[7332:466564] 黔西南excuted16
黔西南excuted16
2015-03-21 11:18:39.815 TescarManage.iOS[7332:466564] 黔西南excuted17
黔西南excuted17
2015-03-21 11:18:39.816 TescarManage.iOS[7332:466564] 黔西南excuted18
黔西南excuted18
2015-03-21 11:18:39.817 TescarManage.iOS[7332:466564] 黔西南excuted19
黔西南excuted19


How to disable share in QLpreviewcontroller for iOS

$
0
0

Hi,

Using dependency service I have used Qlpreviewcontroller to view PDF.However I want to remove or disable the share button.

I already tried setting right bar button item to null ,this will not work from iOS 6

How can I achieve this? Any code snippet would be helpful

Change font size printing bluetooth printer

$
0
0

Hello Everyone.

I am developing a multiplatform application, this makes the impression perfectly, but I would like to know how to change the font of the letter and be able to change some words in bold.

I use the Intermec PR2 bluetooth printer.

Visual Studio 2015 Community - How to Upgrade XForms From 2.0.... to 2.3.3....

$
0
0

Hi there!
Is there a step by step tutorial about how to upgrade Xamarin Forms to 2.3.3. release?

Many thank for any kind of help.

Best regards,
Ciro.

InApp-Billing

$
0
0

Hey folks,
as I'm taking huge steps to release our app, I'm now at the point where I have to implement a payment function. And I was curious if anyone here used the InApp-Billing Components from the components store and has a few tips for me.

Since those are platform packages I guess the best way to use them is via DependencyService.

As the instructions from the components are good, maybe someone found a few hints for Forms.

Greetings

Google Auth Error:disallowed_useragent

$
0
0

I am getting Google Auth Error:disallowed_useragent in iOS when I try to authenticate google login using xamarin.auth.Google Document says Google has changed its Oauth policies, with this it is intended that no native web views initiate Oauth flows.So now, how to authenticate google login using xamarin.auth ?

Dynamic forms

$
0
0

Hi all,

I am new to Xamarin development and would like to consult with you on the best approach for an app that I would like to build.

The idea is to allow a user on the server side to define forms. The forms allow all typical controls that Xamarin Forms supports. These forms can then be published. Once published the user can see the list of forms available on the mobile app and can use them to collect data. Upon submit the data is sent in form of JSON to the server and stored there. That's the basic idea. The mobile app needs to be able to receive form definitions that it renders. What architecture would you recommend for that.

Should the form definition be in JSON and the mobile app parses the definition and dynamically creates the form? Is this possible with Xamarin forms? Is it possible to define the form definition right in XAML xml and have the mobile app render that?

An alternative approach would be to not have a server in the first place and to allow the user to even define the forms with the mobile app.

Your guidance is greatly appreciated.

Thx

MasterDetailView: How does the menu icon (hamburger) appear?

$
0
0

I've built and run the MasterDetailPage sample on github, and it works.

However, I don't understand how the "hamburger" menu icon that appears when the ContactsList, TodoList and Reminders pages are displayed, is created.

There seems to be a bit of voodoo here.

In particular, this sample does not have a UWP version, so I went ahead and created a Xamarin.Forms UWP project and hooked it up to the Portable Library project as described here.

This also works, and the hamburger menu appears, even though I did not add any icon assets to the UWP project, and there are no icon assets in the Portable Library.

There is a line that reads

Icon = "hamburger.png";

in MasterPageCS.cs and MasterPage.xaml. However, deleting them does not make any difference.

So I'm stumped - how does the hamburger icon get created?

I've tried following this sample in my own app, and the hamburger icon does not appear.


Create a Image ProgressBar

$
0
0

Hello everyone! My name's An, i'm a newbie with xamarin form. Now i have some trouble about how to create a image ProgressBar!
Anyone can give me any idea to resolve it, plz?
Thanks so much for helping me!

Is there any one know the problem about : Label disappeared in the ListView (UWP)

$
0
0

I'm trying to update the Label.Text from view model. But it just disappeared .

But funny thing is: It would show again when I resize the window size.

I report that BUG, also upload a sample file, but if anyone could fix that, that would be really helpful.

Download Sample attachement from : https://bugzilla.xamarin.com/show_bug.cgi?id=44973

For Xamarin Gurus: How to fire an event from a custom cell (ViewCell) to change selection.

$
0
0

The goal: Get ItemSelected event of a ListView with a custom ViewCell
The problem: the viewcell has a WebView which eats up all mouse clicks. When clicked on the part of the cell that has the webview, the cell isn't selected.
Partial solution: I can detect mouse clicks in JS and send events back to Xamarin using the Navigating callback. However, I don't know how I can modify A custom ViewCell to somehow inform the parent ViewList that that particular cell has been selected.

Any ideas how to solve this?

Page is not scrolling when keyboard comes in android.

$
0
0

In xamarin forms I build a content page which has login and password entry with a login button. When user click on login entry keyboard comes and focus goes to entry field. Down the login entry password entry is visible but login button is hide behind keyboard. Now user is not able to scroll the view to get keyboard. So when keyboard comes page is not scrolling. I used stack layout inside scrollview. The issue is coming only in android.

Error inflating class android.support.v7.widget.Toolbar after updaring to v7.AppCompat Version 23.3

$
0
0

I am creating a Xamarin Forms Project and using android.support.v7.widget.Toolbar with FormsAppCompatActivity. The code I'm posting below was working with Xamarin.Android.Support.v7.AppCompat Version: 23.0.1.3

But after I upgraded to 23.3.0 this has started throwing Android.Views.InflateException: Binary XML file line #1: Error inflating class android.support.v7.widget.toolbar exception.

Here is my code for MainActivity

[Activity(Label = "AppMob.Client", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
    public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
    {

        protected override void OnCreate(Bundle bundle)
        {
            FormsAppCompatActivity.ToolbarResource = Resource.Layout.toolbar;
            FormsAppCompatActivity.TabLayoutResource = Resource.Layout.tabs;

            base.OnCreate(bundle);

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

            Xamarin.FormsMaps.Init(this,bundle);
            GoogleAnalyticsHelper.GetGASInstance().Initialize_NativeGAS(Application.Context);  //For GA initialization
            LoadApplication(new App());
        }
}

This is my code for Resource.Layout.toolbar

    <?xml version="1.0" encoding="utf-8"?>
    <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:minHeight="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
        app:layout_scrollFlags="scroll|enterAlways" />

M2MQTT in Xamarin forms or Xamarin Android

$
0
0

i am unable to Integrate the M2MQTT in xamarin forms or Xamarin Android .

Windows phone 8.1 with database not save database after close phone

$
0
0

I am working with xamarin forms and when running the application on windows phone emulator then close the emulator the database is destroying and I have to recreate the data every time I am lunching the emulator.

Database connection code:
public class SQLite_WindowsPhone : ISQLite
{

            public SQLite_WindowsPhone()
            {
            }

            public SQLiteConnection GetConnection()
            {
                var sqliteFilename = "dataBase.db3";
                string documentsPath = ApplicationData.Current.LocalFolder.Path;
                var path = Path.Combine(documentsPath, sqliteFilename);

                // Create the connection
                var conn = new SQLiteConnection(path);
                // Return the database connection
                return conn;
            }
        }

google Map Styling

Need to put HTML into a Label

$
0
0

I am using Xamarin.Forms and the Label view. I use the FormattedText (FormattedString class) to put formatted text in the Label. My goal here is to be able to convert HTML to a FormattedString.

In Xamarin.Android I have acces to Html.FromHtml() wich returns a ISpanned. Is there a equivalent for Xamarin.Forms ?

I cannot really use a WebView since my goal is to have multiple labels populated from HTML. If I use a WebView, I would be forced to do the whole page in HTML and not use Xamarin.Forms views/controls.

Thanks,
Max.

How to solve unknown type in UWP app - Windows.UI.ViewManagement.StatusBar

$
0
0

Hi,
From what I can tell, I've got a pretty basic UWP app, but whenever I run it I get the following exception:

System.TypeLoadException was unhandled by user code
HResult=-2146233054
Message=Could not find Windows Runtime type 'Windows.UI.ViewManagement.StatusBar'.
Source=Xamarin.Forms.Platform.UAP
TypeName=Windows.UI.ViewManagement.StatusBar
StackTrace:
at Xamarin.Forms.Platform.UWP.Platform..ctor(Page page)
at Xamarin.Forms.Platform.UWP.WindowsPage.CreatePlatform()
at Xamarin.Forms.Platform.UWP.WindowsBasePage.LoadApplication(Application application)
at MyApp.UWP.MainPage..ctor()
at MyApp.UWP.My_App_UWP_XamlTypeInfo.XamlTypeInfoProvider.Activate_4_MainPage()
at MyApp.UWP.My_App_UWP_XamlTypeInfo.XamlUserType.ActivateInstance()
InnerException:

I'm using Xamarin.Forms 2.1.0.6529 in my project. I also tried downloading a sample off GitHub (https://github.com/jamesmontemagno/MyWeather.Forms) and I'm seeing the same exception. Looks like that project is using 2.0.0.6490.

So, that makes this sound like something is missing from my system? I'm running Windows 10 which I just installed yesterday.

I'm new to UWP and Xamarin, so I don't even know where to start looking. I have noticed that if I comment out the line:

LoadApplication(new MyApp.App());

the application boots. Of course, nothing is there since I'm not starting the app, but the code to init Xamarin.Forms is still running in App.xaml.cs.

Thanks,
Nick

Don't work padding in stacklayout

$
0
0

I work with Xamarin Forms. Don't work padding in stacklayout. I have:******

<StackLayout>
        <StackLayout>
          <!--Code. It not have padding.-->
        </StackLayout>
        <StackLayout>
          <StackLayout.Padding>
            <Thickness Right="5" Left="5" Top="5" Bottom="5"/>
          </StackLayout.Padding>
          <!--It must have padding-->
       </StackLayout>
     </StackLayout>

Why it's not working?

Button on Android all caps

$
0
0

I have just noticed that on Xamarin Forms Android, the text label on elements appears in ALL CAPS. Is this by design?

Regards,
Ian

Viewing all 91519 articles
Browse latest View live


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