GithubHelp home page GithubHelp logo

xamarin-forms-camera's People

Contributors

jlandersen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

xamarin-forms-camera's Issues

Xamarin.android

I need to implement auto capture image without user interaction after some seconds. help me
lrfit

It Crash when i go to the page selected

It compile but when i go to this page,the page ,where there is the fab that had to call all the stuff with the binding it crash
@jlandersen

`using Sport.Pagine.Login;
using Sport.Services;
using Sport.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

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

namespace Sport.Pagine
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class Account : ContentPage
{
public User Current { get; set; }

    public Account()
    {
        NavigationPage.SetHasNavigationBar(this, false);

        Current = App.CredentialsService.GetCurrentUser();

        BindingContext = Current;

        InitializeComponent();

        BindingContext = new TakePictureViewModel(DependencyService.Get<ICameraProvider>()); ;
        
    }

    private async Task OnDeleteAccount(object sender, EventArgs e)
    {

        if (!DatabaseManager.IsOnline())
            await DisplayAlert("No connection", "Impossible to delete the account", "Ok");
        else
        {
            var answer = await DisplayAlert("Are you sure you want to delete your account?", "All your items and settings will be permanently deleted", "Yes", "No");

            if (answer)
            {
                var items = await DatabaseManager.DefaultManager.GetItemsAsync("allItems");

                foreach (var i in items)
                {
                    if (i.UserId.Equals(App.CredentialsService.Id))
                        await DatabaseManager.DefaultManager.DeleteTaskAsync(i);
                }

                await DatabaseManager.DefaultManager.DeleteUserParticipations(Current);

                await DatabaseManager.DefaultManager.DeleteUserAsync(Current);

                await DisplayAlert("Account deleted", "Now you will be logged out", "OK");

                MasterDetailPage1.OnLogoutButtonClicked();
            }
        }
        
    }

    private async Task OnSaveChanges(object sender, EventArgs e)
    {

        if (!DatabaseManager.IsOnline())
            await DisplayAlert("No connection", "Impossible to delete the account", "Ok");
        else
        {
            //Current.Name = entryName.Text;
            //Current.Email = entryEmail.Text;

            await DatabaseManager.DefaultManager.InsertUserAsync(Current);

            App.CredentialsService.DeleteCredentials();

            App.CredentialsService.SaveCredentials(Current);

            await DisplayAlert("Settings saved", "Your settings have been saved", "OK");

            await Navigation.PopAsync();
        }

    }
}

}

<ContentPage.Content>





<controls:CircleImage Source="{Binding Picture}" WidthRequest="65" HeightRequest="65" Aspect="AspectFit" HorizontalOptions="CenterAndExpand" VerticalOptions="Start"/>


<fab:FloatingActionButtonView
ImageName="camera.png"
x:Name="FloatingActionButtonAdd"
ColorNormal="Transparent"
ColorPressed="Transparent"
ColorRipple="Transparent"
IsVisible="True"
HorizontalOptions="End"/>











        <StackLayout VerticalOptions="Center" Margin="20">
            <Button Text="SAVE CHANGES" BackgroundColor="Blue" TextColor="White" FontSize="Medium" HorizontalOptions="Center" VerticalOptions="Center" Clicked="OnSaveChanges"/>
        </StackLayout>
        <StackLayout VerticalOptions="Center" Margin="20">
            <Button Text="DELETE ACCOUNT" BackgroundColor="Crimson" TextColor="White" FontSize="Medium" HorizontalOptions="Center" VerticalOptions="Center" Clicked="OnDeleteAccount"/>
        </StackLayout>
    </StackLayout>
</ContentPage.Content>
`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.