windows-runtime

DatagramSocket cannot receive data from UdpClient

时光总嘲笑我的痴心妄想 提交于 2019-12-04 15:21:52
I am making an Win RT app that connects to a desktop app and they start to communicate in UDP and TCP. I have successfully implemented TCP communication in that I can send from Win RT to Desktop and send from Desktop to Win RT. using StreamSocket on Win RT and TcpListener on desktop. I also made it to send Udp data from Win RT to desktop without any problem. But I can't receive data's sent from desktop to Win RT. I use the following code and I don't see any problem with that but there must something. var g = new DatagramSocket(); g.MessageReceived += g_MessageReceived; g.BindEndpointAsync(new

Background Task doesn't start

ぐ巨炮叔叔 提交于 2019-12-04 15:07:25
I trying to figure out why the backgroundtask won't start, but I have no idea, what I'm doing wrong. What am I trying to do: I want to have an automated background task which will download the 5 latest items through a WebApi (data is a couple kB). After downloading it will check the local file, to see if there are any new items available. If so, I want to create a Badge on the LiveTile with the number of new items. I have the following code: private BackgroundTaskRegistration ScheduleBackgroundTask() { foreach (var cur in BackgroundTaskRegistration.AllTasks) { if (cur.Value.Name ==

C# Detect Accent Colour Changes WinRT XAML

眉间皱痕 提交于 2019-12-04 14:50:59
I am trying to detect changes in the Application.Resources Resource dictionary, so I can automatically change the Titlebar to the Accent Colour when it updates. All of the XAML controls and elements change automatically, and when setting a solid colour brush to the address of the DSDFS brush, its internal value changes. This is the code I have tried to use to detect the change: public static DependencyProperty accent = DependencyProperty.Register("DictChange", typeof(ResourceDictionary), typeof(Shell), new PropertyMetadata(Application.Current.Resources, new PropertyChangedCallback(accent

How to start a MetroApp directly in Snapped mode? [duplicate]

别等时光非礼了梦想. 提交于 2019-12-04 14:26:47
Possible Duplicate: Force WinRT app to snapped view Is it possible to start a MetroApp directly in snapped mode? I want to call another App by Protocol, an the App should open in Snapped mode. The call to the App by Protocol is not a problem, it works fine, but the App opens in Fullscreen or Main-Content Mode. I have'nt found any configuration to say "start on Sidebar". Please Help! As of now the answer is no. Since the snapped mode functionality depends on the user , you cant skip it / restrict it using code , Hope MS might provide this feature in further . As @Hermit Dave mentioned

Await blocks the UI Thread, Network Related

岁酱吖の 提交于 2019-12-04 14:05:25
I have this piece of code in my Windows Store app where I handle a button click. But somehow, UI freezes when I click this button on rare occasion. It mostly happens when I connect to a Wi-Fi network further away than the one I usually connect to. Taking into consideration that I download a RSS feed from the internet, it is most probably related to my using of async/await keywords. If I correctly understood the mechanics of async/await, UI thread should not block at all. Am I missing something here? private async void Add_Click(object sender, RoutedEventArgs e) { AddButton.Visibility = Windows

Sdk for Dropbox, EverNote and Google Doc (WinRT)

纵然是瞬间 提交于 2019-12-04 13:51:36
Is there any official Winrt SDK's are available for Dorpbox, EverNote and GoogleDoc. I searched for this in the internet but didn't find any working solutions. If anyone know more about this(Either official or 3rd party sdk's) Please share your thoughts with me. Thanks in advance, Stephan Dropbox don't have WinRT api and probably it' wont change in near future, but you can also use REST Api: https://www.dropbox.com/developers/core/api So you can simply use this REST api because Windows 8/RT supports programing in JavaScript and HTML: http://msdn.microsoft.com/en-US/library/windows/apps

Get URI for a stored file in StorageFile (WinRT)

喜欢而已 提交于 2019-12-04 13:48:50
问题 I'm building a metro app, and I'm trying to get a Uri of an Image after saving it in the StorageFile, this is my code: StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync("samplefile.dat", CreationCollisionOption.ReplaceExisting); IRandomAccessStream raStream = await file.OpenAsync(FileAccessMode.ReadWrite); IOutputStream outStream = raStream.GetOutputStreamAt(0); DataWriter dw = new DataWriter(outStream); dw.WriteBytes(img); // I'm saving array of bytes await

How do you capture current frame from a MediaElement in WinRT (8.1)?

孤街醉人 提交于 2019-12-04 13:48:45
I am trying to implement a screenshot functionality in a WinRT app that shows Video via a MediaElement. I have the following code, it saves a screenshot that's the size of the MediaElement but the image is empty (completely black). Tried with various types of Media files. If I do a Win Key + Vol Down on Surface RT, the screen shot includes the Media frame content, but if I use the following code, it's blackness all around :( private async Task SaveCurrentFrame() { RenderTargetBitmap renderTargetBitmap = new RenderTargetBitmap(); await renderTargetBitmap.RenderAsync(Player); var pixelBuffer =

Resize winrt page when on on screen keyboard showing

时光怂恿深爱的人放手 提交于 2019-12-04 13:10:52
I have a Windows 8.1 C# app that shows a page with a pretty big textbox (covering almost all of the page; its a writing app). When the on screen keyboard shows up, it overlays half of the textbox. I would like to resize the textbox (or even the whole page) so it isnt covered by the keyboard. I am now thrying to achieve this using the static InputPane and subscribing to its showing and hiding events. I then try to change the margins of my textbox using the occuled rectangle provided in the eventargs. This works, but since my page is still the height of the screen it scrolls it halfway to the

RightTapped not fired on Metro ListViewItem if ListView in other than “None” selection mode

▼魔方 西西 提交于 2019-12-04 12:53:49
The issue is practically the same as described here: http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/542b827a-7c8e-4984-9158-9d8479b2d5b1 but I am not satisfied with the answer accepted there and feel that there must be a better solution... I am trying to implement a 'clasic' context menu on my list view (not via the AppBar but via PopupMenu) and that works fine, however only if I set the list view into the "None" SelectionMode. The link above correctly explains that the ListViewItem 'swallows' the right tapped event if ListView set to other than "None" selection mode.