windows-10-universal

How to set min size of windows universal app on desktop?

不想你离开。 提交于 2021-02-19 08:20:28
问题 I would like to set min size like 800x600 for my windows universal app which on desktop. I found a method ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(800, 600)); but it doesn't work, I still can drag the window to 500x300. What I miss ? 回答1: I found a solution https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.viewmanagement.applicationview.tryresizeview for desktop, I can set a min size which is bigger than 500x500 as below code. private void Page

universal windows, c#, await during app initialization

谁说我不能喝 提交于 2021-02-11 12:38:30
问题 I'm trying to port a simple app I had running on Windows Phone 8 to Universal Windows. I have a few files I need to load (locally) before constructing the main frame/page as those instruct how to create the page in the first place. There is a .XML and a few content files that are part of Assets. I used to do the initialization during the App.Application_Launching() which I guess now is replaced by App.OnLaunched(). The trouble is with the new asynchronous-only file IO I can't seem to find a

universal windows, c#, await during app initialization

≯℡__Kan透↙ 提交于 2021-02-11 12:38:17
问题 I'm trying to port a simple app I had running on Windows Phone 8 to Universal Windows. I have a few files I need to load (locally) before constructing the main frame/page as those instruct how to create the page in the first place. There is a .XML and a few content files that are part of Assets. I used to do the initialization during the App.Application_Launching() which I guess now is replaced by App.OnLaunched(). The trouble is with the new asynchronous-only file IO I can't seem to find a

Not able to access the Word Document on my system using the UWP application

走远了吗. 提交于 2021-02-10 07:54:10
问题 I am trying to edit a existing Word document using the UWP app (Universal Windows). But for some reason I am getting "File does not exist" error. I have tried using the below code to access the word document: using(WordprocessingDocument wordDoc = WordprocessingDocument.Open("C:\\Users\\Public\\Desktop\\Doc1.docx", true)) { } System.IO.FileNotFoundException: 'Could not find document' 回答1: Based on further clarification in the comments section, please see the following instructions. Add your

Not able to access the Word Document on my system using the UWP application

一笑奈何 提交于 2021-02-10 07:53:03
问题 I am trying to edit a existing Word document using the UWP app (Universal Windows). But for some reason I am getting "File does not exist" error. I have tried using the below code to access the word document: using(WordprocessingDocument wordDoc = WordprocessingDocument.Open("C:\\Users\\Public\\Desktop\\Doc1.docx", true)) { } System.IO.FileNotFoundException: 'Could not find document' 回答1: Based on further clarification in the comments section, please see the following instructions. Add your

Create Tiff File from multiple BitmapImage

二次信任 提交于 2021-02-08 03:32:11
问题 Background: I'm developing Win 10 Universal App, have list of BitmapImage: List<BitmapImage> ImagesList = new List<BitmapImage>(); Each list item is created by converting byte[] to BitmapImage by this code: public async Task<BitmapImage> GetBitmapImage(byte[] array) { using (InMemoryRandomAccessStream stream = new InMemoryRandomAccessStream()) { using (DataWriter writer = new DataWriter(stream.GetOutputStreamAt(0))) { writer.WriteBytes(array); await writer.StoreAsync(); } BitmapImage image =

Create Tiff File from multiple BitmapImage

可紊 提交于 2021-02-08 03:32:11
问题 Background: I'm developing Win 10 Universal App, have list of BitmapImage: List<BitmapImage> ImagesList = new List<BitmapImage>(); Each list item is created by converting byte[] to BitmapImage by this code: public async Task<BitmapImage> GetBitmapImage(byte[] array) { using (InMemoryRandomAccessStream stream = new InMemoryRandomAccessStream()) { using (DataWriter writer = new DataWriter(stream.GetOutputStreamAt(0))) { writer.WriteBytes(array); await writer.StoreAsync(); } BitmapImage image =

(UWP) How to activate the “Taskbar Miniplayer” like in Groove

你离开我真会死。 提交于 2021-02-07 20:17:30
问题 I use the BackgroundMediaPlayer for my App to play Audio in the Background. Now i see these buttons: How can i activate them? 回答1: In order to make the media controls from the taskbar to work, you need to load and configure the SystemMediaTransportControls from the foreground application AND the background task. If you are doing it only from the background task, the controls will be displayed but they will remain disabled. In your foreground application, you should have the following code:

(UWP) How to activate the “Taskbar Miniplayer” like in Groove

安稳与你 提交于 2021-02-07 20:15:37
问题 I use the BackgroundMediaPlayer for my App to play Audio in the Background. Now i see these buttons: How can i activate them? 回答1: In order to make the media controls from the taskbar to work, you need to load and configure the SystemMediaTransportControls from the foreground application AND the background task. If you are doing it only from the background task, the controls will be displayed but they will remain disabled. In your foreground application, you should have the following code:

Page with type parameter

北战南征 提交于 2021-02-07 19:27:46
问题 I would like to use new feature of UWP -> x:Bind. In order to that, all my pages need to have ViewModel property (as described in tutorials). To avoid code duplicity, I have established base class as follows: public abstract class BasePage<TBaseVM> : Page, where TBaseVM : BaseVM { public TBaseVM VM { get; private set; } protected BasePage() { DataContextChanged += (s, e) => VM = e.NewValue as TBaseVM; } } As you can see this BasePage class contains property called "VM" and property is of type