C# Class HueApp.Initializer

Handles inital loading of Hue resources (including the bridge and lights), and displaying an extended splash screen to the user while the app prepares.
Afficher le fichier Open project: Microsoft/Windows-appsample-huelightcontroller Class Usage Examples

Protected Properties

Свойство Type Description
rect Windows.Foundation.Rect
rootFrame Windows.UI.Xaml.Controls.Frame
splash Windows.ApplicationModel.Activation.SplashScreen

Méthodes publiques

Méthode Description
Initializer ( SplashScreen splashscreen ) : HueLibrary

Constructor for the initializer. This displays an extended splash screen and progress ring while the app loads the bridge, lights, and Cortana.

Private Methods

Méthode Description
Current_SizeChanged ( object sender, WindowSizeChangedEventArgs e ) : void

Fires when the user changes the size of the app window to adjust the image and progress ring positioning.

DispatchAwaitableUITask ( Func task ) : System.Threading.Tasks.Task

Utility method for awaiting calls sent to the UI thread via the dispatcher. Used to display popups on the UI thread from a background thread and wait for user input before proceeding.

FindBridgeAsync ( ) : System.Threading.Tasks.Task

Tries to find the bridge using multiple methods. Note: this is not an exhaustive list of discovery options. For complete guidance, see http://www.developers.meethue.com/documentation/hue-bridge-discovery

FindLightsAsync ( ) : System.Threading.Tasks.Task

Tries to find lights on the network.

Initialize ( SplashScreen sender, object args ) : void

Prepares the app for use by finding the bridge and lights, and initalizing Cortana.

InitializeCortanaAsync ( ) : System.Threading.Tasks.Task

Prepares Cortana for background use.

PrepareBridgeAsync ( int attempts ) : Task

Checks whether the bridge is reachable and the app is authorized to send commands. If the bridge is reachable but the app isn't authorized, it prompts the user to register it.

ReportErrorAsync ( string message ) : System.Threading.Tasks.Task

Displays a popup to the user indicating an error occured.

SaveBridgeToCache ( ) : void

Saves bridge information to the app's local storage so the app can load faster next time.

SetImage ( ) : void

Sets the extended splash screen image. Called on first load and if the app window is resized by the user.

Method Details

Initializer() public méthode

Constructor for the initializer. This displays an extended splash screen and progress ring while the app loads the bridge, lights, and Cortana.
public Initializer ( SplashScreen splashscreen ) : HueLibrary
splashscreen Windows.ApplicationModel.Activation.SplashScreen
Résultat HueLibrary

Property Details

rect protected_oe property

protected Rect,Windows.Foundation rect
Résultat Windows.Foundation.Rect

rootFrame protected_oe property

protected Frame,Windows.UI.Xaml.Controls rootFrame
Résultat Windows.UI.Xaml.Controls.Frame

splash protected_oe property

protected SplashScreen,Windows.ApplicationModel.Activation splash
Résultat Windows.ApplicationModel.Activation.SplashScreen