microsoft-metro

Keep the collections in the list in MVVM

陌路散爱 提交于 2019-12-25 16:44:38
问题 currently im having troubles in keeping the collections in the list in the mvvm, every time that i navigate away and return to a page, the list keeps getting empty. how am i going to deal with this? can someone help me with this? The Model: I have not implemented the others yet because i cant add items to the list class CartData { public int Cakeprice { get; set; } public ImageSource ImagePath { get; set; } public string Caketype { get; set; } public string Cakename { get; set; } public int

Cannot launch default application in a Metro app

我的未来我决定 提交于 2019-12-25 06:44:08
问题 Ok, so Windows 8 comes with a cool PDF and XLS reader app, called Reader. I have a help document that I want displayed when the user clicks the Help button inside my app. My app should launch the PDF document with whatever is the default viewer for that document type. But it won't. There are no errors, no exceptions and setting a breakpoint reveals no information. The code I have is: <Button x:Name="help" Style="{StaticResource HelpAppBarButtonStyle}" Tag="Help" Click="help_Click_1" /> and:

How to set a background color of a control in windows 8 store application

允我心安 提交于 2019-12-25 06:39:18
问题 I am designing an application and had to instantiate controls via code. The problem is that I am unable to change the background color. I tried to look all over the internet, but no succes. I have contacted the Microsoft support service, but no succes either. I read that you normally change a color by using System.Color or System.ColorHelper. Both are not accesible in the application. So how to solve the following problem: TextBox^ txtID = ref new TextBox(); txtID->Background = ?; 回答1: I have

Windows 8 Metro/Immersive App - Force Terminate

偶尔善良 提交于 2019-12-25 06:18:08
问题 I'm working on porting an app from iOS to WinRT/8 Metro/8 Immersive/Whatever the current name is. On iOS, we have the ability to set Application does not run in background to YES to cause the app to actually quit whenever the user leaves the app. I would like to figure out how to replicate this behavior in WinRT. Yes, I understand that this is abnormal behavior. Yes, I have thought this through. Yes, I have an extremely good reason for doing this. I'm assuming that during the userLeavingApp

Windows 8 Metro/Immersive App - Force Terminate

偶尔善良 提交于 2019-12-25 06:18:03
问题 I'm working on porting an app from iOS to WinRT/8 Metro/8 Immersive/Whatever the current name is. On iOS, we have the ability to set Application does not run in background to YES to cause the app to actually quit whenever the user leaves the app. I would like to figure out how to replicate this behavior in WinRT. Yes, I understand that this is abnormal behavior. Yes, I have thought this through. Yes, I have an extremely good reason for doing this. I'm assuming that during the userLeavingApp

Accessing ComboBox inside a Datatemplate of a listbox from c# code behind in metro application?

 ̄綄美尐妖づ 提交于 2019-12-25 06:09:41
问题 i have a combo box present inside a list-box , listbox has a datatemplate in which this combobox and other elements resides . <ListBox x:Name="lstbxbProducts" HorizontalAlignment="Left" Height="547" Margin="0,221,0,0" VerticalAlignment="Top" Width="1044" RenderTransformOrigin="0.600000023841858,0.5"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <StackPanel Width="80" Orientation="Horizontal"> <TextBlock Text="{Binding prdnum}" VerticalAlignment="Center"

Style only works for the first occurence when outside Grid.Resources?

[亡魂溺海] 提交于 2019-12-25 05:50:45
问题 I have a gridview with a data template which includes a togglebutton. The datatemplate for the items in the Gridview has a grid in it, with a stylized togglebutton. The style for the togglebutton is located in Grid.Resources. It works fine, but when I move the style from Grid.Resources to either Page.Resources or App.xaml, the content inside the button that is defined in the style disappears from all except the first occurrence of the button in the gridview. Here is the style: <Style

How to refresh the UI in a metro app?

对着背影说爱祢 提交于 2019-12-25 05:31:03
问题 I'm using this code in a XAML page: <TextBox ItemsSource="{Binding Posters, Converter={StaticResource collectionToFirstElementConverter}, Mode=TwoWay}" /> Posters is an ObsevableCollection and I'm using a converter where takes the collection and gets the first element of it. As I'm using async procedures, where the textbox receives the object, this one has no elements (Count=0), and calls the converter. I'm trying to update the textbox everytime the property add new elements, but not calls

Metro app Holding event in games

怎甘沉沦 提交于 2019-12-25 05:28:29
问题 I made a game where user navigates a character. Since it is designed for both PC and tablet (with Win8), there are two options how to do it. 1) using keyboard ( Key_Down and Key_Up events) 2) using touch and hold ( Tapped and Holding events) Unfortunately there is a problem with Holding event, because it raises after a long time period (I think 1 sec). I had to use word long there becase it really is a long time period in games. Now, I need a better solution. There is a onscreen joystick in

How to load webview with post parameters in windows 8?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-25 03:49:44
问题 I need to load website using webview in metro apps. I could post login parameters using following method. how to load the same in webview?????? string post_data = "userName=test123&password=test@321"; // this is where we will send it string uri = "http://tesproject.com"; // create a request HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); request.Method = "POST"; // turn our request string into a byte stream byte[] postBytes = Encoding.UTF8.GetBytes(post_data); // this is