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

Customize GroupHeaderTemplate

$
0
0

Hello,

I've looked but cannot find an example of customizing a groupheadertemplate with multiple displays.

What I'm trying to achieve is in the group header, have 2 binding properties display.



Here is my xaml:

            <ListView.GroupHeaderTemplate>
                <DataTemplate>
                    <ViewCell>
                        <StackLayout Orientation="Vertical">
                            <Label Text="{Binding ProductCode}" FontAttributes="Bold" StyleClass="Default"/>
                            <Label Text="{Binding Description}" HorizontalOptions="StartAndExpand" StyleClass="Default" BackgroundColor="Red"/>
                        </StackLayout>
                    </ViewCell>
                </DataTemplate>
            </ListView.GroupHeaderTemplate>

The ProductCode display correctly, where as the Description does not.

Does anyone have a good working example on how to achieve this?

Thanks for your help!

-Austin


Image is not loading using url

$
0
0
var webImage = new Image { Source = ImageSource.FromUri(new Uri("https ://xamarin.com/content/images/pages/forms/example-appDOTpng")) };

I used above code but image is not loading iused both http and https url.
Please help me on this

StackLayout - handle click event

$
0
0

Hi all,

I've realized a very simple clickable StackLayout: it's composed by 2 images and a label.

I used TapGestureRecognizer to trigger the tapped event, so I can handle the click of the user on the button.

Here is my question: I would like to customize my StackLayout when the user clicks on it.

I would be able to find a cross platform solution to manage, f.e., the background color of the stackLayout from white to red. And also, if possible, to change the font of the label that is inside the StackLayout.

Does Xamarin Forms provide a simple way to do this?

TY in advance.

Problem in safe-margins while playing Video in WKWebview in Landscape Mode

$
0
0

Hi,

The Following problem occurs when using iphone-X and above and in iPad Pro (2nd and third generation).

I am using following layout to play You tube videos by clicking at the links available in Listview (See Image)

But when i rotate it in landscape mode (as shown below) it croses the safemargin

The problem is that when i want to navigate the video like forward, play/pause it does not work. It seems some thing is covering it.
In Portrait mode it is working fine.

I have already used UseSafeArea in my XAML
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core" ios:Page.UseSafeArea="True"

  1. I am using CustomRendere Wkwebview to play Video.

  2. Code used to resize the wkwebview while making transformation from portrait to landscape and vice versa
    protected override void OnSizeAllocated(double width, double height) { base.OnSizeAllocated(width, height); if (this.Width < this.Height) { VWebView.HeightRequest = (int)Math.Ceiling(this.Width / (16 / 9.0)); } else { VWebView.HeightRequest = this.Height; } }

Is there a way so that some space should be left at bottom of the screen so that the navigation bar of you-tube player appear somewhat above.

OR

Leaving Margin at bottom only in case of Landscape Mode.

Autocomplete Entry box in xamarin forms

$
0
0

Hi, I want to add Autocomplete entry box in my project. I have search a lot in internet but didn't find useful. how can i do this.

Autocomplete Entry in Xamarin.Forms

$
0
0

I need autocomplete extender functionality for a entry field.How to implement autocomplete Entry in Xamarin forms.

Error when I try open app using Entity Framework

$
0
0

Hi I have an app on the test channel of the play store, it was work fine, but I solved use Entity Framework, when I released a version the app stoped to work, on Visual Studio run normally but if I install using apk file and try open it not work.
When I install app using abd shell and I get the follow stacktrace:

:Switch: #Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=br.com.arasolution.trackermobile/md5fe955b898135a8fb7f26617b645b333c.MainActivity;end
    // Allowing start of Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=br.com.arasolution.trackermobile/md5fe955b898135a8fb7f26617b645b333c.MainActivity } in package br.com.arasolution.trackermobile
    // Rejecting start of Intent { cmp=com.samsung.android.app.galaxyfinder/.GalaxyFinderActivity } in package com.samsung.android.app.galaxyfinder
:Sending Touch (ACTION_DOWN): 0:(62.0,1345.0)
    // Injection Failed
    // Injection Failed
:Sending Touch (ACTION_UP): 0:(63.430508,1346.4381)
    // Injection Failed
:Sending Touch (ACTION_DOWN): 0:(439.0,755.0)
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
    // Injection Failed
:Sending Touch (ACTION_UP): 0:(552.60547,713.5607)
    // Injection Failed
    // Rejecting start of Intent { act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.google.android.packageinstaller cmp=com.google.android.packageinstaller/com.android.packageinstaller.permission.ui.GrantPermissionsActivity } in package com.google.android.packageinstaller
// CRASH: br.com.arasolution.trackermobile (pid 25057)
// Short Msg: android.runtime.JavaProxyThrowable
// Long Msg: android.runtime.JavaProxyThrowable: System.ArgumentException: The method 'b[Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder`1[Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation],Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder`1[Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation]].c' is not a property accessor
Parameter name: propertyAccessor
  at System.Linq.Expressions.Expression.GetProperty (System.Reflection.MethodInfo mi, System.String paramName, System.Int32 index) [0x00088] in <ba85ba5122c3499483c4d8a7ac6f7e5a>:0
  at System.Linq.Expressions.Expression.Property (System.Linq.Expressions.Expression expression, System.Reflection.MethodInfo propertyAccessor) [0x00016] in <ba85ba5122c3499483c4d8a7ac6f7e5a>:0
  at TrackerMobile.Migracoes.Migrations.MigracaoInicial+<>c.a (Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.CreateTableBuilder`1[TColumns] A_0) [0x0002b] in <46f5c8519d4a4dc684a0a82b19d909d3>:0
  at Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder.CreateTable[TColumns] (System.String name, System.Func`2[T,TResult] columns, System.String schema, System.Action`1[T] constraints) [0x000cb] in <69f795dffc844780bfcfff4ff8415a92>:0
  at TrackerMobile.Migracoes.Migrations.MigracaoInicial.Up (Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder migrationBuilder) [0x00000] in <46f5c8519d4a4dc684a0a82b19d909d3>:0
  at Microsoft.EntityFrameworkCore.Migrations.Migration.BuildOperations (System.Action`1[T] buildAction) [0x0000c] in <69f795dffc844780bfcfff4ff8415a92>:0
  at Microsoft.EntityFrameworkCore.Migrations.Migration.<.ctor>b__4_1 () [0x0000e] in <69f795dffc844780bfcfff4ff8415a92>:0
  at Microsoft.EntityFrameworkCore.Internal.LazyRef`1[T].get_Value () [0x00008] in <adf771f92e754fe1bb85c5850cd0c16b>:0
  at Microsoft.EntityFrameworkCore.Migrations.Migration.get_UpOperations () [0x00000] in <69f795dffc844780bfcfff4ff8415a92>:0
  at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.GenerateUpSql (Microsoft.EntityFrameworkCore.Migrations.Migration migration) [0x00033] in <69f795dffc844780bfcfff4ff8415a92>:0
  at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator+<>c__DisplayClass13_2.<GetMigrationCommandLists>b__2 () [0x00026] in <69f795dffc844780bfcfff4ff8415a92>:0
  at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate (System.String targetMigration) [0x0007a] in <69f795dffc844780bfcfff4ff8415a92>:0
  at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate (Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade databaseFacade) [0x00010] in <69f795dffc844780bfcfff4ff8415a92>:0
  at TrackerMobile.DB.IAppDbContext..ctor (Microsoft.EntityFrameworkCore.DbContextOptions`1[TContext] options) [0x0007f] in <46f5c8519d4a4dc684a0a82b19d909d3>:0
  at TrackerMobile.DB.AppDbContext..ctor (Microsoft.EntityFrameworkCore.DbContextOptions`1[TContext] options) [0x00000] in <46f5c8519d4a4dc684a0a82b19d909d3>:0
  at TrackerMobile.Forms.ViewModels.LoginViewModel.d () [0x00026] in <616f42fbee9f4a8091394a539e521ece>:0
  at TrackerMobile.Forms.ViewModels.LoginViewModel.OnAppearing () [0x00000] in <616f42fbee9f4a8091394a539e521ece>:0
  at Prism.Behaviors.PageLifeCycleAwareBehavior+<>c.<OnAppearing>b__2_0 (Prism.AppModel.IPageLifecycleAware aware) [0x00000] in <67be6ca629f141368fde5ee65f270d8b>:0
  at Prism.Common.PageUtilities.InvokeViewAndViewModelAction[T] (System.Object view, System.Action`1[T] action) [0x0003e] in <67be6ca629f141368fde5ee65f270d8b>:0
  at Prism.Behaviors.PageLifeCycleAwareBehavior.OnAppearing (System.Object sender, System.EventArgs e) [0x00006] in <67be6ca629f141368fde5ee65f270d8b>:0
  at Xamarin.Forms.Page.SendAppearing () [0x00034] in <a9131f61340149fcbb08ad43ae808046>:0
  at Xamarin.Forms.Page.SendAppearing () [0x00056] in <a9131f61340149fcbb08ad43ae808046>:0
  at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.OnAttachedToWindow () [0x0000c] in <e11d74a01fc148949d5e89708470f54c>:0
  at Android.Views.View.n_OnAttachedToWindow (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <2960acf2eeb24d88b5230e1e8afbdc2e>:0
  at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.34(intptr,intptr)
// Build Label: samsung/on7xelteub/on7xelte:8.1.0/M1AJQ/G610MUBS4CSB4:user/release-keys
// Build Changelist: G610MUBS4CSB4
// Build Time: 1550493190000
// android.runtime.JavaProxyThrowable: System.ArgumentException: The method 'b[Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder`1[Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation],Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder`1[Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation]].c' is not a property accessor
// Parameter name: propertyAccessor
//   at System.Linq.Expressions.Expression.GetProperty (System.Reflection.MethodInfo mi, System.String paramName, System.Int32 index) [0x00088] in <ba85ba5122c3499483c4d8a7ac6f7e5a>:0
//   at System.Linq.Expressions.Expression.Property (System.Linq.Expressions.Expression expression, System.Reflection.MethodInfo propertyAccessor) [0x00016] in <ba85ba5122c3499483c4d8a7ac6f7e5a>:0
//   at TrackerMobile.Migracoes.Migrations.MigracaoInicial+<>c.a (Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.CreateTableBuilder`1[TColumns] A_0) [0x0002b] in <46f5c8519d4a4dc684a0a82b19d909d3>:0
//   at Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder.CreateTable[TColumns] (System.String name, System.Func`2[T,TResult] columns, System.String schema, System.Action`1[T] constraints) [0x000cb] in <69f795dffc844780bfcfff4ff8415a92>:0
//   at TrackerMobile.Migracoes.Migrations.MigracaoInicial.Up (Microsoft.EntityFrameworkCore.Migrations.MigrationBuilder migrationBuilder) [0x00000] in <46f5c8519d4a4dc684a0a82b19d909d3>:0
//   at Microsoft.EntityFrameworkCore.Migrations.Migration.BuildOperations (System.Action`1[T] buildAction) [0x0000c] in <69f795dffc844780bfcfff4ff8415a92>:0
//   at Microsoft.EntityFrameworkCore.Migrations.Migration.<.ctor>b__4_1 () [0x0000e] in <69f795dffc844780bfcfff4ff8415a92>:0
//   at Microsoft.EntityFrameworkCore.Internal.LazyRef`1[T].get_Value () [0x00008] in <adf771f92e754fe1bb85c5850cd0c16b>:0
//   at Microsoft.EntityFrameworkCore.Migrations.Migration.get_UpOperations () [0x00000] in <69f795dffc844780bfcfff4ff8415a92>:0
//   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.GenerateUpSql (Microsoft.EntityFrameworkCore.Migrations.Migration migration) [0x00033] in <69f795dffc844780bfcfff4ff8415a92>:0
//   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator+<>c__DisplayClass13_2.<GetMigrationCommandLists>b__2 () [0x00026] in <69f795dffc844780bfcfff4ff8415a92>:0
//   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate (System.String targetMigration) [0x0007a] in <69f795dffc844780bfcfff4ff8415a92>:0
//   at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate (Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade databaseFacade) [0x00010] in <69f795dffc844780bfcfff4ff8415a92>:0
//   at TrackerMobile.DB.IAppDbContext..ctor (Microsoft.EntityFrameworkCore.DbContextOptions`1[TContext] options) [0x0007f] in <46f5c8519d4a4dc684a0a82b19d909d3>:0
//   at TrackerMobile.DB.AppDbContext..ctor (Microsoft.EntityFrameworkCore.DbContextOptions`1[TContext] options) [0x00000] in <46f5c8519d4a4dc684a0a82b19d909d3>:0
//   at TrackerMobile.Forms.ViewModels.LoginViewModel.d () [0x00026] in <616f42fbee9f4a8091394a539e521ece>:0
//   at TrackerMobile.Forms.ViewModels.LoginViewModel.OnAppearing () [0x00000] in <616f42fbee9f4a8091394a539e521ece>:0
//   at Prism.Behaviors.PageLifeCycleAwareBehavior+<>c.<OnAppearing>b__2_0 (Prism.AppModel.IPageLifecycleAware aware) [0x00000] in <67be6ca629f141368fde5ee65f270d8b>:0
//   at Prism.Common.PageUtilities.InvokeViewAndViewModelAction[T] (System.Object view, System.Action`1[T] action) [0x0003e] in <67be6ca629f141368fde5ee65f270d8b>:0
//   at Prism.Behaviors.PageLifeCycleAwareBehavior.OnAppearing (System.Object sender, System.EventArgs e) [0x00006] in <67be6ca629f141368fde5ee65f270d8b>:0
//   at Xamarin.Forms.Page.SendAppearing () [0x00034] in <a9131f61340149fcbb08ad43ae808046>:0
//   at Xamarin.Forms.Page.SendAppearing () [0x00056] in <a9131f61340149fcbb08ad43ae808046>:0
//   at Xamarin.Forms.Platform.Android.AppCompat.NavigationPageRenderer.OnAttachedToWindow () [0x0000c] in <e11d74a01fc148949d5e89708470f54c>:0
//   at Android.Views.View.n_OnAttachedToWindow (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <2960acf2eeb24d88b5230e1e8afbdc2e>:0
//   at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.34(intptr,intptr)
//      at md58432a647068b097f9637064b8985a5e0.NavigationPageRenderer.n_onAttachedToWindow(Native Method)
//      at md58432a647068b097f9637064b8985a5e0.NavigationPageRenderer.onAttachedToWindow(NavigationPageRenderer.java:49)
//      at android.view.View.dispatchAttachedToWindow(View.java:18728)
//      at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3534)
//      at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3541)
//      at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3541)
//      at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3541)
//      at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3541)
//      at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3541)
//      at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3541)
//      at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3541)
//      at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2186)
//      at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1863)
//      at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8072)
//      at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
//      at android.view.Choreographer.doCallbacks(Choreographer.java:723)
//      at android.view.Choreographer.doFrame(Choreographer.java:658)
//      at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
//      at android.os.Handler.handleCallback(Handler.java:790)
//      at android.os.Handler.dispatchMessage(Handler.java:99)
//      at android.os.Looper.loop(Looper.java:164)
//      at android.app.ActivityThread.main(ActivityThread.java:7000)
//      at java.lang.reflect.Method.invoke(Native Method)
//      at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
//      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
//
** Monkey aborted due to error.
Events injected: 19
:Sending rotation degree=0, persist=false
:Dropped: keys=0 pointers=13 trackballs=0 flips=0 rotations=0
## Network stats: elapsed time=8207ms (0ms mobile, 0ms wifi, 8207ms not connected)
** System appears to have crashed at event 19 of 500 using seed 1555759346990

It's looks like for me who a project lost references to Entity Framework, when app start it try run migration, follow my code:

public partial class App : PrismApplication
    {

    // omitted default constructors

        protected override async void OnInitialized()
        {
            InitializeComponent();
            //TODO: depois que lançar versão oficial do app remover essa rotina de exclusão de banco de dados
            using (IAppDbContext db = new AppDbContext(new DbContextOptionsBuilder<IAppDbContext>().UseSqlite(new SqliteConnection(Container.Resolve<IDBUtils>().ObterCaminhoBanco())).Options))
            {
                using (DbConnection conn = db.Database.GetDbConnection())
                {
                    if (conn.State.Equals(ConnectionState.Closed))
                    {
                        conn.Open();
                    }
                    using (var command = conn.CreateCommand())
                    {
                        command.CommandText = @"Select Count(name) from sqlite_master where type = 'table' and  name = 'Sessoes';";
                        bool baseNaoMigrada = !Convert.ToBoolean(command.ExecuteScalar());
                        if (baseNaoMigrada)
                        {
                            db.Database.EnsureDeleted();
                        }
                    }
                }
            }

            using (IAppDbContext db = new AppDbContext(new DbContextOptionsBuilder<IAppDbContext>().UseSqlite(new SqliteConnection(Container.Resolve<IDBUtils>().ObterCaminhoBanco())).Options))
            {
                db.Database.Migrate();
            }
            string pagina = SessaoUsuario.UsuarioEstaLogado ? string.Format("/" + ViewsNamesConstants.PREFIXO_VIEW_MASTER_DETAIL, ViewsNamesConstants.MASTER_DETAIL, ViewsNamesConstants.MAPA) : string.Format(ViewsNamesConstants.PREFIXO_VIEW, ViewsNamesConstants.LOGIN);
            await NavigationService.NavigateAsync(pagina);
        }

         // omitted OnResume, OnSleep and RegisterTypes
    }

thank you :)

How to print

$
0
0
I have decided to migrate an existing WinForm application to XF.

It’s basically a very simple invoicing software for a shop and I was really excited about the performance when I started the project and managed to create iOS, Android, UWP, WPF and macOS all using the same code base (98% of the code is shared)

My project is a shared project (NOT PCL) and all I want to be able to do now is to print the invoices (not necessarily silently like POS)

I have to say that I am baffled that I can’t find a single working example after spending 12 hours on it...

I had been thinking using Shared Code would be giving me more flexibility to access native functions thanks to the #if #endif compiler directives but now I have minimised my expectations and will be the happiest man alive if I can at least print an invoice in the UWP/WPF only ...

I decided to create a PDF first to make things easier and consistent in terms of invoicing layout and even that was a big issue (using iTextSharp failed) so I ended up posting data to a WebService and then leaving PDF generation to the backend

Now, my question is how can I print that PDF using the device’s installed printer? (For now only in UWP/WPF and if I succeed I will be looking for other platforms)

What is the best way to create login page ? Storing details in simple database.

$
0
0

Im new to Xamarin and just trying to find best way to create a login page before i start my main app development.

Auto Complete using Xamarin Forms in C#

$
0
0

Hi,

I am trying to create a AutoComplete Text Entry using Xamarin Forms.
Can anybody help me in creating a custom renderer for the auto complete text field in C#.
I am using MVVM concept.

Autocomplete for textbox

$
0
0

i need autocomplete extender functionality for a entry field . Can any one suggest me how to implement in xamarin.forms

how to implement autocomplete text view in xamarin forms

$
0
0

Anyone help me...Thanks in advance

Best way to Handle Master Detail Navigation that Also requires UI Button Navigation

$
0
0

So I have this issue currently where, During some Navigation I have the device run out of Memory. And the app Crashes.

I think its the way i'm Handling the Navigation TBH

Currently I have a master Detail page

But From there I have the Following

Suppliers -> Products -> Single Product -> Add to cart.

Now If I go from Suppliers to anywhere and back it Crashes to app, Theres obviously alot of combinations here But im sure you get what I'm trying to imply.

Now How I'm navigating

E.g
First way:

           var masterDetailPage = new Home("");
                masterDetailPage.Detail = new NavigationPage(new Orders());
                Application.Current.MainPage = masterDetailPage;

Second way:

   await Navigation.PushAsync(new Orders());

I feel like everytime I go to Suppliers I create a Whole new Suppliers on the stack and eventually IT overloads, Cause currently I cant have more then 5 Products never mind The fact that If i go Cart -> Suppliers and scroll down it crashes. I'm very much confused right about now.
I know this not the case in reality its just kind of what I'm thinking is happening its either that Or I'm not clearing Web Request or such I'm not really sure. I cant find to much Information in regards to the Different type's of waits to Pop between Pages.

How can I read a RFID card in my Xamarin.Forms Application?

$
0
0

Hi guys, how can I read a RFID card in my Xamarin.Form Application?
In the end, I want to read this card over an android tablet.
Thanks.

Using Remote Control

$
0
0

I have developed an application that has different pages, the first page contains some buttons to navigate to other pages I run it in my mobile, it works fine, and I run it on my tv (Andoird Tv), it runs but I can't click on buttons to navigate to others page by REMOTE CONTROL

How can I handle keys remote control in my app Xamarin forms ????

I have searched about it and I found that I have to use (Enable D-pad Navigation ) but I don't know how to use this

Thank's


Launch Navigation Page within Tabbed Page

$
0
0

I would like to know why a navigation page is not launched within a tabbed page. nothing happen plus there is no error. How can I get navigation page to work ? Thank you.

###################
App.xaml.cs

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

[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
namespace MyApp
{
    public partial class App : Application
    {

        public App()
        {

            MainPage = new MyApp.View.MainTabbedPage(); 

        }
     }
}
####################
MainTabbedPage.xaml

<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" 
            xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
            xmlns:local="clr-namespace:MyApp.View;assembly=MyApp"
            x:Class="MyApp.View.MainTabbedPage" 
            xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
            android:TabbedPage.ToolbarPlacement="Bottom"
            BarBackgroundColor="#2196F3"
            BarTextColor="White"
            android:TabbedPage.BarItemColor="#66FFFFFF"
            android:TabbedPage.BarSelectedItemColor="White" 

           >
    <TabbedPage.Title></TabbedPage.Title>
    <TabbedPage.Children>
        <local:HomePage />
        <local:SharingPage/>
        <local:SettingPage/>
    </TabbedPage.Children>

</TabbedPage>

##############
HomePage.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="MyApp.View.HomePage"
             x:Name="HomePage" >

    <StackLayout>


        <!-- Place new controls here -->

        <Button x:Name="Button" Text="Go" 
               Command="{Binding GoLaunchPage}"
               VerticalOptions="Center">
        </Button>


    </StackLayout>

</ContentPage>

##################
HomePage.xaml.cs

namespace MyApp.View
{
    public partial class HomePage : ContentPage
    {

        public DevicePage()
        {

            BindingContext = new HomeViewModel();
            InitializeComponent();

        }
     }
}

##################
HomeViewModel.cs

namespace MyApp.ViewModel
{
    class HomeViewModel: ViewModelBase
    {

    public HomeViewModel()
    {}
     public ICommand GoLaunchPage => new Command(async () => 
        {
             // The page never get launched.
             var navpage = new NavigationPage();
                     await navpage.PushAsync(new login());
        });
    }
}

Force Update with Xamarin Version Tracking

$
0
0

Hi everyone!

I want users to be unable to use my app without updating. I think I should do force update for this. So I have to check my application versions.
Is it possible to do this with xamarin essentials version tracking?

How can I do that ?

Thanks in advance!

Duplicate Xaml Compilation Attribute error

$
0
0

Hello, I added the following code in my code "[assembly: XamlCompilation(XamlCompilationOptions.Compile)]" and I get the duplicate Xaml
Compilation Attribute error. Any reason why?

 using Xamarin.Forms.Xaml;

 [assembly: XamlCompilation(XamlCompilationOptions.Compile)]

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

how to avoid men leacks when posing views

$
0
0

Hi

I read through a lot of blog posts and I tried to narrow down how to eliminate a leak I have in an application. When I am pushing and poping a view multiple times I see when I profile the app that all the views and all properties of the view model still exists.
I implemented the Dispose on my view model. And I also implemented on my objects the INotifyPropertyChanged .

My code can be found under the MemLeak branch
github.com/hulluP/CollectionViewTest/tree/MemLeakIssue

Thanks for any Pointers

HP

UWP Exception

$
0
0

Hi everyone. Im new on the forum and relatively new in Xamarin.
Im having an issue with an especific exeption that ive tried to understand what does it means. Can someone help me out?
Here is it:
System.NullReferenceException: Object reference not set to an instance of an object.
at Xamarin.Forms.Platform.UWP.FormsGridView.OnApplyTemplate()
at Windows.UI.Xaml.UIElement.Measure(Size availableSize)
at Xamarin.Forms.Platform.UWP.VisualElementRenderer2.MeasureOverride(Size availableSize) at Windows.UI.Xaml.UIElement.Measure(Size availableSize) at Xamarin.Forms.Platform.UWP.VisualElementRenderer2.MeasureOverride(Size availableSize)

Sorry for the bad english

Viewing all 77050 articles
Browse latest View live


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