windows-runtime

Allowing suspension of a windows store app when audio is paused

久未见 提交于 2019-12-23 02:42:09
问题 One of the requirements for windows store apps is that they support suspending. My app is marked as a background audio task, so it doesn't suspend when left alone, but it is supposed to suspend when the audio is paused. I can't find out how to "tell Windows" when it can or can't suspend. How do I have my background audio application pass the package validation? 回答1: To enable background audio you must register handlers for the Media Control button events. These are in the Windows.Media

Rendering an image at runtime in WinRT

时间秒杀一切 提交于 2019-12-23 02:01:47
问题 I found that WriteableBitmap.Render() is not supported in WinRT. Is there any other API for drawing bitmap images in Metro? I need to render some xaml-primitives (Rectangles, Circles, Paths, etc.) to png-image. 回答1: It is indeed not supported yet. Your best bets are to either use WriteableBitmapEx or Direct2D. 来源: https://stackoverflow.com/questions/11840835/rendering-an-image-at-runtime-in-winrt

Keep selection visual in RichEditBox on unfocus?

我是研究僧i 提交于 2019-12-23 01:59:12
问题 Does someone know a way to keep the visual selection state of a selected text in a RichEditBox? I want to add some basic text editing to my Windows 8.1 App but every time I select a text and click on another UI Element within the app, the RichEditBox hides the selection. I already tried to register the unfocus event an set the selection range again but unfortunately this has no effect. I also tried to draw my own rect over the Text using richEdit.Document.Selection.GetRect(PointOptions

How to locate where an error arises in a “PackageManager.AddPackageAsync” method call?

笑着哭i 提交于 2019-12-23 01:57:20
问题 I'm debugging an example app that deploys an Windows Metro App Package (".Appx" file). It call a WinRT method "PackageManager.AddPackageAsync" which fails with detailed error code text (retrieved from the call return value after the operation was finished): error 0x80070002: Windows cannot register the package because of an internal error or low memory. My target is to find where exactly this error arises in the WinRT call. I think the best way for achieving this is by finding where the error

How to center Popup in Metro style app in c#

耗尽温柔 提交于 2019-12-22 18:48:18
问题 Is there any way to show a Popup in Windows 8 Metro centered? Setting VerticalAlignment and HorizontalAlignment to "Center", and VerticsalOffset and HorizontalOffset to 0 causes howing popup with left-up corner in the center of the screen. Is there any way to do it nicely? To make this problem harder, this popup has different size in snapped view, where is also should be centered. Any thoughts? 回答1: Hope this helps, how about placing the popup in a canvas then manipulate the canvas... XAML

ServicePoint.Expect100Continue for Windows Store Apps

拟墨画扇 提交于 2019-12-22 18:20:46
问题 As the title says, i need to set this flag to false for my app, like so: ServicePoint.Expect100Continue = false; However neither ServicePoint nor ServicePointManager are accessible, and i can't find another way to set this property. Also, there is no app.config so setting it via configuration is also not possible. If i do no set this to false, the flag is sent in the request and a CommunicationException occurs. I cannot change server code, i am only a consumer of server data. The service is

Very bad SQLite performance on Windows Phone 8

試著忘記壹切 提交于 2019-12-22 18:12:22
问题 I have a Windows Phone 8 Application that uses a SQLite database. To access the database, I use the WinRT Wrapper by Andy Wigley (source) My database is very simple, only one table: Locations: integer primary key "FieldIndex", varchar "Field1", varchar "Field2", varchar "Field3", varchar "Field4", varchar "Field5", varchar "Field6", int "CategoryID" I also have a index on both "FieldIndex" and "CategoryID". There are in total 4000 entries in the table with the database being 900 kB in size. I

Metro style : Scrolling with mouse wheel

风流意气都作罢 提交于 2019-12-22 14:08:13
问题 I have gridview in the gridview and want to implement the mouse wheel scrolling functionality. So I added this block into the internal gridview <GridView.Template> <ControlTemplate > <ItemsPresenter /> </ControlTemplate> </GridView.Template> But in this case swiping doesn't work How manage I to solve this problem? part 2. I'll try to describe this situation more deeply. I have main screen that should realize functionality like on the main screen in Windows 8. It should be zoomed in/out. That

state handling in windows 8 using mvvmlight

点点圈 提交于 2019-12-22 12:38:09
问题 Implementation of state handling in windows 8 using mvvmlight Is there any method avilable in mvvmligt to manage states in WinRT? How I can duplicate the functionality of default Suspensionmanager by using WinRT? And the second one is about managing navigation cycle ie if I navigated from page A - > B. and the go for suspend and shutdown state. When I re start the application in need to open page B. and while presses back key I need to load A. How I can effectively implement this using MVVM

How to get all files in a StorageFolder in Windows Phone Runtime?

百般思念 提交于 2019-12-22 11:09:29
问题 I want to get all files in a folder and its sub folders. but a flat query like this: var allFiles = await myFolder.GetFilesAsync(Windows.Storage.Search.CommonFileQuery.OrderByName); throws a ArgumentException exception: A first chance exception of type 'System.ArgumentException' occurred Additional information: Value does not fall within the expected range. before I query subfolders one by one, isn't there any other way? 回答1: You want all the files and folder which are a descendent of the