winrt-xaml

SuspensionManager Error when application has more than 1 page in windows 8 XAML/C# app

别说谁变了你拦得住时间么 提交于 2019-12-11 04:07:31
问题 I'm writing a windows 8 XAML/C# app and have a little problem with the session manager. Within my App.xaml.cs my OnSuspending method looks like this: private async void OnSuspending(object sender, SuspendingEventArgs e) { var deferral = e.SuspendingOperation.GetDeferral(); //TODO: Save application state and stop any background activity await SuspensionManager.SaveAsync(); deferral.Complete(); } I have registed my rootFrame with the SuspensionManager in the OnLaunched method in App.xaml.cs:

0x800a1391 - JavaScript runtime error: 'WinJS' is undefined

落花浮王杯 提交于 2019-12-11 04:04:49
问题 I have download the code from CodePlex Then I install the sdk's of live,telerik etc After installation I ran the code and I'm getting the following error `0x800a1391 - JavaScript runtime error: 'WinJS' is undefined` The error occured in the Converters.Js file here it is (function() { var r = Windows.Storage.ApplicationData.current.roamingSettings.values; // Export shortDate WinJS.Namespace.define("codeSHOW.Converters", { // Error Occured here }); })(); Any help is highly appreciated. Thanks.

Flyout.showAt() ArgumentException based on Content

ⅰ亾dé卋堺 提交于 2019-12-11 03:42:17
问题 I am trying to use a Flyout this way this.DefaultViewModel["SelectedVideo"] = vi; Flyout f = new Flyout(); f.Content = this.videoFlyoutContent; f.ShowAt(videosGrid); // HERE I GET AN EXCEPTION while I have the following XAML code <Page.Resource> <!-- ................ --> <!-- ................ --> <x:Double x:Key="FlyoutWidth">500</x:Double> <x:Double x:Key="FlyoutHeight">440</x:Double> <x:Double x:Key="FlyoutTextWidth">400</x:Double> <ContentControl x:Name="videoFlyoutContent"> <Grid

Save the page state when navigating out

北城以北 提交于 2019-12-11 03:37:40
问题 Say I have two pages, A and B. The user can modify things on page A then navigate to page B. When he is on page B, he clicks the "Back" button to go to page A. Everything that has been done previously is lost. There is a way to get the exact same state by using this.NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Enabled; But is there a way to know whether the page is opened for the first time a by using the back button? 回答1: yes it is: protected override void

Change global application font in a Windows 8.1 app

左心房为你撑大大i 提交于 2019-12-11 03:32:13
问题 There are lots of articles online about how to embed custom fonts, create font styles and apply them to controls. But how can one override the global application font such that each control uses that font instead of setting the FontFamily property manually for each control. In my case, I do not wish to use a custom font as the global font but a system font such as Tahoma or Calibri. 回答1: In winrt default Fontfamily for all controls ContentPresenter is Segoe Ui and its key is

Embedded Xaml pages on DLL

亡梦爱人 提交于 2019-12-11 03:27:07
问题 I am developing some UI components with the new Metro Design (WinRT) in order to provide them to a third party company. We are having some trouble deploying the package of the controls. When they reference our .dll files produced by our controls on a new Project, they can access all the objects and instantiate them, but when compiling, an error of the type: "Payload file '...\bin\Debug\Charts\Line\Line.xaml' does not exist." . (if we provide the /bin .dll) OR XamlParseException at Windows.UI

Simple radial gradient background in Metro-Style App

≡放荡痞女 提交于 2019-12-11 03:16:17
问题 What would be a simple way of drawing a radial gradient background (also being able to change it's color) in a XAML/C# Metro-Style App ? Is using DirectX an option ? I tried looking at some SharpDX samples for Windows 8 Consumer Preview but failed to compile them. Haven't found any other samples of using DX in C# on Windows 8. Any ideas ? 回答1: RadialGradientBrush has not been added to the XAML stack yet. You can use WriteableBitmapEx to draw the gradient to a WriteableBitmap yourself and then

Unable to detect the selected FileTypeChoice from FileSavePicker

扶醉桌前 提交于 2019-12-11 01:56:29
问题 I would like to let the user choose a save option while selecting a file type. The selection works fine as in the below example. However after the user has selected a file type to be saved, I have not found a possibility to check which type he has selected. Please note: Both file type choices have the same extension. The difference between the two is the display name. var fsp = new FileSavePicker(); fsp.FileTypeChoices.Add("my file type", new List<string> {".extension"}); fsp.FileTypeChoices

XAML - ListViewItem - IsEnabled Binding

£可爱£侵袭症+ 提交于 2019-12-11 01:31:50
问题 Please put me out of my misery: <ListView.ItemContainerStyle> <Style TargetType="ListViewItem"> <Setter Property="IsEnabled" Value="{Binding MyBoolField}" /> </Style> </ListView.ItemContainerStyle> Where MyBoolField is a property available on each item in the ListView 's assigned ItemsSource , and is of course of type bool . The desired behaviour is that the IsEnabled property of each ListViewItem is bound to the MyBoolField property of the object it contains (an element from the ListView 's

Windows 8 Metro App (Grid Application) transition with black flickering

a 夏天 提交于 2019-12-11 01:12:06
问题 I'm building a Windows 8 Metro App based on the Grid Application template. Everything was going smoothly until I tried to change the Theme and Background of the App. I applied an Image Background to all 3 XAML Page's Grid. Also, I changed the Theme to "Light" in the Application Package Manifest, but it didn't do anything. After searching I found a solution, setting RequestedTheme="Light" in the App.xaml Now, I have a Light themed Application with the background I want, but every time I