public void Start() { Windows.ApplicationModel.Core.CoreApplicationView mainView = Windows.ApplicationModel.Core.CoreApplication.MainView; Windows.UI.Core.CoreWindow cw = mainView.CoreWindow; coreDispatcher = cw.Dispatcher; }
private async void viewActivated(CoreApplicationView sender, IActivatedEventArgs args1) { FileOpenPickerContinuationEventArgs args = args1 as FileOpenPickerContinuationEventArgs; if (args != null) { if (args.Files.Count == 0) return; view.Activated -= viewActivated; StorageFile storageFile = args.Files[0]; var stream = await storageFile.OpenAsync(Windows.Storage.FileAccessMode.Read); var bitmapImage = new Windows.UI.Xaml.Media.Imaging.BitmapImage(); await bitmapImage.SetSourceAsync(stream); var decoder = await Windows.Graphics.Imaging.BitmapDecoder.CreateAsync(stream); img.Source = bitmapImage; //PictureTags.Text = storageFile.Name; //PassPictureData.picture_view_source2 = storageFile.Name; var obj = App.Current as App; obj.exam2 = storageFile.Name; //getting data from DB ReadClothesList db_clothes = new ReadClothesList(); SeasonTxtBlck.Text = db_clothes.GetSeasonData(); CategoryTxtBlck.Text = db_clothes.GetCategoryData(); KindTxtBlck.Text = db_clothes.GetKindData(); } }
private async void viewActivated(CoreApplicationView sender, Windows.ApplicationModel.Activation.IActivatedEventArgs args1) { FileOpenPickerContinuationEventArgs args = args1 as FileOpenPickerContinuationEventArgs; if (args != null) { if (args.Files.Count == 0) return; view.Activated -= viewActivated; StorageFile storageFile = args.Files[0]; fileBytes = null; var stream = await storageFile.OpenAsync(Windows.Storage.FileAccessMode.Read); var bitmapImage = new Windows.UI.Xaml.Media.Imaging.BitmapImage(); await bitmapImage.SetSourceAsync(stream); fileBytes = new byte[stream.Size]; await stream.ReadAsync(fileBytes.AsBuffer(), (uint)stream.Size, Windows.Storage.Streams.InputStreamOptions.None); var decoder = await Windows.Graphics.Imaging.BitmapDecoder.CreateAsync(stream); imageDp.Source = bitmapImage; imageDp.Height = CoreApplication.GetCurrentView().CoreWindow.Bounds.Height; imageDp.Width = CoreApplication.GetCurrentView().CoreWindow.Bounds.Width; buttonAddImage.Content = "change image"; } }
void IFrameworkView.Initialize(CoreApplicationView applicationView) { applicationView.Activated += OnActivated; _device = game.Device as MetroGraphicsDevice; //_device = new MetroGraphicsDevice(); }
public void Initialize(CoreApplicationView applicationView) { // Setup scripting bridge m_bridge = new WinRTBridge.WinRTBridge(); appCallbacks.SetBridge(m_bridge); appCallbacks.SetCoreApplicationViewEvents(applicationView); }
private void MainPage_Activated(CoreApplicationView sender, IActivatedEventArgs args) { var openPickerArgs = args as FileOpenPickerContinuationEventArgs; if (openPickerArgs != null && openPickerArgs.Files.Count == 1) { Frame.Navigate(typeof(FramingPage), openPickerArgs.Files[0]); } }
// Use this for initialization void Start() { #if ENABLE_WINMD_SUPPORT Windows.ApplicationModel.Core.CoreApplicationView mainView = Windows.ApplicationModel.Core.CoreApplication.MainView; Windows.UI.Core.CoreWindow cw = mainView.CoreWindow; UIDispatcher = cw.Dispatcher; SignIn(); #endif }
public void Start() { Windows.ApplicationModel.Core.CoreApplicationView mainView = Windows.ApplicationModel.Core.CoreApplication.MainView; Windows.UI.Core.CoreWindow cw = mainView.CoreWindow; XboxLiveUser.SignOutCompleted += OnUserSignOut; m_uiDispatcher = cw.Dispatcher; SignInSilent(); }
/// <summary> /// The first method called when the IFrameworkView is being created. /// Use this method to subscribe for Windows shell events and to initialize your app. /// </summary> public void Initialize(CoreApplicationView applicationView) { applicationView.Activated += this.OnViewActivated; // Register event handlers for app lifecycle. CoreApplication.Suspending += this.OnSuspending; CoreApplication.Resuming += this.OnResuming; this.main = new HololensApplication(); }
protected virtual void OnActivated(CoreApplicationView sender, IActivatedEventArgs args) { if (!isActivated) { SetupServices(); isActivated = true; } ActivationManager.Activate(args); }
public virtual void Initialize(CoreApplicationView applicationView) { applicationView.Activated += ApplicationView_Activated; CoreApplication.Suspending += CoreApplication_Suspending; // Setup scripting bridge m_Bridge = new WinRTBridge.WinRTBridge(); m_AppCallbacks.SetBridge(m_Bridge); m_AppCallbacks.SetCoreApplicationViewEvents(applicationView); }
private void ViewActivated(CoreApplicationView sender, IActivatedEventArgs args) { if(updateDatabase) { ContinueFileOpenPicker(args as FileOpenPickerContinuationEventArgs); } else if(exportDatabase) { ContinueFileSavePicker(args as FileSavePickerContinuationEventArgs); } else if(choosePhoto) { ContinueFileOpenPicker(args as FileOpenPickerContinuationEventArgs); } }
//DUPLICA FINESTRA private async void duplica_finestra_btn_Click(object sender, RoutedEventArgs e) { Windows.ApplicationModel.Core.CoreApplicationView newView = CoreApplication.CreateNewView(); int newViewId = 0; await newView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { Frame frame = new Frame(); frame.Navigate(typeof(InkDrawPage), null); Window.Current.Content = frame; // You have to activate the window in order to show it later. Window.Current.Activate(); newViewId = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().Id; }); bool viewShown = await ApplicationViewSwitcher.TryShowAsStandaloneAsync(newViewId); }
async void SettingsPage_Activated(CoreApplicationView sender, Windows.ApplicationModel.Activation.IActivatedEventArgs args1) { var args = args1 as FileOpenPickerContinuationEventArgs; if (args != null) { CoreApplication.GetCurrentView().Activated -= SettingsPage_Activated; if (args.Files.Count == 0) return; var selectedImageFile = args.Files[0]; await selectedImageFile.CopyAsync(ApplicationData.Current.LocalFolder, "Wallpaper", NameCollisionOption.ReplaceExisting); ViewModel.Instance.UpdateWallpaper(); } }
private async void viewActivated(CoreApplicationView sender, IActivatedEventArgs args1) { FileOpenPickerContinuationEventArgs args = args1 as FileOpenPickerContinuationEventArgs; if (args != null) { if (args.Files.Count == 0) return; view.Activated -= viewActivated; StorageFile storageFile = args.Files[0]; var stream = await storageFile.OpenAsync(Windows.Storage.FileAccessMode.Read); var bitmapImage = new Windows.UI.Xaml.Media.Imaging.BitmapImage(); await bitmapImage.SetSourceAsync(stream); var decoder = await Windows.Graphics.Imaging.BitmapDecoder.CreateAsync(stream); img.Source=bitmapImage; } }
void AlbumCoverFetchPage_Activated(CoreApplicationView sender, Windows.ApplicationModel.Activation.IActivatedEventArgs args1) { var args = args1 as FileOpenPickerContinuationEventArgs; if (args != null) { CoreApplication.GetCurrentView().Activated -= AlbumCoverFetchPage_Activated; if (args.Files.Count == 0) return; var selectedImageFile = args.Files[0]; var viewModel = (AlbumCoverFetchViewModel)this.DataContext; viewModel.SaveAndCropCover(selectedImageFile); this.Frame.GoBack(); } }
private void OnViewActivated(CoreApplicationView sender, IActivatedEventArgs args1) { FileOpenPickerContinuationEventArgs args = args1 as FileOpenPickerContinuationEventArgs; if (args != null) { if (args.Files.Count == 0) return; StorageFile file = args.Files[0]; foreach (ReportPhoto photo in photos) if (file.Path.Equals(photo.FilePath)) return; photos.Add(new ReportPhoto(file)); } this.UpdateSendButtonAvaialbility(); this.UpdateAddPhotoButtonAvailability(); }
public static Dictionary<string, string> iCN1Settings; // = new Dictionary<string, string>(); public static void setCanvas(Page page, Canvas LayoutRoot) { iCN1Settings = loadSettings("/install:/CN1WindowsPort.xml"); // ms-appx:///CN1WindowsPort.xml"); view = CoreApplication.GetCurrentView(); var ss = getDictValue(iCN1Settings, "DefaultStorageFolder", "Cache:"); iDefaultStore = getStore(ss); // storeApplicationData.Current.CacheFolder; // Faster, avoid cloud backup. See https://www.suchan.cz/2014/07/file-io-best-practices-in-windows-and-phone-apps-part-1-available-apis-and-file-exists-checking/ dispatcher = CoreWindow.GetForCurrentThread().Dispatcher; cl = LayoutRoot; app = page; scaleFactor = Windows.Graphics.Display.DisplayInformation.GetForCurrentView().RawPixelsPerViewPixel; logicalDpi = DisplayInformation.GetForCurrentView().LogicalDpi; rawDpiy = DisplayInformation.GetForCurrentView().RawDpiY; rawDpix = DisplayInformation.GetForCurrentView().RawDpiX; screen = new CanvasControl(); cl.Children.Add(screen); screen.Width = cl.ActualWidth * scaleFactor; screen.Height = cl.ActualHeight * scaleFactor; screen.ClearColor = Windows.UI.Colors.Black; // Maybe white ? Canvas.SetLeft(screen, 0); Canvas.SetTop(screen, 0); myView = new WindowsAsyncView(screen); mediaCapture = new MediaCapture(); }
public async void birinciresim_Click(object sender, RoutedEventArgs e) { try { type = 1; FileOpenPicker openPicker = new FileOpenPicker(); openPicker.ViewMode = PickerViewMode.Thumbnail; openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary; openPicker.FileTypeFilter.Add(".jpg"); openPicker.FileTypeFilter.Add(".jpeg"); openPicker.FileTypeFilter.Add(".png"); view = CoreApplication.GetCurrentView(); #if WINDOWS_PHONE_APP view.Activated += SoruEkle_Activated; openPicker.PickSingleFileAndContinue(); #else resimfile1 = await openPicker.PickSingleFileAsync(); #endif } catch (Exception ex) { await App.APIService.Log("Birinci Resim Seçim Hatası. Detaylar: " + ex.Message); } }
protected virtual void OnActivated(CoreApplicationView sender, IActivatedEventArgs args) { // Setup services if this is the first activation if (!isActivated) { SetupServices(); isActivated = true; } // Call the activation manager ActivationManager.Activate(args); }
/// <inheritdoc/> public void Initialize(CoreApplicationView applicationView) { }
public void Initialize(CoreApplicationView applicationView) { applicationView.Activated += applicationView_Activated; CoreApplication.Suspending += CoreApplication_Suspending; }
static CoreApplication() { _currentView = new CoreApplicationView(); }
public MainPage() { this.InitializeComponent(); this.NavigationCacheMode = NavigationCacheMode.Required; view = CoreApplication.GetCurrentView(); }
void IFrameworkView.Initialize(CoreApplicationView view) { _view = view; }
void view_Activated(CoreApplicationView sender, IActivatedEventArgs args) { if (args.Kind == ActivationKind.WebAuthenticationBrokerContinuation) { var continuationEventArgs = args as WebAuthenticationBrokerContinuationEventArgs; if (continuationEventArgs.WebAuthenticationResult != null) { ParseAuthenticationResult(continuationEventArgs.WebAuthenticationResult); } } }
private void loginFacebook() { SilverlightImplementation.dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () => { Uri loginUrl = fb.GetLoginUrl(new { client_id = appId, redirect_uri = redirectUrl, response_type = "token", scope = permissions }); Uri startUri = loginUrl; Uri endUri = new Uri(redirectUrl, UriKind.Absolute); view = CoreApplication.GetCurrentView(); #if WINDOWS_PHONE_APP WebAuthenticationBroker.AuthenticateAndContinue(startUri, endUri, null, WebAuthenticationOptions.None); view.Activated += view_Activated; #else WebAuthenticationResult WebAuRes = await WebAuthenticationBroker.AuthenticateAsync(WebAuthenticationOptions.None, startUri, endUri); ParseAuthenticationResult(WebAuRes); #endif }).AsTask().ConfigureAwait(false).GetAwaiter().GetResult(); }
public AddLifeThread() { view = CoreApplication.GetCurrentView(); this.InitializeComponent(); }
private void OnActivated(CoreApplicationView applicationView, IActivatedEventArgs args) { CoreWindow.GetForCurrentThread().Activate(); }
//------------------------------------------------------------------------------ // // VisualProperties.Initialize // // This method is called during startup to associate the IFrameworkView with the // CoreApplicationView. // //------------------------------------------------------------------------------ void IFrameworkView.Initialize(CoreApplicationView view) { _view = view; _random = new Random(); }
private async void ProfileResimGuncelle_Click(object sender, RoutedEventArgs e) { try { await Mesaj.Soru("Profil Resminizi Güncellemek İstiyor Musunuz?", async (sndr) => { view = CoreApplication.GetCurrentView(); FileOpenPicker openPicker = new FileOpenPicker(); openPicker.ViewMode = PickerViewMode.Thumbnail; openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary; openPicker.FileTypeFilter.Add(".jpg"); openPicker.FileTypeFilter.Add(".jpeg"); openPicker.FileTypeFilter.Add(".png"); #if WINDOWS_PHONE_APP view.Activated += SoruDetay_Activated; DeviceType = 1; openPicker.PickSingleFileAndContinue(); #else DeviceType = 2; file = await openPicker.PickSingleFileAsync(); #endif if (DeviceType == 2 && file != null) { var data = await FileHelper.ReadFile(file); var result = await App.APIService.ResimGuncelle(data, file.Name); if (result != null) await Mesaj.MesajGoster("Dosya seçilirken hata oluştu"); } else if (DeviceType == 2) { await Mesaj.MesajGoster("Dosya seçilirken hata oluştu"); } }); } catch (Exception ex) { await App.APIService.Log("Profil Resim Güncelleme Hatası. Detaylar: " + ex.Message); } }
private void View_Activated(CoreApplicationView sender, Windows.ApplicationModel.Activation.IActivatedEventArgs args) { var a = args as FileOpenPickerContinuationEventArgs; if (a!=null && a.Files.Count!=0) { ShowTags = true; FileToUpload = a.Files.First(); } }
async private void Select_Image(object sender, RoutedEventArgs e) { if (captureManager != null) { await captureManager.StopPreviewAsync(); //stop camera capturing captureManager.Dispose(); captureManager = null; } view = CoreApplication.GetCurrentView(); string ImagePath = string.Empty; FileOpenPicker filePicker = new FileOpenPicker(); filePicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary; filePicker.ViewMode = PickerViewMode.Thumbnail; // Filter to include a sample subset of file types filePicker.FileTypeFilter.Clear(); filePicker.FileTypeFilter.Add(".png"); filePicker.FileTypeFilter.Add(".jpeg"); filePicker.FileTypeFilter.Add(".jpg"); filePicker.PickSingleFileAndContinue(); view.Activated += viewActivated; }
void IFrameworkView.Initialize(CoreApplicationView applicationView) { }
private async void viewActivated(CoreApplicationView sender, IActivatedEventArgs args1) { FileOpenPickerContinuationEventArgs args = args1 as FileOpenPickerContinuationEventArgs; if (args != null) { if (args.Files.Count == 0) return; view.Activated -= viewActivated; StorageFile storageFile = args.Files[0]; Debug.WriteLine(storageFile.Path); Debug.WriteLine(storageFile.DisplayName); this.Frame.Navigate(typeof(OcrText), storageFile); } }