Tag: windows phone

手机(设备)的序列号

是否有可能获得唯一的电话号码(不是SIM卡,电话号码,而是设备号码!)?? 设备序列号,产品代码,IMEI等? 我使用Windows Phone 7.1

如何通过拉下物品来刷新?

对于这个问题有很多答案,但是,正如我所看到的,所有这些都是关于在底部获取旧项目。 这个解决方案 void resultList_ItemRealized(object sender, ItemRealizationEventArgs e) { if (!_viewModel.IsLoading && resultList.ItemsSource != null && resultList.ItemsSource.Count >= _offsetKnob) { if (e.ItemKind == LongListSelectorItemKind.Item) { if ((e.Container.Content as TwitterSearchResult).Equals(resultList.ItemsSource[resultList.ItemsSource.Count – _offsetKnob])) { _viewModel.LoadPage(_searchTerm, _pageNumber++); } } } } 是在向下滚动时获取物品。 如何在顶部获取新的内容(底部不是更旧的内容)? 如何知道用户是否向上滚动LongListSelector

Taglib-sharp:如何使用IFileAbstraction来允许从流中读取元数据?

我正在尝试使用TagLib读取存储在IsolatedStorage中的mp3文件的元数据。 我知道TagLib通常只将文件路径作为输入,但是当WP使用沙箱环境时我需要使用流。 按照本教程( http://www.geekchamp.com/articles/reading-and-writing-metadata-tags-with-taglib ),我创建了一个iFileAbstraction接口: public class SimpleFile { public SimpleFile(string Name, Stream Stream) { this.Name = Name; this.Stream = Stream; } public string Name { get; set; } public Stream Stream { get; set; } } public class SimpleFileAbstraction : TagLib.File.IFileAbstraction { private SimpleFile file; public SimpleFileAbstraction(SimpleFile file) { this.file = file; } public […]

WPF使用datatemplate中的转换器从xaml文本和手机8上的XamlReader创建

我正在使用像这样的文本xaml生成DataTemplate: var dataTemplate = (DataTemplate)XamlReader.Load(xaml.ToString()); 其中一个元素是CheckBox与它的转换器绑定,指向StaticResource: StringBuilder xaml = new StringBuilder(); xaml.AppendFormat(@” “); 文本中存在此转换器引用会导致手机上的Application_UnhandledException中捕获到exception。 消息如下所示: – InnerException {System.Exception: Error HRESULT E_FAIL has been returned from a call to a COM component. at MS.Internal.XcpImports.CheckHResult(UInt32 hr) at MS.Internal.XcpImports.UIElement_Measure_WithDesiredSize(UIElement element, Size availableSize) at System.Windows.UIElement.Measure_WithDesiredSize(Size availableSize) at System.Windows.Controls.VirtualizingStackPanel.MeasureChild(UIElement child, Size layoutSlotSize) at System.Windows.Controls.VirtualizingStackPanel.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, […]

在Windows Phone中保留AnList LongListSelectorItem前景

在过去的几天里,我一直在努力为持有物品的情况获得一个漂亮的前景动画效果。 Item模板如下所示: 我尝试了多种方法,但我没有设法从其中任何一个获得结果。 我遇到了这个很好的MSDNpost ,其中显示了多个示例,但它们都不能与我的案例完全匹配,因为我希望在DataTemplate设置TextBlock Foregrounds动画,引用TextBlock ,所以我在访问特定控件时遇到问题模板。 例如,我尝试了这种方法: 然后从Hold事件处理程序触发它: var storyboard = Resources[“ItemHoldAnimation”] as Storyboard; storyboard.Begin(); 但它失败了,因为TargetName=”SubjectTextBlock”无法访问,因为它在DataTemplate … 我也尝试过一种我用WPF和EventTriggers找到的方法,如下所示: … 但它给了COMexception…… MS.Internal.WrappedException: Error HRESULT E_FAIL has been returned from a call to a COM component. —> System.Exception: Error HRESULT E_FAIL has been returned from a call to a COM component. 当LongListSelector项被保持时,很多只是动画字体… 解决这个问题的方法是什么?

Windows Phone“ListBox”ItemsSource

我有一个列表,并希望分配下载的饲料她。 还想说我正在使用我在另一个应用程序中使用的相同代码,但是给出的错误就像这个一样少。 另一个完美。 我会发布几个作为这个来源。 因为如果你不能停留太久。 private void carregaListas() { WebClient webClient = new WebClient(); webClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(webClient_DownloadStringCompleted); webClient.DownloadStringAsync(new System.Uri(“http://www.news-medical.net/syndication.axd?format=rss”)); } private void webClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { if (e.Error != null) { Deployment.Current.Dispatcher.BeginInvoke(() => { stkLife.Visibility = Visibility.Visible; stbOfLife.Begin(); }); } else { // Save the feed into the State property in case the […]

如何在Windows Phone 8.1应用程序中的两个页面之间传递数据?

我有一个Windows Phone 8.1应用程序,我有两个页面显示数据。 第一页有一个列表视图,显示来自sqlite数据库的所有数据,当用户点击列表视图中的一个项目时,第二个页面打开一个列表视图,其中包含有关该数据库中该特定记录的更多详细信息。 我的问题是如何使用c#在Windows Phone 8.1中实现这一目标?

手机唤醒时Application_Activated中的代码未运行

我已经对Windows Phone应用程序的生命周期进行了一些研究,并且我已经收集到当应用程序仍在运行时手机被锁定,并且您解锁手机时,App.xaml中调用了“Application_Activated”function。 cs文件。 // Code to execute when the application is activated (brought to foreground) // This code will not execute when the application is first launched private void Application_Activated(object sender, ActivatedEventArgs e) { //Code to run MessageBox.Show(“Hello there!”); } 现在在上面的例子中,简单的’MessageBox’调用没有运行。 就像我说的,如果您的应用程序正在运行并且您锁定了手机,然后解锁了手机,则上述代码可能会运行,在这种情况下,只要您解锁手机就会显示一个MessageBox。 真的很感激任何帮助! 谢谢。

使用Youtube v3 Api键

我正在尝试构建一个基于youtube的应用程序,我正在使用Youtube Data API的3.0版本,我确实在Google Cloud Console中注册了该应用程序,并且我确实获得了一个API密钥。 之后我尝试在Visual Studio 2010中的控制台应用程序中测试它,我使用WebClient使用此URL检索video搜索“ https://www.googleapis.com/youtube/v3/search?part=snippet&q=YouTube + Data + API&type = video&key = {MY API KEY}“ 我从这里学到了这个。 我使用了浏览器密钥和服务器密钥,但是服务器发回错误说该请求不正确。 所以有人能指出我正在犯的错误吗? PS:我正在尝试制作Windows手机应用程序,在此之前我想学习如何首先操作Youtube API,这就是我在控制台应用程序中测试的原因

在codeBehind中添加网格

要将Grid划分为行,我们为其提供行定义和需要放置在该网格中特定行中的UIElement ,我们这样做: Button Name=”Button1″ Grid.Row=”1″ 现在假设我想在动态代码中执行此操作,那么我们该怎么做呢。 谢谢。