uwp

Is there a method available for UWP apps to get available disk space

点点圈 提交于 2019-12-04 20:34:43
I am working on a UWP app that depends on available storage space, and would like to have that information prior to a save fail. I have tried the RetrievePropertiesAsync calls on the known folders, but do not get a Freespace or Capacity property in the resultant list. Is there a method available for this? Code used to access properties: auto basicProperties = co_await videosFolder->GetBasicPropertiesAsync(); auto retrievedProperties = co_await basicProperties->RetrievePropertiesAsync(propertiesToRetrieve); unsigned long freeSpace = retrievedProperties->Size; auto it = retrievedProperties-

C# user interface updates are not deterministic

冷暖自知 提交于 2019-12-04 20:24:38
UWP application, C#, Visual Studio 2017, Windows 10 Creators Update (10.0; Build 15063). Let's call TextBlock1 as T1, TextBlock2 as T2... Desired output is: T1 shows "Work started." T2 shows "Step 1" T2 shows "Step 2" T2 shows "" T1 shows "Work Finished." private async void Btn_Click(object sender, RoutedEventArgs e) { TextBlock1.Text = "Work started."; await DoWork(); TextBlock1.Text = "Work done."; } private async Task DoWork() { TextBlock2.Text = "Step 1"; await Task.Delay(1); //Pretend to do something TextBlock2.Text = "Step 2"; await Task.Delay(1); //Pretend to do something TextBlock2

Using ThreadPoolTimer with Background Audio UWP

巧了我就是萌 提交于 2019-12-04 20:22:36
I am making a UWP app using the BackgroundAudioTask. My app is working very well. Now I want to add in a TextBlock the Current position of the Audio played. I was doing this method before implementing the audio Task: private TimeSpan TotalTime; private DispatcherTimer timerRadioTime; private void radioPlayer_MediaOpened(object sender, RoutedEventArgs e) { TotalTime = radioPlayer.NaturalDuration.TimeSpan; // Create a timer that will update the counters and the time slider timerRadioTime = new DispatcherTimer(); timerRadioTime.Interval = TimeSpan.FromSeconds(1); timerRadioTime.Tick +=

uwp NavigationView control Titlebar

為{幸葍}努か 提交于 2019-12-04 20:20:20
I have a problem with the NavigationView Control and the titlebar. I have tried to extend the view into the titlebar to play with the acrylic effects of the standard NavigationView. But then I´ve noticed that the back and menu buttons are underneath the titlebar, so you´re not able to click them properly. In the attached image, you can see that everything under the red line is clickable but when you go over it, you are targeting the titlebar. Is there anything I can do to fix this behavior? I don't know which version OS you are working on, I didn't see this problem in recent Windows insider OS

How to create informative toast notification in UWP App

人盡茶涼 提交于 2019-12-04 20:06:38
问题 In my app, I want to inform user when particular action had performed, like record updated successfully or new record added, but there's not inbuilt control to that can display such information. Is there anything similar to Android Toast.makeText for UWP? 回答1: Yes, UWP has Toast Notifications :) Here is sample code to display simple notification: private void ShowToastNotification(string title, string stringContent) { ToastNotifier ToastNotifier = ToastNotificationManager.CreateToastNotifier(

UWPXamlHost control - UWP controls in desktop apps - Info and Status?

依然范特西╮ 提交于 2019-12-04 20:06:35
The most interesting announcement for me from the Microsoft Build 2018 developer conference was the demo showing the use of UWP controls in WPF and WinForms apps. ( https://youtu.be/ojZioTg5RUk?t=2250 ) Specifically they used a control named UWPXamlHost to achieve this functionality. So my questions would be: Is this control already available as a preview somewhere and if not is there an expected time frame when it will be available? Will it be part of the UWP Community Toolkit? Feel free to add any additional info you might have about this topic. I expect it to be part of the Windows

UWP serial port communication for character write and read (UWP and Arduino)

拥有回忆 提交于 2019-12-04 19:57:19
I am using this code but not working and throwing this exception: Object reference not set to an instance of an object devices[0] giving me null value. private async void ConnectToSerialPort() { string selector = SerialDevice.GetDeviceSelector("COM7"); DeviceInformationCollection devices = await DeviceInformation.FindAllAsync(selector); if (devices.Count > 0) { DeviceInformation deviceInfo = devices[0]; SerialDevice serialDevice = await SerialDevice.FromIdAsync(deviceInfo.Id); Debug.WriteLine(serialDevice); serialDevice.BaudRate = 9600; serialDevice.DataBits = 8; serialDevice.StopBits =

Make Clock UWP (C#)

喜你入骨 提交于 2019-12-04 19:46:47
I'm writing application for windows 10 and need to display Time inside the UI. I made the display like this Time.Text = DateTime.Now.ToString("h:mm:ss tt"); But I need to update it, any advice on how I can do this? Frauke Try this inside your XAML: <TextBlock x:Name="Time" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock> and this as your code: public sealed partial class ClockPage : Page { DispatcherTimer Timer = new DispatcherTimer(); public ClockPage() { InitializeComponent(); DataContext = this; Timer.Tick += Timer_Tick; Timer.Interval = new TimeSpan(0, 0, 1); Timer

Images are Getting cached in UWP application

做~自己de王妃 提交于 2019-12-04 19:40:53
In my UWP application I am binding the images from azure. It is getting cached when it get the response. When I change the image in the azure it's not reflecting in my UI, Instead it display the image from cache. Is there any way to clear the cache of my UWP application or to restrict the application to cache images?. Have you tried CreateOptions="IgnoreImageCache" ? <Image> <Image.Source> <BitmapImage UriSource="{Binding Url}" CreateOptions="IgnoreImageCache" DecodePixelWidth="120" DecodePixelHeight="120" /> </Image.Source> </Image> But make sure you set the proper decode pixel width/height

Get Installed win32 application

和自甴很熟 提交于 2019-12-04 19:26:27
Is there any way to get installed win32 applications in UWP project?(since in uwp project I am unable to add reference of wmi call and registry).If so how it is achieved ? Classical win32 application can get installed win32 applications on the device by reading the registry. But in a store app, in short answer, it cannot. A store app runs in an isolated sandbox and cannot read the system level registry. For details reasons about why store app doesn't support access the registry please reference this thread . However, if you don't want upload your app to windows store, you can try out the