Tag: windows phone 7

如何比较两个捕获以查看哪个更响亮?

给定从麦克风捕获的两个字节数据arrays,如何确定哪个数据中的噪声峰值更多? 我假设有一个算法我可以应用于数据,但我不知道从哪里开始。 说到这一点,我需要能够确定婴儿哭闹的时间与房间内的环境噪音。 如果它有帮助,我使用Microsoft.Xna.Framework.Audio.Microphone类来捕获声音。

如何将上下文菜单添加到WebBrowser wp7?

是否可以在WP7中向WebBrowser添加上下文菜单?(如IE) silverlight工具包上下文菜单不支持WebBrowser !!!

为什么.gif图像只显示一些第一帧(Windows Phone)

我之前的源代码问题在这里: 如何在WP 7中使用gif动画图像 我在我的动画gif中使用http://imagetools.codeplex.com/我有24帧,但它只解码了一些第一帧,所以我一次又一次地看到一些(可能是两帧)的重复动画

如何执行卡片翻转动画

我希望能够在用户点击屏幕时从设备屏幕的一半到另一半执行卡片翻转动画。 我之前从未使用动画,所以我不知道如何实现这一目标。 我引用了http://blogs.msdn.com/b/kevinash/archive/2011/12/21/flipping-card-animation-for-windows-phone-7-using-expression-blend.aspx,但我不知道如何恰当地修改解决方案。 我最终需要的是能够以这种方式翻转整个牌组。 MainPage.xaml中 Visible Visible MainPage.xaml.cs中 public MainPage() { InitializeComponent(); } private void cardBack_Tap(object sender, System.Windows.Input.GestureEventArgs e) { VisualStateManager.GoToState(this,”FlipCard”,true); }

使用C#,.NET的Google plus API for WP7

google plus是否为WP7提供API以通过C#,.NET访问其服务请告诉我。

流式音频运行锁定

我正在尝试使用PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled;在锁定屏幕下播放流音频PhoneApplicationService.Current.ApplicationIdleDetectionMode = IdleDetectionMode.Disabled; 使用简单的mp3文件一切正常,但流式音频(如网络收音机)停止播放。 如何解决这个问题? 更新:我发现了问题。 我使用这样的链接: mms://212.235.5.168/102fm?ext=.mp3并且问题变为mms://212.235.5.168/102fm/File.mp3解决了这个问题。 所以在最后有查询字符串的所有链接都在锁定下停止播放。

Windows Phone 7中的XDocument.Parse是否有所不同?

我在WP7应用程序和C#3.5应用程序中运行完全相同的代码。 XDocument.Parse() #应用程序在调用XDocument.Parse()时抛出NotSupportedException ,而C#3.5应用程序解析XML没有问题。 以下是使用的代码: WebClient client = new WebClient(); client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(DownloadThreadsComplete); client.DownloadStringAsync(new Uri(“http://us.battle.net/sc2/en/forum/40568/”, UriKind.Absolute)); … private static void DownloadThreadsComplete(object sender, DownloadStringCompletedEventArgs e) { var doc = XDocument.Parse(e.Result); } 知道为什么会这样吗? 奇怪的是,当一个WoW论坛工作正常(http://us.battle.net/wow/en/forum/984270/)时,它试图解析SC2论坛时失败了。 编辑: exception消息是“NotSupportedException”。 这是完整的堆栈跟踪: at System.Xml.XmlTextReaderImpl.ParseDoctypeDecl() at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) at System.Xml.Linq.XDocument.Parse(String text, LoadOptions options) at System.Xml.Linq.XDocument.Parse(String text) […]

Thread.Sleep会影响ThreadPool吗?

我需要为自己的目的控制一个线程:计算,等待,报告等… 在所有其他情况下,我正在使用ThreadPool或TaskEx。 在调试器中,当我在做Thread.Sleep() ,我注意到UI的某些部分变得不那么负责了。 虽然,没有调试器似乎工作正常。 问题是:如果我正在创建新的Thread和Sleep() ,它会影响ThreadPool / Tasks吗? 编辑:这是代码示例: 我的应用中的一个随机位置: ThreadPool.QueueUserWorkItem((state) => { LoadImageSource(imageUri, imageSourceRef); }); 我的应用中的另一个随机位置: var parsedResult = await TaskEx.Run(() => JsonConvert.DeserializeObject(resultString, Constants.JsonSerializerSettings)); 我的ConcurrentQueue(修改后,原文取自此处 ): 为队列需要创建线程: public void Process(T request, bool Async = true, bool isRecurssive = false) { if (processThread == null || !processThread.IsAlive) { processThread = new Thread(ProcessQueue); processThread.Name = […]

LongListSelector和ContextMenu返回错误的项目

我在页面中有这个LongListSelector : . . . . 这是EditVideo private void EditVideo(object sender, RoutedEventArgs e) { VideoItem selectedVideo = (sender as MenuItem).DataContext as VideoItem; if (video == null) { return; } //Do Stuff this.RelodeTableData(); } 和RelodeTableData : private void RelodeTableData() { System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() => { searchResults.Clear(); for (int i = 0; i < historyRep.historyArray.Count; i++) { VideoItem item […]

在IsolatedStorageSettings中存储对象

我有一个对象我想存储在IsolatedStorageSettings中,我不想在应用程序重启时重用它。 我的问题在于,由于某种原因我编写的代码在重新启动时尝试访问密钥时不记得该对象。 namespace MyNameSpace { public class WindowsPhoneSettings { private const string SelectedSiteKey = “SelectedSite”; private IsolatedStorageSettings isolatedStore = IsolatedStorageSettings.ApplicationSettings; private T RetrieveSetting(string settingKey) { object settingValue; if (isolatedStore.TryGetValue(settingKey, out settingValue)) { return (T)settingValue; } return default(T); } public bool AddOrUpdateValue(string Key, Object value) { bool valueChanged = false; if (isolatedStore.Contains(Key)) { if (isolatedStore[Key] != […]