winrt-xaml

Problems adding Blend behavior to DatePicker

穿精又带淫゛_ 提交于 2019-12-10 04:22:56
问题 I'm trying to add a Blend behavior to a DatePicker control to bind an MVVM-Light RelayCommand to the DateChanged event like so: <DatePicker Date="{Binding SelectedDate, Mode=TwoWay}"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="DateChanged"> <Core:InvokeCommandAction Command="{Binding DateChangedCommand, Mode=OneWay}"/> </Core:EventTriggerBehavior> </Interactivity:Interaction.Behaviors> </DatePicker> I'm using the following definitions: xmlns:Interactivity=

How to create variable sized group panels to fit the items in Windows 8 XAML

笑着哭i 提交于 2019-12-09 13:44:27
问题 The problem I'm having is the grouped grid view sizes all of its groups to the size of the first group as in the screenshot below: I need the groups to have different widths to accomodate their children. In this case the second group should be wider and the third group should be narrower. The code for the test app I wrote is as below: XAML (MainPage.xaml) <Page x:Class="GroupingBugTest.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas

How to Display Gridview items with variable width in Windows 8?

ⅰ亾dé卋堺 提交于 2019-12-09 13:15:36
问题 My GridView items having the size of it's first item size . How do i can change this behaviour ? How to display GridView items with variable Width as per the content ? I want to show the first one but i am getting second one. Any suggestion to do that? 回答1: Check Windows 8 GridView and Variable-Sized Items and Different Sized Tile Items in WinRT GridView and also check Variable Sized Grid Template Hope this help 回答2: You can create such view of GridView by setting ItemsPanel to WrapPanel ,

Change GridView GroupStyle in VisualState

眉间皱痕 提交于 2019-12-09 06:54:24
In my Windows 8.1 WinRT/XAML app I have a grouped GridView with a corresponding GroupStyle : <GridView ItemsSource="{Binding Source={StaticResource groupedViewSource}}"> ... <GridView.GroupStyle> <GroupStyle> <GroupStyle.HeaderTemplate> <DataTemplate> ... </DataTemplate> </GroupStyle.HeaderTemplate> <GroupStyle.Panel> <ItemsPanelTemplate> <VariableSizedWrapGrid Style="{StaticResource NormalWrapGridStyle}" /> </ItemsPanelTemplate> </GroupStyle.Panel> </GroupStyle> </GridView.GroupStyle> </GridView> Now this is the version for a fullscreen view. What I want is to adapt the UI of the GridView for

TextBlock text doesn't wrap when placed inside a ViewBox

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-09 02:56:35
问题 I have a TextBlock with a long line of text which I want to wrap. I've placed the TextBlock within a ViewBox expecting the text size to change while still wrapping, however this doesn't seem to happen. The ViewBox just resizes the TextBox so that all the text fits on one line making the text really small. How can I use the ViewBox to resize the text while still using TextWrapping. Here is my code: <Viewbox> <TextBlock Text="The Option text can also dynamically grow/shrink to fit more content.

Not showing items with Visibility=Collapsed in Windows 8.1 GridView

萝らか妹 提交于 2019-12-09 02:47:41
问题 I have a Windows 8.1 application with a GridView bound to a custom (sortable, deduplicated) observable collection. In this collection, I do some heavy filtering and setting an IsHidden flag for every item. In the data template for the item, there is a condition making the item collapsed if IsHidden flag is set to true. <Grid Width="160" Height="280" Visibility="{Binding IsHidden, Converter={StaticResource InvertedBooleanToVisibilityConverter}}"> This approach works in Windows Phone 8.1 XAML,

Handling Swipe Guesture in Windows 8 Grid

给你一囗甜甜゛ 提交于 2019-12-08 22:52:47
问题 I am trying to implement a custom control which consists of a grid with some canvas elements as children , When a swipe action is made on the grid , I am intended to preform some operation with the canvas elements . I am unable to handle the swipe for the grid , i have posted the same in the msdn - win8 Dev forum 回答1: I was in the same boat as you guys, since there was no samples out there on how this was done, but after perusing and scrutinizing the MSDN documentation on how a swipe gesture

Can I have a composite shape as a resource in WinRT XAML?

扶醉桌前 提交于 2019-12-08 18:52:35
I'm developing a Windows 8 Metro-style application and I want to use vector images. As there seems to be no direct support for svg images, I am trying to use a xaml fragment consisting of multiple shapes (a path and some lines) as an image. I would like to have a resource dictionary entry with the composite shape and be able to include it in different pages. Ideally, I would also like to be able to resolve a specific composite shape from a data bound property. From what I've read, the WPF approach was to have a VisualBrush or DrawingBrush consisting of the shapes, but there are no such classes

Metro (XAML/C#): detect installation and/or first run

不问归期 提交于 2019-12-08 18:30:32
问题 When creating Metro applications in XAML/C#, how do I detect when the application is first installed or run for the first time since installation (or potentially upgrade)? I need to use this opportunity to ensure that my database schema is correct and potentially synchronise some base data. I had hoped that I could pick this up from the LaunchActivatedEventArgs within the OnLaunched method, but there does not seem to be a valid value for the Kind or PreviousExecutionState that I can use.

Where are the possible VisualStates for Windows 8 Metro controls documented?

不羁岁月 提交于 2019-12-08 17:28:32
问题 When writing a custom ControlTemplate (XAML) for a Win 8 Metro control we need to use the VisualStateManager to update the control according to VisualState transitions. I see the below sample all over MSDN, but I can't find where the VisualStateGroup "CommonStates" is documented and what other VisualStates are defined other than "PointerOver" and "Normal"? Do you have to go dig in the SDK to find the default ControlTemplate for a button? If so, where? <ControlTemplate TargetType="Button">