microsoft-metro

LINQ Where clause with four &&

浪尽此生 提交于 2019-12-05 16:18:57
I'm trying to create an LINQ Query with 4 arguments in the Where clause. It's a Windows 8 App project and I'm using an SQLite Database. ( SQLite implementation ) Here's the code snippet: public List<FinancialListBoxExpenseItem> retrieveExpenseItems(int month, int year, bool isPaid, StaticResources.FrequencyEnum frequencyEnum) { List<FinancialListBoxExpenseItem> tmpList = null; connection.RunInTransaction(() => { var items = from s in connection.Table<FinancialListBoxExpenseItem>() where (s.expenseDateNextPayment.Month == month) && (s.expenseDateNextPayment.Year == year) && (s

How to update a data bound combobox when the source data changes?

安稳与你 提交于 2019-12-05 16:14:37
I'm working on a C# Metro style app for Windows 8, and I'm having a problem getting my data bound combo box to update when the source data changes. Here's the data source: public class Range { public string range_name { get; set; } public string range_description { get; set; } public int min { get; set; } public int max { get; set; } } static List<Range> ranges = new List<Range> { new Range { range_name = "Foo", range_description = "Foo: (0-10)", min = 0, max = 10}, new Range { range_name = "Bar", range_description = "Bar: (5-15)", min = 5, max = 15}, new Range { range_name = "Baz", range

How to Interop with Windows Runtime in .NET 4.5

狂风中的少年 提交于 2019-12-05 15:28:48
I see this namespace: System.Runtime.InteropServices.WindowsRuntime Which provides interop between .NET and WindowsRuntime. For instance, you can invoke a method in WindowsRuntime when you create a Metro application, as Metro uses WindowsRuntime, like Windows.System.UserProfile.UserInformation But when you create a normal .NET console application or WPF application, you can no longer directly reach WindowsRuntime namespaces such as Windows.System I wonder if it were possible to invoke WindowsRuntime methods by using interop in the above-mentioned namespace. A lot of thanks in advance! A .NET

How do I detect multitouch actions in a Windows 8 metro app?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 15:02:48
I am working on a metro app right now and I'm looking to enable multitouch. I've browsed around google, but I can't seem to find any API to support it. Can someone point me in the right direction to support multitouch actions in a Windows 8 Metro app? What exactly are you trying to do? There are Touch, Pointer (an abstraction around touch/mouse/stylus), and Manipulation events on every UI element In JavaScript you can use the event.pointerId to detected multiple touch inputs. This identifier gives every new input an id. When you want to get multiplie touches for a move with the finger, you can

Load C library (gsdll32.dll) from Metro Style App c#

China☆狼群 提交于 2019-12-05 12:12:34
I want to use gsdll32.dll from Metro Style App c#. I load dll as follow: [DllImport("gsdll32.dll", EntryPoint = "gsapi_delete_instance")] private static extern void gsapi_delete_instance(IntPtr instance); [DllImport("gsdll32.dll", EntryPoint = "gsapi_revision")] private static extern int gsapi_revision(ref GS_Revision pGSRevisionInfo, int intLen); [DllImport("gsdll32.dll", EntryPoint = "gsapi_set_stdio")] private static extern int gsapi_set_stdio(IntPtr lngGSInstance, StdioCallBack gsdll_stdin, StdioCallBack gsdll_stdout, StdioCallBack gsdll_stderr); But when I try to load dll not found

How do I parse a date in a Metro (C++/CX) app?

五迷三道 提交于 2019-12-05 11:46:00
问题 I have a C++/CX app that is processing some data from a file. It has a string in there representing the culture that was used to save the dates, and it has some dates. I need to convert them from strings to Platform::DateTime. I have heard that Windows::Globalization::DateTimeFormatting is the class to use, but I don't see how to use it for that. Does anyone have an example? 回答1: The C++/CX projection of WinRT differs from the Managed (C#/VB) projection in a number of ways, and one of the

PointerPressed not working on left click

谁都会走 提交于 2019-12-05 10:52:41
问题 Creating Metro (Microsoft UI) app for Windows 8 on WPF+C#, I met difficulty with PointerPressed event on a button. Event doesn't happen when i perform left-click (by mouse), but it happens in case with right-click or tap. So what's wrong with that event? for example <Button x:Name="Somebutton" Width="100" Height="100" PointerPressed="Somebutton_PointerPressed"/> 回答1: The solution is pretty simple: these events have to be handled not through XAML but thorugh AddHandler method. SomeButton

WinRT - Display animated GIF in a control

倖福魔咒の 提交于 2019-12-05 10:25:26
I need to display an animated GIF in my metro app, but I can't find any control that allows it. (I tried Image , MediaElement and MediaPlayer from the Player Framework) Is it possible somehow to display an animated GIF? While I haven't checked if it works and it might not work for you due to airspace issues - you could try hosting your gif in a WebView control. It might be a lot easier than the otherwise better solutions proposed by Norbert and Carl. You can achieve this natively by using the BitmapDecoder class in the .NET Framework. I have an example on my blog, that shows how to implement

Locked screen in windows 8 WinRT

折月煮酒 提交于 2019-12-05 08:18:00
When my app is running in Windows 8 WINRT can I prevent the OS to go to locked screen/sleep mode? You can use the DisplayRequest class to indicate that you are busy playing back something that requires the display to stay active and un-dimmed. A good how-to article with sample code is available here . Don't use it frivolously, it is quite detrimental to power consumption. Good odds that the Store will reject your app if you use it for no obvious benefit to the user. You cannot prevent OS to go to lock screen/sleep/shut-down etc. If you want your application to run behind the scenes, you may

Dependency Injection framework for Windows 8 metro apps

旧时模样 提交于 2019-12-05 08:01:28
i can't seem to find a dependency injection framework for windows 8 metro apps. Is there a framework for win8 metro apps? Ninject is not yet support for win8 metro. So does anybody have a suggestion? (Castle, Spring, ...) Here is the source for Ninject WinRT: https://github.com/remogloor/ninject It just not yet released. You could try Unity 3.0 for .NET4.5 Preview . I've been using the Beta version of Autofac Portable Library (which is supported in Metro apps) and it is working great so far. The Catel MVVM toolkit also contains a DI-container, it's metro version will be released this week