View NotificationMessageGeneric.cs
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
namespace Microsoft.Toolkit.Mvvm.Messaging.Messages | |
{ | |
public sealed class NotificationMessage<T> | |
{ | |
public NotificationMessage(T content, string notification) | |
{ | |
Content = content; | |
Notification = notification; | |
} |
View BluetoothTest.cs
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
var devices = DeviceInformation.FindAll(RfcommDeviceService.GetDeviceSelector(RfcommServiceId.SerialPort)); | |
var deviceInfo = devices[0]; // this makes some assumptions about your paired devices so really the results should be enumerated and checked for the correct device | |
var device = BluetoothDevice.FromDeviceInformation(deviceInfo); | |
var serResults = device.GetRfcommServices(BluetoothCacheMode.Cached); | |
foreach(RfcommDeviceService serv in serResults.Services) | |
{ | |
if(serv.ServiceId == RfcommServiceId.SerialPort) | |
{ | |
var stream = serv.OpenStream(); | |
byte[] buff = System.Text.Encoding.ASCII.GetBytes("Testing\r\n"); |
View BluetoothComPort.cs
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.Collections.Generic; | |
using System.Diagnostics; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
namespace BluetoothDiagnostics | |
{ | |
public sealed class BluetoothComPort | |
{ |
View App.xaml.cs
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 App() | |
{ | |
this.InitializeComponent(); | |
this.Suspending += OnSuspending; | |
_watcher = new BluetoothLEAdvertisementWatcher(); | |
_watcher.Received += _watcher_Received; | |
_watcher.Start(); | |
} |
View BrightnessHelper.cs
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 static class BrightnessHelper | |
{ | |
public static void SetBrightness(uint brightness) | |
{ | |
if (brightness > 100) | |
{ | |
throw new ArgumentOutOfRangeException("brightness"); | |
} | |
// get handle to primary display |
View BluetoothImagingMinorClass.cs
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 Windows.Devices.Bluetooth; | |
namespace InTheHand.Devices.Bluetooth | |
{ | |
/// <summary> | |
/// Defines missing values in the <see cref="BluetoothMinorClass"/> enumeration for devices with a <see cref="BluetoothClassOfDevice.MajorClass"/> of Imaging. | |
/// </summary> | |
[Flags] | |
public enum BluetoothImagingMinorClass |
View MainPage.xaml
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 xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:local="clr-namespace:MediaPlayerSample" | |
xmlns:forms="clr-namespace:InTheHand.Forms;assembly=InTheHand.Forms" | |
x:Class="MediaPlayerSample.MainPage"> | |
<StackLayout> | |
<forms:MediaElement HorizontalOptions="Fill" VerticalOptions="Center" HeightRequest="240" x:Name="Media" AreTransportControlsEnabled="true" Source="http://video.ch9.ms/ch9/334f/891b78a5-642d-40b4-8d02-ff40ffdd334f/LoginToLinkedinUSingXamarinAuth_mid.mp4"/> | |
</StackLayout> | |
</ContentPage> |
View MainPage.xaml
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
<Page | |
x:Class="DialASketch.MainPage" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:local="using:DialASketch" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
mc:Ignorable="d"> | |
<Page.TopAppBar> | |
<CommandBar> |
NewerOlder