windows-phone-8.1

How does the timeout apply on StreamSocket.readAsync()?

China☆狼群 提交于 2020-01-07 00:52:07
问题 I have created the streamSocket that received the stream of media. I want to read the stream on this socket and also want to apply readTimeout. So that I have applied it using CancellationTokenSource. As per my requirement, if I cant read within timeout limit, I dont want to close this socket. However, applying cancellation token causes the socket close in my program. Is there any way to apply time out without closing the socket? await socket.InputStream.ReadAsync(readBuffer, 8,

How to change button image on clicking and again on releasing in windows phone

℡╲_俬逩灬. 提交于 2020-01-06 20:18:23
问题 I want to change image1(let say) on clicking a button, to image2 and again on releasing I want to change it back to image1. If any body knows please answer me. I am new to windows phone development. 回答1: <Button x:Name="MyButton" IsPressed="{Binding MyButtonIsPressed}"></Button> C# private bool _myButtonIsPressed; public bool MyButtonIsPressed { get{ return _myButtonIsPressed;} set{ _myButtonIsPressed = value; if(value==false){ MyButton.Content = ImageWhenReleasing; } else{ MyButton.Content =

How to parse a DateTime string based on culture?

假装没事ソ 提交于 2020-01-06 15:51:16
问题 Well I was creating a application for windows phone 8.1 WinRT. I save a Datetime.now() based on en-US culture initially but later the culture gets changed and when I try to parse the saved string in DateTime.Parse() , I get a format exception . //Setting en-US culture var culture = new CultureInfo("en-US"); Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = culture.Name; //Saving DateTime.Now in a string format String usTime = DateTime.Now.ToString(); //Changing it to the de

Namespace missing in Windows Phone 8.1 runtime app project

北慕城南 提交于 2020-01-06 14:33:32
问题 I am writing a Windows Phone 8.1 runtime app. The InkPresenter class which was available in Windows Phone 8 is not there in 8.1. Now, 8.1 should be backward compatible with 8 and that all the apps that used the InkPresenter class in Windows Phone 8 can run on 8.1 too. So my guess(and I can be wrong in assuming this) is that the Inkpresenter class should be there in Windows Phone 8.1 too but might be under a different namespace. Otherwise, how could the apps of Windows Phone 8 using the

Windows Phone Folder Picker - Show files

喜欢而已 提交于 2020-01-06 12:47:18
问题 I have following code: //open folder picker ui FolderPicker openPicker = new FolderPicker(); openPicker.ViewMode = PickerViewMode.List; openPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary; //openPicker.FileTypeFilter.Add(".db"); openPicker.CommitButtonText = "Choose location"; openPicker.ContinuationData["Operation"] = "OpenFolder"; openPicker.PickFolderAndContinue(); This code works, but files arend't displayed; in all folders say: "This folder is empty", which is very

Merging multiple Images

十年热恋 提交于 2020-01-06 03:15:05
问题 I'm trying to merge multiple Images into one image. Problem is that most libraries with such functionality are not available in a Windows 8.1 App. I'd prefer to not have to use external libraries such as WriteableBitmapEx This is my current code which unfortunately doesn't work: int count = 4; int size = 150; WriteableBitmap destination = new WriteableBitmap(300, 300); BitmapFrame frame = await (await BitmapDecoder.CreateAsync(randomAccessStream)).GetFrameAsync(0); PixelDataProvider pixelData

Launch 2 SMS Compose tasks in Windows Phone 8.1 RT App

戏子无情 提交于 2020-01-05 20:48:30
问题 I have a button in my Windows Phone 8.1 RT app. When the user clicks the button, 2 SMS are supposed to be sent to two different users. I can launch one SMS Task using the following code var message = new ChatMessage(); message.Recipients.Add("1231233"); message.Body = "This is a text message from an app!"; await ChatMessageManager.ShowComposeSmsMessageAsync(message); But when I do this multiple times, the app crashes. The Task complete event fires on task launch, is there a way to know if the

How to change caret color in windows phone 8.1 universal app

好久不见. 提交于 2020-01-05 19:26:22
问题 How can I change textbox caret color in windows phone 8.1 universal app? in windows phone 8 we used TextBox.CaretBrush to change caret color. But this is missing in windows phone 8.1 WinRt. Is there are way to change caret color? 回答1: In Windows Phone universal app, we can't use CaretBrush any more. Windows Phone 8.1 (Silverlight) vs Windows Phone 8.1 But we can change background of TextBox when Focus and UnFocus , So the caret can be seen. 来源: https://stackoverflow.com/questions/25617692/how

Get WebView's content height - Windows Phone 8.1

梦想的初衷 提交于 2020-01-05 15:16:54
问题 I try to get the height of the actual HTML content inside my WebView in order to set the height according to the content. this is my script, but I get an empty string when the scripit is being invoked. private async Task LoadHTMLContent(ItemViewModel itemVm) { var htmlScript = "<script>function getDocHeight() { " + "return document.getElementById('pageWrapper').offsetHeight; } </script>"; var htmlConcat = string.Format("<html><head>{0}</head>" + "<body style=\"margin:0;padding:0;\" " + ">" +

Get WebView's content height - Windows Phone 8.1

纵饮孤独 提交于 2020-01-05 15:16:46
问题 I try to get the height of the actual HTML content inside my WebView in order to set the height according to the content. this is my script, but I get an empty string when the scripit is being invoked. private async Task LoadHTMLContent(ItemViewModel itemVm) { var htmlScript = "<script>function getDocHeight() { " + "return document.getElementById('pageWrapper').offsetHeight; } </script>"; var htmlConcat = string.Format("<html><head>{0}</head>" + "<body style=\"margin:0;padding:0;\" " + ">" +