windows-phone-8.1

BitmapImage SetSource Crashing/Freezing App

我的未来我决定 提交于 2019-12-11 09:32:59
问题 I am trying to set the image from a stream. However when I set the source from the background thread and use a dispatcher it freezes the app completely. The stream is not null, I have verified that. I am using the taglib api to get the stream of the album picture of an mp3 file. I've tried everything. async void Background(object sender, MediaPlayerDataReceivedEventArgs e) { IRandomAccessStream AlbumArtStream = await Media.GetAlbumArt(MediaFile.Name, await MediaFile.OpenStreamForReadAsync());

Identify from which page come to this page in windows phone 8.1

浪尽此生 提交于 2019-12-11 09:13:58
问题 How can I know which page I came from in a Windows phone 8.1? For example I have 3 pages: a Login page, a main page and a category page. What I want to do is to identify from which of those pages a user came to the main page; from the login page or from the category page. I tried this code inside the OnNavigatedTo method in MainPage.cs , var lastPage = this.Frame.BackStack.Last(); if (lastPage != null && lastPage.SourcePageType.Name.ToString() == "LogInPage") { } else { } But the thing is

How can I play mp3 files stored in my Windows Phone 8.1 solution?

让人想犯罪 __ 提交于 2019-12-11 09:08:32
问题 I have a number of mp3 files stored in my solution at the location /Resources/mp3Files/ In Windows Phone 8 I was able to play these with the following: var name = track.Item1; var uri = new Uri("/Resources/mp3Files/sound.mp3", UriKind.Relative); var song = Song.FromUri(name, uri); FrameworkDispatcher.Update(); MediaPlayer.Play(song); However, in Windows Phone 8.1 this doesn't work. What do I need to do to play mp3 files I have stored in my solution? 回答1: You need to use MediaElement in

How to get info about previous page on Frame.GoBack()

放肆的年华 提交于 2019-12-11 08:55:31
问题 Say we have some Page PageA and I have a button that, when clicked, does the following: Frame.NavigateTo(typeof(PageB)); After the user is done doing stuff, he navigates back from PageB to PageA calling Frame.GoBack() I want be able to determine that I'm navigating back from PageB I could use: protected override void OnNavigatedTo(NavigationEventArgs e) { e.NavigationMode } But this only tells me that I'm navigating back, not that I'm navigating back from PageB. Is this even a good windows

How to create transparent command bar in Windows Phone 8.1

末鹿安然 提交于 2019-12-11 08:09:24
问题 how to create transparent command bar in Windows Phone 8.1 Here is xaml <Page x:Class="App3.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Background="White" mc:Ignorable="d"> <Grid Background="Red" /> <Page.BottomAppBar> <CommandBar Background="#CCFFFFFF" Foreground="Black">

Bluetooth connection between Universal app and medical device - UUID and CODFilter

左心房为你撑大大i 提交于 2019-12-11 08:09:16
问题 I'm implementing an Universal app on both Windows 8.1 and Windows Phone 8.1 platforms, which should connect with devices like scale or blood pressure monitor by bluetooth technology. Unfortunatelly, I have difficulty in the discovering process and according to that I've no chance to pair and connect to the device. I've found the thread about this issue, but unfortunatelly it's associated with Android. From the post above: Describing the medical device: The device is using Service Discovery

Listview fails to display text of list items when item count exceeds 400 items

风流意气都作罢 提交于 2019-12-11 07:56:47
问题 I am observing that the Listview in my app fails to display the text of listview items when the item count exceeds 400 items. My guess is that this is a memory issue with the phone and not a pattern with larger devices. I assume that I will need to only add a fraction of the items that my listview's itemsource is based on. What is the best approach for managing a listview that's responsible for displaying large amounts of data? Here's my XAML: <ListView x:Name="ContactList" ScrollViewer

Cleaning up MediaCapture resources properly

浪子不回头ぞ 提交于 2019-12-11 07:55:40
问题 For a Windows Phone 8.1 app I have to record a video. I used this instructions and it works basically... http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868171.aspx ... but I do not get the cleaning up part within the App.xaml.cs public MediaCapture MediaCapture { get; set; } public CaptureElement PreviewElement { get; set; } public bool IsRecording { get; set; } public bool IsPreviewing { get; set; } public async Task CleanupCaptureResources() { if (IsRecording && MediaCapture !=

Does not contain a definition for NavigationContext in Windows Phone 8.1

五迷三道 提交于 2019-12-11 07:17:39
问题 When I work this code in NavigationContext I am getting an error. protected void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); string parameterValue = NavigationContext.QueryString["parameter"]; } 回答1: In Windows Phone 8.1 RT model app there is no need to pass parameters in URI format. Now you can send them as an object. You can create your own class for this, for example: public class MyParametersClass { public string Parameter1 { get; set; } public

MediaCapture and Window VisibilityChanged

狂风中的少年 提交于 2019-12-11 07:15:30
问题 [Question] On Windows Phone 8.1, what exactly happens in between the time when the user leaves the app and the OnSuspended event fires? I'm having trouble with the ability to manage objects in that span, in particular MediaCpture object. To better explain the problem, here is the scenario: The user is on a page with a video preview being pumped to a CaptureElement The user taps the Start button The user taps Back button and returns to the page with a broken MediaCapture With WinRT there isn't