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

How do i bind a property text of the label

$
0
0

I have this layout

<Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>

                        <BoxView Color="Red" Grid.Row="0" Grid.Column="0" />
                        <BoxView Color="Green" Grid.Row="0" Grid.Column="1" />
                        <BoxView Color="Green" Grid.Row="1" Grid.Column="0" />
                        <BoxView Color="Green" Grid.Row="1" Grid.Column="1" />

                        <BoxView Color="Green" Grid.Row="2" Grid.Column="0" />
                        <BoxView Color="Green" Grid.Row="2" Grid.Column="1" />
                        <BoxView Color="Yellow" Grid.Row="3" Grid.Column="0" />

            <Image Source="{local:ImageResource TesteAutenticacaoForms.Images.ico-cobranca-mensalista.png}" Grid.Row="0" Grid.Column="0" >
                    <Image.GestureRecognizers>
                        <TapGestureRecognizer Tapped="OnTapGestureReconizerTapped" NumberOfTapsRequired="1"></TapGestureRecognizer>
                    </Image.GestureRecognizers>
                     </Image>


                        <Label Text="Test1" Grid.Row="0" Grid.Column="0" TextColor="White" FontAttributes="Bold"/>
                        <Label Text="Test2" Grid.Row="0" Grid.Column="0" VerticalOptions="EndAndExpand" HorizontalOptions="Center" TextColor="White" FontAttributes="Bold"/>
                    </Grid>

and i have this in my .cs

private doubl teste;
public double Teste
{
  get
      {return this.Teste = teste;}
  private set
      {this Teste = value}
}

void OnTapGestureTapped(object sender, EventsAgrs e)
{
    Class_A class_a = new Class_A();
    class_a = MethodCallingService(parameter1, parameter2); ==> this ok
    foreach(var item in class_a)
    {
        teste = item.Valor;
    }
}

public class Class_A : List<Class_B>
{}

public class Class_B
{
    public string Nome { get; set; }
    public double Valor { get; set; }
}

i need to set text property for label. How? I tried this way and isn't work. Text is missed.

<Label Text="{Binding Teste}".... />


Method repeatedly called -- messages to blame?

$
0
0

The client did not want to use an MVVM frameworks so much of my navigation from ViewModel classes is by way of messaging (as is my display of alert boxes) Mostly this works great, however, I do have a problem. When I show an alert, the first time it shows once, but the second time it shows 3 times, and then 8 and then 14. Tracing, I see that all the methods are being called again and again, which is firing off the message again and again.

Is this a known problem? Any suggestions on how to stop it?

Solve the msg Xamarin.Forms.Xaml.XamlParseException:

$
0
0

please help me
When executed, the error message appears
Xamarin.Forms.Xaml.XamlParseException:
vs2017 --- xamarin.forms
xamarin.android
Thank

Cannot debug on android phone

$
0
0

Until a recent update of Xamarin, we have not had any trouble debugging our android app on our Samsung A300FU test device, but now it will not work.

We have tried deleting Mono Shared Runtime & Xamarin.Android APIs from the phone to no avail. We've also tried deleting the bin & obj folders, rebuilding the solution and restarting the computer.

It debugs fine on an emulator, a Samsung J1, and on a Samsung A300Y that we got a lend of.

We've tried disabling Shared Runtime, but no go.

What's really strange is that when we try a different project (e.g. Xamarin Phoneword example), we can debug on our A300FU no problem.

Our project and our test device therefore seem to have fallen out with each other, as all other combinations work no problem.

Here is a screenshot of our Android Options:

Here is a screenshot of our visual studio setup

Anyone got any ideas on what else we can try?

Returning to a Xamarin.Forms View from Platform-Specific PageRenderer

$
0
0

Hi all,

I'm currently exploring using ARKit (iOS) and ARCore (Android) in a Xamarin.Forms project. Since Augmented Reality is platform-dependent and doesn't appear to be exposed in the Forms API yet (unless I'm mistaken), I've opted to implement a platform-specific page renderer for the page I want to leverage AR functionality. Using PageRenderers, I am able to easily present the platform-specific view. However, after finishing platform-dependent work on this new view, I would like a button on screen to return to a new view that is shared by both platforms.

i.e - FormsPage1 > FormsPage2 > PlatformPage > FormsPage3

[assembly:ExportRenderer(typeof(ARSandbox.Views.ARSandboxPage), typeof(ARSandbox.iOS.ARSandboxPageRenderer))]
namespace ARSandbox.iOS
{

    public class ARSandboxPageRenderer : PageRenderer, IARSCNViewDelegate
    {

        /* Lots of neat AR Code for iOS */

        FinishedButton.TouchUpInside += (sender, e) =>
        {
            // TODO: return to a new Xamarin.Forms page
        };

Whats the best way to achieve this? I am using Prism.Forms and an MVVM pattern if it helps

Basic Command Binding not working with .NET Standard

$
0
0
  • Create a new Master Detail Project template then replace About pagecommand code with basic Debug.WriteLine("Hello Command")
  • Deploy to android (API 24)
  • goto about page and click button
  • command will not fire

This is a general issue i have encountered, this is just the easiest way to reproduce, without custom code snippets.

VS 15.5.4
XF 2.5.0.122203
Android Compile with Oreo (Min target API 21)

NB: This event will fire when deployed to UWP

Receive event when context menu appears?

$
0
0

It is easy to show a context menu after a long press on an item in a ListView.

However, imagine a scenario where we have items A, B, C and D in our ListView and item C happens to be the selected item. The item has a highlight colour.

If we long press on, say, item A, the context menu appears, but item C is still highlighted in the ListView.

Has anybody managed to resolve this anomaly?

I would like to have an event that is fired when the context menu appears. That way, I could manually select the item that was long pressed. It would appear clean to the user.

Thank you for any suggestions or ideas on this issue.

Xamarin.Auth, version 1.5.0, error when linking assemblies is enabled, on android (RELEASE)

$
0
0

I am getting the error, in release:

error XA2006: Could not resolve reference to 'System.Void Android.Support.CustomTabs.CustomTabsIntent::(Android.Content.Context,Android.Net.Uri)' (defined in assembly 'Xamarin.Auth, Version=1.5.0.0, Culture=neutral, PublicKeyToken=null') with scope 'Xamarin.Android.Support.CustomTabs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. When the scope is different from the defining assembly, it usually means that the type is forwarded. ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Android.Support.CustomTabs.CustomTabsIntent::LaunchUrl(Android.Content.Context,Android.Net.Uri)

I am using Xamarin.Forms version 2.3.3.193 and CustomTabs vercion 23.3.0

This only happens when I linking the assemblies and on release mode. In debug its working properly!

Maybe Xamarin.Auth bug? or maybe I am doing something wrong?


No -tsa or -tsacert is provided and this jar is not timestamped. Without a timestamp users may not

$
0
0

Hi,
I am struggling with the following error when i run the xamarin forms in the android environment.

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Warning: 1. No -tsa or -tsacert is provided and this jar is not timestamped Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (2047-04-07) or after any future revocation date. (C2C.Droid)

Can any one please help me out this. My iOS project is working fine and android deployment and build was successful my android white screen and suddenly app got stopped

Given Key Not Present in Dictionary Xamarin Forms

$
0
0

I Have a Login ViewModel something like this below

public class LoginViewModel : ViewModelBase
    {

        private readonly IAuthenticationService _authenticationService;

        public LoginViewModel(IAuthenticationService authenticationService)
        {
            _authenticationService = authenticationService;
        }
  } 

And i'm Binding like this in XAML

<ContentPage.BindingContext>
    <viewModels:LoginViewModel />
</ContentPage.BindingContext>

When i Compile i'm getting "Given Key Not Present in Dictionary"

But when i add an Empty Constructor to My ViewModel like this

      public LoginViewModel ()
            {

            }

It working fine ,so is there any workaround for this other than instantiating from Code behind of my ViewPage ?

Text Missing from Page when shown with PushAsync but visible when shown with PushModalAsync

$
0
0

Has anyone come across this issue with Xamarin Forms (2.5.0.122203) where Labels and other text don't show on a child page of a NavigationPage when it's invoked via Navigation.PushAsync but it works fine when invoked via Navigation.PushModalAsync?

I have a video of the issue in action here youtu.be / c24s76nIp1s
(Sorry, had to space it becuase I need to be around for a little while longer!!)

I have tried downgrading Xamarin Forms to 2.4 but the issue persists!

Change DatePicker minimum width 296 to lesser width.

$
0
0

The DatePicker does not resize when width is smaller than 296. It will be cutoff. What is the possible workaround to correct it?

How i can reduce size or stream of image in xamarin forms?

$
0
0

var file = await Plugin.Media.CrossMedia.Current.PickPhotoAsync(new Plugin.Media.Abstractions.PickMediaOptions
{
PhotoSize = Plugin.Media.Abstractions.PhotoSize.Medium
});

    if (file == null)
        return;


    AppApplication.Instance().NewImage = file.GetStream();

    ProfileIcon.Source = ImageSource.FromStream(() =>
    {
        var stream = file.GetStream();
        file.Dispose();
        return stream;
    });

I am trying to reduce size of image which i am selecting from gallery using Plugin.media
How i can reduce size or stream of image in xamarin forms?

How to show Animation in Page Transitions ?

$
0
0

Hi All,

I'm building a XForms app where I'm using Tabbed Page control.
But while Navigating to another page the transition of the space occupied by tabbed page is observable quite clearly which actually looks kind of odd.
So what I was thinking is to implement some Animation kind of thing which will hide this transition of the tabbed page space.

What I need is to show some kind of Animation while transition(navigation) happens from the Tabbed page to Another & vice-versa.
Any help would be appreciated.

Thanks,
Priyabrata

Microsoft azure login page

$
0
0

Is there any way to customize the azure AD login page with company branding.


Master Detail Page Back Button

$
0
0

At first, I made my project using this site
And i can navigate ohter pages through master(hamburger menu)

This is my question.
If i tapped a row of datagrid at ClientPage, it will navigate to ClientDetailPage.
And i can return ClientPage by clicked Navigation Back Button, But!! Hambuger menu icon is disappeared...

//MainPage.xaml
public MainPage()
{
InitializeComponent();
IsPresented = false;
menuList = new List();

            var page1 = new MasterPageItem() { Title = "Client Management", Icon = "ic_import_contacts_black.png", TargetType = typeof(CleintManagementView) };
            var page2 = new MasterPageItem() { Title = "WOD Management", Icon = "", TargetType = typeof(WODManagementView) };
            var page3 = new MasterPageItem() { Title = "Statics", Icon = "", TargetType = typeof(Statics) };

            menuList.Add(page1);
            menuList.Add(page2);
            menuList.Add(page3);

            MenuList.ItemsSource = menuList;
            Detail = new NavigationPage((Page)Activator.CreateInstance(typeof(CleintManagementView)));
}
        #region MasterDetail MenuList Selected
        private void MenuList_ItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            var item = (MasterPageItem)e.SelectedItem;
            Detail = new NavigationPage((Page)Activator.CreateInstance(item.TargetType));
           IsPresented = false;
        }

//ClientPage
private void dataGrid_GridDoubleTapped(object sender, Syncfusion.SfDataGrid.XForms.GridDoubleTappedEventsArgs e)
{
var masterDetail = App.Current.MainPage as MasterDetailPage;
var nav = new NavigationPage();

            var nextPage = new ClientManagementDetailView();
            var selected = e.RowData as People;
            nextPage.BindingContext = selected;
            nextPage.PassContext();
            masterDetail.Detail.Navigation.PushAsync(nextPage);
        }

ClientPage

ClientPage->Double Tapped->ClientDetailPage

Hamburger menu is disappeared..

Facebook & Google Login with Xamarin Forms using Xamarin.Auth

$
0
0

I know this should be trivial, but I haven't found a working example of loggin in using facebook or google for Xamarin Forms using Xamarin.Auth
Can anyone share a working project or point me to a repository with a working example?

How can I make a website, android and ios app.

$
0
0

Hi, new to the platform.

I see how to do the android and ios, how do I also build a website app that shares code with android and ios via Xamarin.

Thank you for answering what is probably a silly question.

Xamarin.Forms with Mono.Android 8.0

$
0
0

I seems Xamarin.Forms don't support Mono.Android 8.0? Upgrading Android support libraries to 26.x.x (API level 26 = 8.0 Oreo) because Xamarin.forms seems to have a strict dependency to 25.x.x.
Example:
When trying to upgrade Xamarin.Android.Support.Design to 26.1.0.1 the following error occurs:
"Version conflict detected for Xamarin.Android.Support.Compat. Reference the package directly from the project to resolve this issue.
TestApp.Android -> Xamarin.Android.Support.Design 26.1.0.1 -> Xamarin.Android.Support.Compat (= 26.1.0.1)
TestApp.Android -> Xamarin.Android.Support.v4 25.4.0.2 -> Xamarin.Android.Support.Compat (= 25.4.0.2)."

And also, if you look at the dependencies for the Xamarin.Forms nuget package, MonoAndroid 8.0 isn't even listed. Why is that? And what can I do to use API level 26 support libraries in XF?

push notification re launches app in android

$
0
0

Hi,

I'm using the Xam.Plugin.Pushnotification package to implement cross platform push notification.
It works fine on the iOS build and works mostly on the Android build.

In iOS if a notification comes in, app loads and then a prompt opens offering to tell the user more information. This occurs in foreground and background, provided the app is running.

On Android, the prompt will load if the app is in the forground.

The issue I'm having is that if a push notification comes in while the app is not in the foreground (but still running in background), when the user selects the notification the app will fully relaunch.

As such it won't get the message that it's been started by the push notification and I can't show my prompt and redirect the client.

I've checked the permissions in the manifest and as far as I can tell they are all set, WakeLock is turned on etc.

Has anyone else experiences this? The behaviour I'm looking for is for the app to just take focus and the prompt to load via the OnMessage function

Michael

Viewing all 58056 articles
Browse latest View live


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