microsoft-metro

PointerPressed not working on left click

佐手、 提交于 2019-12-03 22:59:06
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"/> The solution is pretty simple: these events have to be handled not through XAML but thorugh AddHandler method. SomeButton.AddHandler(PointerPressedEvent, new PointerEventHandler(SomeButton_PointerPressed), true); I have encountered

How to prevent/disable snapped view for Windows 8 Metro UI applications

这一生的挚爱 提交于 2019-12-03 21:50:18
I have an application that really makes no sense for snapped view, as the content generally represents A4 pages of information and data collection. Is there a way to disable snapped view for the application, or is the recommended approach to just show the application icon, while in snapped mode? You cannot disable snapped view. Simply just create a new page and navigate to that page if a snap event occurred. You can simply display an image. Window.Current.SizeChanged += (object sender, Windows.UI.Core.WindowSizeChangedEventArgs e) => { ApplicationViewState myViewState = ApplicationView.Value;

Metro App Change ListView Selected Item Content Foreground

删除回忆录丶 提交于 2019-12-03 21:42:27
I have a ListView and modified it's DataTemplate with 2 TextBlocks . The first TextBlock contains a Heading , the second a Sub-Heading . I style the 2 TextBlocks with different colours. Here's an example of the ListViewItem in Normal view. Here's an example of the ListViewItem in Selected view. So my question is how do I change the Foreground colours of the TextBlocks in Selected views? Hoping to do this in the xaml. I've tried setting different brushes, which work for items that haven't explicitly been styled. Not sure how to handle this scenario. You can use visual states. <ListView>

Metro App CollectionViewSource ObservableCollection Filter

谁说胖子不能爱 提交于 2019-12-03 20:43:39
It appears that filtering an ObservableCollection with CollectionViewSource is not possible in WinRT : See here! I can filter using LINQ , but how do I get the UI to update if changes that affect the filtered data are made? I ended up writing my own class to achieve the desired effect: public class ObservableCollectionView<T> : ObservableCollection<T> { private ObservableCollection<T> _view; private Predicate<T> _filter; public ObservableCollectionView(IComparer<T> comparer) : base(comparer) { } public ObservableCollectionView(IComparer<T> comparer, IEnumerable<T> collection) : base(comparer,

linq to sql (Local database for Windows Phone) better ? (OR) A sqlite-net version for mobile better ?? for windows phone 8 local database creation

孤街醉人 提交于 2019-12-03 20:31:39
Hi I am creating windows phone 8 app , i want to store huge amount data in my app , i have already completed my windows 8 tablet app using sqlite version for windows 8. my doubt is regarding creating a local datbase in windows phone 8 which is the most reliable one to go with ? option 1:- Working with SQLite in Windows Phone 8: a sqlite-net version for mobile option 2:- linq to sql (Local database for Windows Phone) if i use the option 1 i can easily re-use all my Data, DALC, BIZ layers as it is even in my phone versions (which i already built for windows 8 tablet app). if i use option 2 i

Is MVVM dead in Windows 8 Store Apps?

可紊 提交于 2019-12-03 16:59:44
问题 I have started learning about Windows 8 Store Apps. I recall from Silverlight and WPF programming earlier that people adapted the MVVM concept and now I am not sure if I should use what i learned back then or not. I added a reference to the GalaSoft.MvvmLight and created a ViewModel and added it to my xaml as suggested by: DataContext="{Binding Source={StaticResource Locator}, Path=Welcome}" It looks like Microsoft included some kind of ModelView implementation in the LayoutAwarePage:

Local storage of structured data in Win8 Metro-style apps [closed]

≡放荡痞女 提交于 2019-12-03 16:14:41
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . In a desktop .NET application, the standard option for implementing a local relational database is to use SQL Server Compact Edition,

how to create collection (1:n) relation

為{幸葍}努か 提交于 2019-12-03 15:10:49
I'm implementing SQLite database in my Windows Store application (WinRT). I want to relation between two tables (1:n) Book (1) - Chapter (n) class Book { [SQLite.AutoIncrement, SQLite.PrimaryKey] public int Id { get; set; } public String Title { get; set; } public String Description { get; set; } public String Author { get; set; } public List<Chapter> Chapters { get; set; } public Book() { this.Chapeters = new List<Chapter>(); } } I get - $exception {"Don't know about System.Collections.Generic.List`1[Audioteka.Models.Chapter]"} System.Exception {System.NotSupportedException} + [System

How to convert a simple stream(http webresponse) to bitmapimage in c# windows 8?

[亡魂溺海] 提交于 2019-12-03 14:12:17
I try 1000 times, to convert a simple stream (http webresponse) to bitmapimage, but no one tutorial is working in c# windows 8. Example: BitmapImage image = new BitmapImage(); image.SetSource(stream); image1.Source = image; Thank's for all reply. Solution InMemoryRandomAccessStream randomAccessStream = new InMemoryRandomAccessStream(); DataWriter writer = new DataWriter(randomAccessStream.GetOutputStreamAt(0)); writer.WriteBytes((byte[])command); await writer.StoreAsync(); BitmapImage image = new BitmapImage(); image.SetSource(randomAccessStream); Have you tried this?

CurrentAppSimulator.RequestProductPurchaseAsync purchasing simulation

落爺英雄遲暮 提交于 2019-12-03 14:07:07
问题 I am trying to implement in-app purchase for my Windows Store App (Metro App). I was referring to the code samples here, but when I triggered the RequestProductPurchaseAsync method nothing happens. When I say nothing happens, it means literally nothing. No return results (the result was supposed to be a receipt since I passed in true for includeReceipt ). Also, when I re-checked the ProductLicences[string].IsActive flag it will always return me false. How do I test this out properly? Thanks a