Tag: windows phone

具有列表项选择样式的LongListSelector

我正在使用Windows Phone 8,我有Longlist选择器,其中包含很少的项目。 我使用下面的代码突出显示列表框中的所选项目。但我想要为LongListSelector实现相同的效果。 怎么做 ?

如何从64位应用程序连接到Windows Phone 7

我有一个32位程序(用C ++编写)可以连接到一些不同的设备,只要它是32位一切正常。 但是,现在我需要将其构建为64位程序,但后来我遇到了Windows Phone 7的一些问题。 我发现我重建为64位的dll(用C#编写)会在此行抛出exception: MultiTargetingConnectivity connectivity = new MultiTargetingConnectivity(CultureInfo.CurrentUICulture.LCID); 例外是: An unhandled exception of type ‘Microsoft.SmartDevice.Connectivity.DatastoreException’ occurred in Microsoft.SmartDevice.Connectivity.dll Additional information: Retrieving the COM class factory for component with CLSID {349AB2E8-71B6-4069-AD9C-1170849DA64C} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). (例如,如果我尝试运行此示例程序,它以32位工作,但在同一行中以64位引发该exception) 当我在注册表中搜索该CLSID时,我找到了“C:\ Program Files(x86)\ Common Files \ […]

在模拟器中打开PDF文件

我有这个代码: private async void LaunchPDF(string name) { var file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(name); if (file != null) { // Set the option to show the picker var options = new Windows.System.LauncherOptions(); options.DisplayApplicationPicker = true; // Launch the retrieved file bool success = await Windows.System.Launcher.LaunchFileAsync(file, options); if (success) { // File launched Debug.WriteLine(“File Launched”); } else { […]

定时器开始时间和结束时间计算额外提供4秒

我正在使用WP8,我正在使用计时器,我正在计算总时间。 这就是我这样做的方式: timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(1);//interval for timer is 1 sec timer.Tick += new EventHandler(timer_Tick);//after the timer expires, this event is fired timer.Start(); startDateTime = DateTime.Now; DateTime et = DateTime.Now; Debug.WriteLine(“st is “+startDateTime+ ” et is “+et); TimeSpan myDateResult = et – startDateTime; double seconds = myDateResult.TotalSeconds; Debug.WriteLine(“difference is ” + seconds); […]

在Windows Phone 8上将wav文件压缩为wma

我希望在Windows Phone上编码wma(或mp3,ogg等)中的wav文件。 我没有在网上找到任何资源。 关于我如何存档的任何想法? 我正在尝试从麦克风录制语音并从手机上传。 这就是为什么我喜欢在发送之前压缩音频文件。

如何在隔离存储中保存超链接按钮

我有一个超链接按钮列表,在运行时创建 public void SaveBookmark() { Button objButton = new Button(); objButton.Content = “Delete”; objButton.HorizontalAlignment = System.Windows.HorizontalAlignment.Right; objButton.Foreground = new SolidColorBrush((Colors.Black)); objButton.BorderBrush = new SolidColorBrush((Colors.Black)); HyperlinkButton objhyperlinkbtn = new HyperlinkButton(); objhyperlinkbtn.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; objhyperlinkbtn.FontSize = 34; objhyperlinkbtn.Foreground = new SolidColorBrush((Colors.Black)); objhyperlinkbtn.Tag = Index; stackpanel.Children.Add(objhlbBookMark); stackpanel.Children.Add(objButton); } 我想将它保存在独立存储中。 请帮我把它保存在隔离存储中。 我想让用户选择书签,如果用户保存书签然后超链接按钮保存在页面上以查看书签列表

Windows Phone上的密钥字符

我想确定用户通过键盘输入的符号。 例如,在Windows窗体中,KeyPressEventArgs具有KeyChar属性,但Windows Phone中的KeyEventArgs没有此属性。 它需要处理这个事件,因为我想处理一些西里尔符号。

如何安排重复任务倒计时在Windows Phone 8中的数字

只要用户在一个特定的屏幕上,我就需要运行一个简单的任务。 在这个屏幕上有一个倒计时器。 我调查了后台代理 – 但这似乎不是正确的方法。 基本上它应该像这样工作:用户进入这一个屏幕,按下开始,紧缩计时器开始倒计时 – 每30秒更新完全没问题。 我应该如何在WP8上做到这一点? 非常感谢!

在本地和从Store部署时的不同应用程序行为

当从Windowsapp store(测试版)部署应用时,我遇到了一个奇怪的问题。 该应用程序编写为Windows Phone 8.1 RunTime。 我有一个用C ++ / C#编写的小型Windows运行时组件,用于检查文件是否存在: bool FileEx::FileExists(String^ path) { std::wstring pathW(path->Begin()); std::string myPath(pathW.begin(), pathW.end()); FILE *file = NULL; if (fopen_s(&file, myPath.c_str(), “r”) == 0) { fclose(file); return true; } else return false; } 测试方法: 现在让我们用两个文件测试它 – 一个在本地文件夹中创建,一个在MusicLibrary中的文件夹中创建。 一切都在主项目中完成,在C ++ / C#中使用上述方法引用WRC。 const string localFileName = “local.txt”; const string musicFileName = […]

UploadStringAsync()的返回值。?

我的问题是正确的还是不正确我不知道,但我想知道是否可以使用WebClient返回post方法的UploadStringAsync()的值? string serviceURL = REST_URI + servicePath; Uri URI = new Uri(serviceURL); System.Net.WebClient webClient = new WebClient(); webClient.Headers[“ContentType”] = “application/json”; webClient.Headers[“Accept”] = “application/json”; webClient.UploadStringCompleted += this.sendPostCompleted; webClient.UploadStringAsync(URI, HTTP_POST, result); return ??; 如果我们可以返回UploadStringAsync(URI, HTTP_POST, result); 请告诉我?