This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FreakySignatureCanvasView : View | |
{ | |
#region Events | |
public event EventHandler StrokeCompleted; | |
public event EventHandler Cleared; | |
public event EventHandler<ImageStreamRequestedEventArgs> ImageStreamRequested; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8" ?> | |
<ContentPage | |
x:Class="Samples.MainPage" | |
xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | |
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:samples="clr-namespace:Samples" | |
x:DataType="samples:MainViewModel"> | |
<ListView | |
CachingStrategy="RecycleElementAndDataTemplate" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Text; | |
using System.Windows.Input; | |
using NDEF.MAUI; | |
using NDEF.MAUI.Interfaces; | |
public class MainViewModel : BaseViewModel | |
{ | |
private readonly INfcService nfcAdapter; | |
private string stringData; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using CoreNFC; | |
using NDEF.MAUI.Enums; | |
using NDEF.MAUI.Interfaces; | |
using UIKit; | |
public class NfcService : INfcService | |
{ | |
public async Task SendAsync(byte[] bytes) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Android.App; | |
using Android.Content; | |
using Android.Nfc; | |
using Android.Nfc.Tech; | |
using Android.OS; | |
using Application = Microsoft.Maui.Controls.Application; | |
using NDEF.MAUI.Enums; | |
using static Android.Nfc.NfcAdapter; | |
using NDEF.MAUI.Interfaces; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface INfcService | |
{ | |
/// <summary> | |
/// Configuration for NFC service | |
/// </summary> | |
public void ConfigureNfcAdapter() | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SessionDelegate : NFCNdefReaderSessionDelegate | |
{ | |
private readonly byte[] bytes; | |
public TaskCompletionSource<NfcTransmissionStatus> WasDataTransmitted { get; set; } | |
public SessionDelegate(byte[] bytes) | |
{ | |
this.bytes = bytes; | |
WasDataTransmitted = new TaskCompletionSource<NfcTransmissionStatus>(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>NFCReaderUsageDescription</key> | |
<string>This application wants to access NFC</string> | |
</dict> | |
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>com.apple.developer.nfc.readersession.formats</key> | |
<array> | |
<string>NDEF</string> | |
<string>TAG</string> | |
</array> | |
</dict> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[MetaData(NfcAdapter.ActionTechDiscovered, Resource = "@xml/nfc_tech_filter")] | |
[IntentFilter(new[] { NfcAdapter.ActionTechDiscovered }, Categories = new[] { Intent.CategoryDefault }, DataMimeType = "text/plain")] | |
[IntentFilter(new[] { NfcAdapter.ActionNdefDiscovered }, Categories = new[] { Intent.CategoryDefault }, DataMimeType = "text/plain")] | |
[IntentFilter(new[] { NfcAdapter.ActionTagDiscovered }, Categories = new[] { Intent.CategoryDefault }, DataMimeType = "text/plain")] | |
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, Exported = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] | |
public class MainActivity : MauiAppCompatActivity | |
{ | |
public TaskCompletionSource<Tag> NfcTag { get; set; } |
NewerOlder