winrt-xaml

WinRT timed logout

泪湿孤枕 提交于 2019-12-12 15:41:45
问题 I am developing a WinRT app. One of the requirements is that the app should have a "timed logout" feature. What this means is that on any screen, if the app has been idle for 10 mins, the app should logout and navigate back to the home screen. The brute force way of doing this obviously would be to hook up pointer pressed events on every grid of every page and resetting the timer if any of these events is fired but I was wondering if there was a more elegant and more reliable way of doing

Buttons styled to look like app bar buttons

这一生的挚爱 提交于 2019-12-12 12:03:33
问题 Is it possible to style a xaml button tag to look like an application bar button by changing the style? and how can it be done. 回答1: Hope this Helps. <Page.Resources> <Style x:Key="RoundedButton" TargetType="Button"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"></RowDefinition> <RowDefinition Height="30"></RowDefinition> </Grid.RowDefinitions> <Ellipse Name="Ellipse" Grid.Row="0" StrokeThickness="1"

WinRT Xaml Toolkit Column Series Error?

一曲冷凌霜 提交于 2019-12-12 11:34:20
问题 I have a Chart from Win RT Xaml Toolkit that I want to display a ColumnSeries like this: <charting:Chart Name="columnChart" Grid.Row="1" Grid.Column="1" Width="400" Height="400"> <charting:Chart.Series> <charting:ColumnSeries ItemsSource="{Binding items}" IndependentValueBinding="{Binding Name}" DependentValueBinding="{Binding Value}" IsSelectionEnabled="True"> </charting:ColumnSeries> </charting:Chart.Series> </charting:Chart> but I always receive this error: WinRT information: Cannot add

Why does FlipView ignore SelectedItem

微笑、不失礼 提交于 2019-12-12 10:52:31
问题 I'd like to use a FlipView to display some items and start showing a specific item. For this, I have defined a view model class: class MyDataContext { public MyDataContext() { Items = new List<MyClass>(); Items.Add(new MyClass("1")); Items.Add(new MyClass("2")); Items.Add(new MyClass("3")); SelectedItem = Items[1]; } public List<MyClass> Items { get; set; } public MyClass SelectedItem { get; set; } } As you can see, the selected item is not the first item. Now for the XAML: <FlipView

How can I make SQLite work on Windows 10?

拥有回忆 提交于 2019-12-12 10:31:21
问题 Yo, So I've been developing a Universal Windows Store app in Visual Studio 2013 on one machine, and wanted to continue developing it on an another machine running Windows 10 Technical Preview. The problem is that in Visual Studio 2015 Preview there is a new C++ Redistributable package version (2015), and the latest SQLite requires version 2013, so that particular reference is missing. I can build the project, it deploys successfully, but there is an exception saying it can't load sqlite3.dll.

Change the Foreground color of a TextBlock inside a ListView's DataTemplate when the item is selected

情到浓时终转凉″ 提交于 2019-12-12 10:26:34
问题 I'm building a Windows Store app with C#/XAML. I have a simple ListView bound to an ItemsSource. There's a DataTemplate which defines the structure of each item and that has a ContentControl and a TextBlock in it. I wish to change the Foreground colour of the TextBlock when the item is selected. Does anyone know how I can do this? <ListView Grid.Column="1" ItemsSource="{Binding Categories}" ItemContainerStyle="{StaticResource CategoryListViewItemStyle}" Background="{StaticResource

How to bind absolute coordinates of a shape/control inside Canvas

非 Y 不嫁゛ 提交于 2019-12-12 10:24:06
问题 On a Windows 8.1 Metro app, I'm trying bind a collection of shapes from my view model into MainPage.xaml. Each shape will have a Left , Top and also a PathData which will be a RectangleGeometry that contains the rectangle that I want drawn inside the canvas at the corresponding position. This is the XAML : <Grid Background="Black"> <ItemsControl ItemsSource="{Binding Shapes}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Canvas /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel>

How to create an image-button

我的梦境 提交于 2019-12-12 10:19:04
问题 I create an image-button using below code: ImageBrush btnBrush1 = new ImageBrush(); btnBrush1.Stretch = Stretch.Uniform; btnBrush1.ImageSource = new BitmapImage(new Uri("ms-appx:/Images/icon_LogIn.png")); btnLogIn.Background = btnBrush1; The problem: 1) When using a mouse hovering the img-button, it turn grey background and icon disappear ( when not hovering the img-button, this image button is visible. I want this image-button visible when hovering it or pressing it. Thanks 回答1: You need to

listview visual state manager in item template (WinRT, Metro, XAML)

亡梦爱人 提交于 2019-12-12 08:55:02
问题 I am trying to get a listview to display a list of items made up of textblocks... when the listview item is clicked i would like to show instead a list made up of textboxes... Below is what i have come up with, it does not work. I have two grids within the templates and was hoping to simply show and hide the grids depending on if the listview item is selected. Where have i gone wrong? I ripped these visual states from the listview's template itself but i must admit im not sure how they work,

Choosing between XAML's ListView and GridView in WinRT

喜你入骨 提交于 2019-12-12 07:39:44
问题 The GridView and the ListView in XAML seem to be the same control. How does a developer choose between the two? 回答1: The GridView control typically scrolls horizontally. Also, you will see some native spacing between items that is greater than that in the ListView. This spacing is there because of the intent for how the controls will be used in Windows Store apps. (read on) Like the ListView it inherits from ItemsControl. Like the ListView groups using GroupStyle. Like the ListView it