예제 #1
0
        /// <summary>App constructor with MSFTBand.</summary>
        /// <param name="BandClient">Band client instance</param>
        public App(BandClientInterface BandClient)
        {
            /// Xamarin
            this.InitializeComponent();

            /// Render launch page
            this.LaunchPage = new LaunchPage();
            this.MainPage   = this.LaunchPage;

            /// Launch app
            this.Launch(BandClient);
        }
예제 #2
0
        /// <summary>Get Band connection and render main page.</summary>
        /// <param name="BandClient">Band client instance</param>
        protected async void Launch(BandClientInterface BandClient)
        {
            try {
                // Connect to Band
                this.BandClient = BandClient;
                this.Band       = (await this.BandClient.GetPairedBands())[0];
                await this.Band.Connect();

                // Render main page!
                this.MainPage = new MainPage(this.Band);
            }
            catch (Exception) {
                this.LaunchPage.DisplayError();
            }
        }