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

How to use OnPropertyElementChanges in Effects

$
0
0

How to use OnPropertyElementChanges on effects to track changes so that i update it. The trick is the properties i need to update is in the effect itself.
So i have an effect with two properties and both of them implements INotifyPropertyChanges. A provided sample would be very helpful


How to display video from database

$
0
0

Hi Xamarin forum how can I call my vid from database then into my video player

Change text in a stepper

$
0
0

I need to change the text in my stepper from + - to -5 +5.

INotifyPropertyChanged Event for nested Properties

$
0
0

Hi Guys,

i have the following situation:

OverviewPage.xaml:

 <Label>
           <Label.Triggers>
                  <DataTrigger TargetType="Label" Binding="{Binding VehicleState.Tires.TypeSelectedIndex}" Value="0">
                            <Setter Property="Text" Value="Summer" />
                  </DataTrigger>
           </Label.Triggers> > 
    </Label>

OverviewPageModel.cs has a Property:

    public VehicleStatePageModel VehicleState
    {
        get
        {
            return vehicleState;
        }
        set
        {
            vehicleState= value;
            OnPropertyChanged("VehicleState");
        }
    }

VehicleStatePageModel has a Property:

  public TiresPageModel Tires
        {
            get
            {
                return tires;
            }
            set
            {
                tires= value;
                OnPropertyChanged("Tires");
            }
        }

and TiresPageModel has a Property:

public int TypeSelectedIndex
{
get
{
return typeSelectedIndex;
}
set
{
if (typeSelectedIndex!= value)
{
typeSelectedIndex= value;
OnPropertyChanged("TypeSelectedIndex");
}
}
}

Now i have a TiresPage.xaml with a Picker whichs SelectedIndex Attribute is bound to the TypeSelectedIndex Property of TiresPageModel:

>! <Picker ItemsSource="{Binding TiresTypeList}" SelectedIndex="{Binding TypeSelectedIndex}"/>

If i change the value of the Picker the "OnPropertyChanged-Event" of the TypeSelectedIndex Property gets called.

But in my OverviewPage.xaml from the very first code snipped this binding:

>!  Binding="{Binding VehicleState.Tires.TypeSelectedIndex}"

dont gets refreshed.

Why is that?
Thanks, Gelatto

Why xamarin website is not loading

$
0
0

xamarin website is not loading any reason
developer.xamarin. dotcom/samples-all/

Best practices to download large files in Xamarin.forms app

$
0
0

I have a requirement to download large files (2-3gb's) in my app. Anyone please suggest the best practice to implement.

Plugin.InAppBilling.Abstractions.InAppBillingPurchaseException: Cannot connect to iTunes Store

$
0
0

Getting this error while login with sandbox tester. Can anyone please help me out of this..

AndroidRuntimeException with ZXing.Net.Mobile

$
0
0

I have an app for barcode scanning. It scans successfully for a long time. It scans 100 times with success, then suddenly it crashes.

The exception is AndroidRuntimeException: Only the original thread that created a view hierarchy can touch its views.

Then I don't understand much of the exception. Link to full exception: https://hastebin.com/owerixihag.log

I have made sure to use Device.BeginInvokeOnMainThread() for UI operations.

ScannerPage.xaml

<zxing:ZXingScannerView x:Name="ScannerView"
    Result="{Binding ScanResult, Mode=OneWayToSource}"
    ScanResultCommand="{Binding ScanResultCommand}"
    IsScanning="{Binding IsScanning}"
    IsAnalyzing="{Binding IsAnalyzing}" />
<zxing:ZXingDefaultOverlay x:Name="ScannerOverlay"
    BottomText="Scanning will happen automatically"
    ShowFlashButton="False"/>

ScannerPageViewModel.cs (stripped of irrelevant parts)

[PropertyChanged.AddINotifyPropertyChangedInterface]
internal class ScannerPageViewModel : INavigatedAware
{
    public ScannerPageViewModel(IScannerService scannerService, IUserDialogs dialogs, IPopupNavigation popups, IScreenService screen)
    {
        ScanResultCommand = new Command(ProcessBarcode);
    }

    public ICommand ScanResultCommand { get; }

    /// <summary>
    /// Show info dialog box with ticket info.
    /// </summary>
    private async Task ShowInfoScanResult(string message)
    {
        var popup = new PopupViews.InfoScanResult(Popups, message);
        popup.Disappearing += (se, ev) => IsAnalyzing = true;
        await Popups.PushAsync(popup);
    }

    private void ProcessBarcode()
    {
        Device.BeginInvokeOnMainThread(async () =>
        {
            if (ScanResult != null && !string.IsNullOrEmpty(ScanResult.Text))
            {
                // Disable the scanner after one barcode is found.
                IsAnalyzing = false;

                var source = new CancellationTokenSource();

                // Show loading animation if scanning takes >1 second.
                var t = Task.Run(async () =>
                {
                    await Task.Delay(1000, source.Token);
                    Device.BeginInvokeOnMainThread(ShowLoading);
                });

                // Call the web service to process the barcode.
                var scanResponse = await ScannerService.ScanBarcode(ScanResult.Text, ScanningSession, SelectedScanAction);

                if (scanResponse.IsSuccessful)
                {
                    var scanResult = scanResponse.Data;
                    if (scanResult.Success)
                    {
                        var json = scanResult.BarcodeInfo;
                        var message = ParseJsonBarcodeInfo(json);

                        if (SelectedScanAction == ScanAction.Information)
                            await ShowInfoScanResult(message);
                        else
                            await ShowOkScanResult(message);
                    }
                    else
                    {
                        await ShowErrorScanResult(scanResult.FaultDescription);
                    }
                }
                else
                {
                    ShowScanRequestError(scanResponse.ErrorMessage);
                }

                source.Cancel(); // Cancel loading animation timer.
                HideLoading();
                Screen.SetFullscreen();
                source.Dispose();
            }
        });
    }

Disable device back button

$
0
0

Hi all.

Any one know how to disable device back button in xamarin forms app?

Thanks
Lasantha

Is possible to avoid slow startup time of xf app on Android in this way?

$
0
0

I made a big xamarin form app for ios and android, all is working great, but on Android app take till 8 seconds to starts.
I already try to use XAML Compilation and AOT...the AOT gain 2seconds, but it double the size of my apk, so is not a solution for my needs.

My question:
If I try to:
- rewrote only the first page in xamarin android
- start the app in native way
- while first view is shown, init the xamarin form engine (using callback, timers or in other async way) and after the init use only xf page
the startup time for my xamarin android app should be better?

Thanks for answer
Matteo

how to disable or remove copy and back icon from the Xamarin forms picker

$
0
0

I have a picker with 3 options , when it slides up, it comes with previous , next and copy icon, when clicked on copy icon, previous and next button gets activated and on click of those, app crashes

how to solve dis???
please give inputs

thanks in advance

Persistent warnings

$
0
0

What is the cause of these warnings?

I'm having these error because I trying to do this https://github.com/HoussemDellai/BottomBar-Xamarin-Forms, the most annoying part is it's persistence. I can't deploy my application because of these warnings.
I already clean and rebuild the solution, already update the package, already restart my IDE.

Can anyone explain this to me?
Thanks in advance :)

How to update the UI label value from backend page without refreshing the page?

$
0
0

Hey,
I am working on a project where in xaml page it has a label and by binding the property associate value is showing.
There is an entry field that accepts the value and send to server and in the label value that data is being fetched and showing.
I want that old label value always be updated when the property value is updated at back end or in server without refreshing the whole page.
Help me.

Connect to sql Server

$
0
0

I need connect to sql server resident on local server

Can anyone help me?

Thanks

i use:
string connectionString = @Server=192.168.1.22;Database=DB_DATI_UBIK_STORE_PRO;User Id=sa;Password=bladerunner;Trusted_Connection=true;

but i recive this error:

exception = {System.Data.SqlClient.SqlException (0x80131904): Specified method is not supported.
at Interop+NetSecurityNative.ImportPrincipalName (Interop+NetSecurityNative+Status& minorStatus, System.String inputName, System.Int32 inputNameByteCount, Microsoft.Win32...

THANKS

Sizing with Rotation in a Grid incorrect

$
0
0

Anytime I place an element with a rotation in a grid, the sizing of the grid space seems to be calculated pre-rotation.

I'm using the latest Xamarin.Forms, and this problem has existed for a while. I was wondering if there was a work around?


Is it possible to access a locally running api from the iOS Simulator all from Windows?

$
0
0

I have an API server project running on my local windows machine (at the moment just running on a localhost address, can be changed).
I am then trying to test my Xamarin Forms app which tries to connect to this API on the iOS simulator.

How is it best to do this?

From googling I have found that if I was doing this all from the Mac it might just work? But how do I get this to work from Windows? If I run the UWP app, it all works as expected, because it is running all on my machine.

At present I am having to publish my API and access it that way, but that isn't the ideal way, just seems unnecessary when I'm trying to test things quickly with debugging.

Erroe in android debug with a missing moethod

$
0
0

I have this error in android device, in the App.xaml.g.cs

"System.MissingMethodException: System.Func`2<string, string> Xamarin.Forms.Internals.ResourceLoader.get_ResourceProvider()
"

Anyone know something about it?

How to resize images ?

$
0
0

I am using absolute layout but i can't resize image. It keeps the original size.

Sliding Cards In Xamarin.Forms

$
0
0
I have a Xamarin project and I need it to look exactly like this:

And also implement a search bar
I was thinking that the page could be a stack layout and the bottom with scrolling cards could be a carousel view, with user controls that allow changing The text (the text should be on entrys) and a XML file should have this data so it could deserialize it and show it in the user control's entrys. Also I need that when you search something, like in the photo, the other cards disappear and only display the searched. The problem here is that i dont know what kind of control I need to use, and controls that work in all platforms

Carousel design with auto move

$
0
0

Hi All,
It would be really appreciated if someone guides me to design this

Carousel for a set of images with an auto move and user able to move by using the finger.

Viewing all 77050 articles
Browse latest View live