Пример #1
0
 private static void SpineInitializer()
 {
     if (!ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
     {
         return;
     }
     try
     {
         var spineClass = new SpineClass();
         spineClass.InitializeCallingInfoAsync();
     }
     catch (Exception e1)
     {
         Debug.WriteLine(e1);
     }
 }
Пример #2
0
        private async void EllipseTapped()
        {
            try
            {
                var image1 = new BitmapImage();

                //Initializing a new instance of FileOpenPicker
                var fp = new FileOpenPicker
                {
                    ViewMode = PickerViewMode.Thumbnail,
                    SuggestedStartLocation = PickerLocationId.PicturesLibrary
                };
                fp.FileTypeFilter.Add(".jpeg");
                fp.FileTypeFilter.Add(".png");
                fp.FileTypeFilter.Add(".jpg");
                // Using PickSingleFileAsync() will return one storage file which can be saved into an object of storage file class.
                var storagefile = await fp.PickSingleFileAsync();

                if (storagefile == null)
                {
                    return;
                }
                // Adding bitmap image object to store the stream provided by the object of StorageFile defined above.BitmapImage bmp = new BitmapImage();

                // Reading file as a stream and saving it in an object of IRandomAccess.
                var stream = await storagefile.OpenAsync(FileAccessMode.Read);

                var stream1 = await storagefile.OpenReadAsync();

                // Adding stream as source of the bitmap image object defined above
                await image1.SetSourceAsync(stream);

                ProfileImageSource = image1;

                SpineClass.ImagetoIsolatedStorageSaver(stream1, "profiledefault.jpg");
                RaisePropertyChanged(() => ProfileImageSource);
                stream.Dispose();
                stream1.Dispose();
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
                var messageDialog = new MessageDialog(ex.ToString());
                await messageDialog.ShowAsync();
            }
        }
Пример #3
0
        private async void TimerStarter()
        {
            SosPageText += "Timer Started \n";
            RaisePropertyChanged(() => SosPageText);
            var timer = new DispatcherTimer();

            timer.Interval = TimeSpan.FromSeconds(300);
            timer.Tick    += timer_Tick;
            timer.Start();

            if (!ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
            {
                return;
            }
            var spineClass = new SpineClass();

            spineClass.InitializeCallingInfoAsync();
        }