Tag: windows 8

WebAuthenticationBroker.AuthenticateAsync抛出exception

我的代码使用: WebAuthenticationResult WebAuthenticationResult = await WebAuthenticationBroker.AuthenticateAsync( WebAuthenticationOptions.None, StartUri, EndUri); 就像Microsoft Web身份validation代理示例一样 它曾经在我的桌面和我的平板电脑(Surface)上工作,但现在它无法在我的桌面上运行。 它抛出exception The process terminated unexpectedly. (Exception from HRESULT: 0x8007042B) 它正在平板电脑和不同的Windows-8桌面上工作。 有什么可以导致这种exception的建议吗?

如何将XAML用户控件放在网格中

我有以下main.xaml和usercontrol。 我需要在网格的第二行,第二列上放置几次用户控件,通过使用visual studio它不会允许拖放用户控件,所以我想我必须通过代码来做,我只是不知道怎么样 MainPage.xaml中 用户控件

在Windowsapp store中获取窗口宽度/高度

我目前有一个加载的基本页面,我需要一些方法来获取窗口的宽度和高度,最好是在构造函数中。 问题是,在构造函数中,或者在页面完全加载之前,我似乎无法掌握宽度和高度。 加载后我可以使用: this.ActualWidth; this.ActualHeight; 是否有任何窗口加载完成事件我可以使用或以任何方式获得加载过程中的宽度和高度?

以编程方式关闭win8应用程序

我已经开始修改制作Windows 8应用程序而且我想制作一个退出按钮。 问题是我在winforms中使用的Environment.Exit()和this.Close()不在此范围内。 有谁知道如何以编程方式关闭应用程序?

如何获得方法名称win 8 app

如何在win 8(WinRT)应用程序中获取当前方法名称…在wp7中我们可以使用System.Reflection.MethodBase.GetCurrentMethod().Name但它不再那里谢谢

您应该在Windows 8应用程序中编写“隐私政策”吗?

我的应用程序认证失败的原因是: “4.1.1如果您的应用程序具有网络能力,则必须拥有隐私声明……您必须在应用程序的”描述“页面以及应用程序的设置中提供对隐私策略的访问权限显示在Windows设置超级按钮中。“ 他们在说什么? 什么描述? 如何设置Windows设置中显示的信息? 该应用程序是C#

淡入/淡出Windowsapp store应用程序中的TextBlock

有人可以解释一下,当我在Windowsapp store应用中加载表单时,如何为文本块添加淡入和淡出动画? 我尝试了WPF方法,但它没有用…谢谢:)

关于更改框架的ArgumentNullException

所以我试图在Windows 8应用程序中更改帧。 我尝试按照本页的教程,但我一直得到同样的错误。 我在线上得到了一个ArgumentNullException: frameState[_pageKey] = pageState; 在LayoutAwarePage.cs类中,在OnNavigatedFrom方法中。 现在我不确定为什么会出现这个错误,因为我觉得在我的代码中没有任何东西可以导致它。 我的按钮onclick函数有这个代码: DateTime chosenDateTime = new DateTime(year, month, day, hours, minutes, seconds); this.Frame.Navigate(typeof(MainPage), chosenDateTime.ToString()); 我的MainPage中的OnNavigatedTo方法如下所示: protected override void OnNavigatedTo(NavigationEventArgs e) { string parameter = (string)e.Parameter; if (parameter != “”) { Windows.Storage.ApplicationDataContainer roamingSettings = Windows.Storage.ApplicationData.Current.RoamingSettings; roamingSettings.Values[“chosenDateTime”] = parameter; chosenDateTime = Convert.ToDateTime(e.Parameter); } else { Windows.Storage.ApplicationDataContainer roamingSettings = Windows.Storage.ApplicationData.Current.RoamingSettings; […]

无法注册时间触发的后台任务

对于Windows 8应用程序,在C#/ Xaml中我尝试注册后台任务。 这很难说,但我想我的后台任务已被注册,但当我在调试位置工具栏上点击后台任务的名称时,我的应用程序停止工作,没有任何消息。 我查看了事件查看器上的日志,得到:“具有入口点MyApp.Pages.SampleBackgroundTask和名称示例每小时后台任务的后台任务无法激活,错误代码为0x80010008。” 这是我的代码: private async void Button_Click_BackgroundTask(object sender, RoutedEventArgs e) { string entryPoint = “MyApp.Pages.SampleBackgroundTask”; string taskName = “Example hourly background task”; TimeTrigger hourlyTrigger = new TimeTrigger(60, false); BackgroundTaskRegistration myBackGroundTaskRegistration = RegisterBackgroundTask(entryPoint, taskName, hourlyTrigger, null); if(myBackGroundTaskRegistration != null) AttachProgressAndCompletedHandlers(myBackGroundTaskRegistration); } public static BackgroundTaskRegistration RegisterBackgroundTask(String taskEntryPoint, String name, IBackgroundTrigger trigger, IBackgroundCondition condition) { […]

在void方法中使用async await

我有签名的方法我无法改变。 它应该是 protected override void OnInitialize() 使用Windows 8 Metro API我需要检查文件是否存在并在此NoSignatureChange方法中读取它。 使用PlainOldCSharp,我会写类似的东西 protected override void OnInitialize() { … try { var file = folder.OpenFile(fileName); fileExists=true; } catch(FileNotFoundException) { fileExists=false } } 请记住,在Windows 8 API中只检查文件是否存在正在处理FileNotFoundException此外,在Windows 8 API中所有FileIO API都是异步的,所以我只有file.OpenFileAsync方法。 所以,问题是: 如何使用Windows 8 API中的folder.OpenFileAsync方法编写此代码而不更改包含方法的签名