public RezerviranjePopupPage(Classes.Publikacije publikacijeU)
        {
            //Inicijalizacija NFC-a
            device = DependencyService.Get <INfcForms>();

            publikacijeD = publikacijeU;
            InitializeComponent();
            if (publikacijeD.Vrsta == "Slobodno")
            {
                Naziv.Text = publikacijeD.naziv;
                GumbRezerviraj.IsVisible = true;
                GumbNFC.IsVisible        = true;
                device.NewTag           += HandleNewTag;
                GumbQRKod.IsVisible      = true;
            }
            else if (publikacijeD.Vrsta == "Rezervirano")
            {
                Naziv.Text = publikacijeD.naziv;
                GumbRezerviraj.IsVisible = false;
                GumbNFC.IsVisible        = false;
                GumbQRKod.IsVisible      = false;
                Prikaz.Text = "Odabrana kopija je rezervirana!";
                DohvatiPublikaciju(publikacijeD.Kopija);
            }
            else if (publikacijeD.Vrsta == "Posudeno")
            {
                Naziv.Text = publikacijeD.naziv;
                GumbRezerviraj.IsVisible = false;
                GumbNFC.IsVisible        = false;
                GumbQRKod.IsVisible      = false;
                Prikaz.Text = "Odabrana kopija je posuđena!";
                DohvatiPublikaciju(publikacijeD.Kopija);
            }
        }
Exemplo n.º 2
0
        public override void Activate()
        {
            base.Activate();
            INfcForms device = DependencyService.Get <INfcForms>();

            device.NewTag += HandleNewTag;
        }
 public NfcReadPatientTagViewModel(INavigationService navigationService) : base(navigationService)
 {
     device             = DependencyService.Get <INfcForms>();
     patientService     = new PatientService();
     _navigationService = navigationService;
     device.NewTag     += ReadTag;
 }
Exemplo n.º 4
0
        public ScanPrompt()
        {
            InitializeComponent();
            DependencyService.Get <IOrientationHandler>().ForcePortrait();

            device                 = DependencyService.Get <INfcForms>();
            device.NewTag         += HandleNewTag;
            uxBlankButton.Clicked += uxBlankButton_Clicked;
        }
        public NfcReadDeviceTagViewModel(INavigationService navigationService) : base(navigationService)
        {
            deviceListItems          = new ObservableCollection <DeviceListItem>();
            _navigationService       = navigationService;
            deviceService            = new DeviceService();
            NfcDevice                = DependencyService.Get <INfcForms>();
            ProceedToNextPageCommand = new DelegateCommand(GoToScanPatientNfcTagPage);

            NfcDevice.NewTag += ReadTag;
        }
Exemplo n.º 6
0
        public NDEFWrite(NdefMessage NDEFPayload)
        {
            InitializeComponent();
            DependencyService.Get <IOrientationHandler>().ForcePortrait();

            device         = DependencyService.Get <INfcForms>();
            device.NewTag += HandleNewTag;

            ndefMessage = NDEFPayload;
        }
Exemplo n.º 7
0
        public NFCPage()
        {
            device = DependencyService.Get<INfcForms>();
            device.NewTag += HandleNewTag;
            device.TagConnected += device_TagConnected;
            device.TagDisconnected += device_TagDisconnected;

            Grid mainGrid = new Grid()
            {
                RowDefinitions =
                {
                    new RowDefinition { Height = new GridLength(10,GridUnitType.Star)},
                    new RowDefinition { Height = GridLength.Auto },
                    new RowDefinition { Height = GridLength.Auto },
                    new RowDefinition { Height =  new GridLength(5,GridUnitType.Star)}
                }
            };

            IsWriteable = new Switch() { HorizontalOptions = LayoutOptions.Center, IsEnabled = false };
            Label IsWriteableLabel = new Label() { Text = "Write Unlocked", HorizontalOptions = LayoutOptions.Center };

            IsConnected = new Switch() { HorizontalOptions = LayoutOptions.Center, IsEnabled = false };
            Label IsConnectedLabel = new Label() { Text = "Tag Connected", HorizontalOptions = LayoutOptions.Center };

            IsNDEFSupported = new Switch() { HorizontalOptions = LayoutOptions.Center, IsEnabled = false };
            Label IsNDEFSupportedLabel = new Label() { Text = "NDEF Support", HorizontalOptions = LayoutOptions.Center };

            NDEFMessage = new ListView();

            Button writeButton = new Button() { Text = "Write Tag" };
            writeButton.Clicked += HandleClicked;

            Label welcomeLabel = new Label
            {
                Text = "Scan an item!~~",
                XAlign = TextAlignment.Center,
                TextColor = Color.Black,
                VerticalOptions = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
            };

            welcomePanel = new StackLayout()
            {
                //TODO: Show 'a
                Children = { welcomeLabel },
                BackgroundColor = Color.White
            };

            mainGrid.Children.Add(NDEFMessage, 0, 1);
            mainGrid.Children.Add(writeButton, 0, 2);
            mainGrid.Children.Add(welcomePanel, 0, 1, 0, 4);

            Content = mainGrid;
        }
Exemplo n.º 8
0
        //constructor for card
        public CardPage(string player, string cardType, string cardLoc, string cardPos, string cardSource)
        {
            InitializeComponent();

            this.player     = player;
            this.cardType   = cardType;
            this.cardLoc    = cardLoc;
            this.cardPos    = cardPos;
            this.cardSource = cardSource;


            //init firebase
            firebase = new FirebaseClient("https://holoyugioh.firebaseio.com");
            if (!string.IsNullOrEmpty(player))
            {
                child = firebase.Child(string.Format("Game/Players/{0}/Field/{1}/{2}", player, cardType, cardLoc));
            }

            //init NFC
            device         = DependencyService.Get <INfcForms>();
            device.NewTag += HandleNewTag;



            //init source
            if (!string.IsNullOrWhiteSpace(cardSource))
            {
                card.Source = cardSource;
            }

            //remove specific buttons
            if (cardType.Equals(GameInfo.SpellTrap))
            {
                defense.IsVisible = false;
                down.IsVisible    = false;
            }
            else if (cardType.Equals(GameInfo.Monster))
            {
                set.IsVisible = false;
            }
        }
Exemplo n.º 9
0
        public NFC()
        {
            device                  = DependencyService.Get <INfcForms>();
            device.NewTag          += HandleNewTag;
            device.TagConnected    += device_TagConnected;
            device.TagDisconnected += device_TagDisconnected;

            Grid mainGrid = new Grid()
            {
                RowDefinitions =
                {
                    new RowDefinition {
                        Height = new GridLength(10, GridUnitType.Star)
                    },
                    new RowDefinition {
                        Height = GridLength.Auto
                    },
                    new RowDefinition {
                        Height = GridLength.Auto
                    },
                    new RowDefinition {
                        Height = new GridLength(5, GridUnitType.Star)
                    }
                }
            };

            Grid boolInfo = new Grid()
            {
                HorizontalOptions = LayoutOptions.CenterAndExpand,
            };

            IsWriteable = new Switch()
            {
                HorizontalOptions = LayoutOptions.Center, IsEnabled = false
            };
            Label IsWriteableLabel = new Label()
            {
                Text = "Write Unlocked", HorizontalOptions = LayoutOptions.Center
            };

            IsConnected = new Switch()
            {
                HorizontalOptions = LayoutOptions.Center, IsEnabled = false
            };
            Label IsConnectedLabel = new Label()
            {
                Text = "Tag Connected", HorizontalOptions = LayoutOptions.Center
            };

            IsNDEFSupported = new Switch()
            {
                HorizontalOptions = LayoutOptions.Center, IsEnabled = false
            };
            Label IsNDEFSupportedLabel = new Label()
            {
                Text = "NDEF Support", HorizontalOptions = LayoutOptions.Center
            };

            boolInfo.Children.Add(IsWriteable);
            boolInfo.Children.Add(IsWriteableLabel, 0, 1);

            boolInfo.Children.Add(IsConnected, 1, 0);
            boolInfo.Children.Add(IsConnectedLabel, 1, 1);

            boolInfo.Children.Add(IsNDEFSupported, 2, 0);
            boolInfo.Children.Add(IsNDEFSupportedLabel, 2, 1);

            TechList = new ListView();

            NDEFMessage = new ListView();

            Button writeButton = new Button()
            {
                Text = "Write Tag"
            };

            writeButton.Clicked += HandleClicked;

            Label welcomeLabel = new Label
            {
                Text              = "Hello, XForms!" + System.Environment.NewLine + "Scan a tag!",
                XAlign            = TextAlignment.Center,
                TextColor         = Color.Black,
                VerticalOptions   = LayoutOptions.CenterAndExpand,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
            };

            welcomePanel = new StackLayout()
            {
                Children        = { welcomeLabel },
                BackgroundColor = Color.White
            };

            mainGrid.Children.Add(boolInfo);
            mainGrid.Children.Add(TechList, 0, 1);
            mainGrid.Children.Add(NDEFMessage, 0, 2);
            mainGrid.Children.Add(writeButton, 0, 3);
            mainGrid.Children.Add(welcomePanel, 0, 1, 0, 4);

            Content = mainGrid;
        }
Exemplo n.º 10
0
 public static void NFCFormsSample()
 {
     device = DependencyService.Get <INfcForms>();
 }
Exemplo n.º 11
0
        public NfcHandlerViewModel(INavigationService navigationService) : base(navigationService)
        {
            device = DependencyService.Get <INfcForms>();

            device.NewTag += ReadTag;
        }
Exemplo n.º 12
0
        public LoginPage()
        {
            device = DependencyService.Get <INfcForms>();
            if (device != null)
            {
                device.NewTag          += HandleNewTag;
                device.TagConnected    += device_TagConnected;
                device.TagDisconnected += device_TagDisconnected;
            }

            Title = "ACCEDI";
            NavigationPage.SetHasNavigationBar(this, false);
            NavigationPage.SetHasBackButton(this, false);

            AbsoluteLayout.SetLayoutBounds(activityIndicator, new Rectangle(0.5, 0.5, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
            AbsoluteLayout.SetLayoutFlags(activityIndicator, AbsoluteLayoutFlags.PositionProportional);
            activityIndicatorLayout.Children.Add(activityIndicator);

            AbsoluteLayout.SetLayoutBounds(mainScrollView, new Rectangle(0.5, 0.5, 1, AbsoluteLayout.AutoSize));
            AbsoluteLayout.SetLayoutFlags(mainScrollView, AbsoluteLayoutFlags.PositionProportional | AbsoluteLayoutFlags.WidthProportional);
            mainAbsoluteLayout.Children.Add(mainScrollView);

            txtUsername.Text = "00302";
            txtPassword.Text = "p00302";

            usernameFrame.Content = txtUsername;
            passwordFrame.Content = txtPassword;

            mainContainer.Children.Add(usernameFrame);
            mainContainer.Children.Add(passwordFrame);
            mainContainer.Children.Add(txtforgetpassword);
            grdLogin.Children.Add(btnLogin);
            grdLogin.Children.Add(imgLogin);
            mainContainer.Children.Add(grdLogin);

            mainScrollView.Content = mainContainer;

            btnLogin.Clicked += BtnLogin_Clicked;

            Grid mainGrid = new Grid();
            Grid grid     = new Grid
            {
                RowDefinitions =
                {
                    new RowDefinition {
                        Height = new GridLength(3, GridUnitType.Star)
                    },
                    new RowDefinition {
                        Height = new GridLength(5, GridUnitType.Star)
                    },
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Star)
                    },
                }
            };

            grid.Children.Add(new Label
            {
                Text      = "KOBE",
                FontSize  = 30,
                TextColor = Color.Yellow,
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment   = TextAlignment.Center
            }, 0, 0);
            grid.Children.Add(mainAbsoluteLayout, 0, 1);
            grid.Children.Add(new BoxView
            {
            }, 0, 2);

            mainGrid.Children.Add(imagebackground);
            mainGrid.Children.Add(grid);
            Content = mainGrid;
        }
Exemplo n.º 13
0
 public App()
 {
     // The root page of your application
     device   = DependencyService.Get <INfcForms>();
     MainPage = new NavigationPage(new MenuPage());
 }