public MainPage() { Current = this; this.InitializeComponent(); SetFolderAttributes(); this.NavigationCacheMode = NavigationCacheMode.Required; var context = new HostAppsView(@"d:\wpsystem\apps"); var sb = new StringBuilder(1024); NativeAPI.GetCurrentDirectoryW(1024, sb); if(sb.ToString().ToUpper().StartsWith("D:\\")) { Frame.Navigate(typeof(MoveToPhone)); } else if (Windows.Storage.AccessCache.StorageApplicationPermissions.FutureAccessList.ContainsItem("WPSYSTEM")) { DoStuff(context); } else { Frame.Navigate(typeof(Welcome)); Frame.DataContext = context; } }
private async void DoStuff(HostAppsView context) { context.AppsStorageFolder = await (await Windows.Storage.AccessCache.StorageApplicationPermissions.FutureAccessList.GetFolderAsync( "WPSYSTEM")).GetFolderAsync("apps"); Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { Frame.Navigate(typeof (ChooseDestination)); Frame.DataContext = context; }); }
public HostApp(HostAppsView pView, Guid pGuid, string pPath) { _view = pView; _guid = pGuid; _path = pPath; // pView.AppsStorageFolderChanged += LoadInfo; Name = HostableApp.GetAppName(pGuid); IsSupported = HostableApp.GetIsSupported(pGuid); }