winrt-xaml

Can't fire PointerPressed event from a Listbox in WinRT

雨燕双飞 提交于 2019-12-23 03:11:35
问题 I have a ListBox bound to some data, all with an ItemTemplate set, I want to fire PointerPressed Event from this list by pressing anywhere in the ListBox area (cause I just need that for some purpose), but apparently the Selection of the items is preventing that, (I'm using commands) here's my code <ScrollViewer x:Name="sv" x:FieldModifier="public" VerticalScrollBarVisibility="Visible" VerticalScrollMode="Enabled" HorizontalScrollBarVisibility="Disabled" HorizontalScrollMode="Disabled">

Metro app: change GridView.ItemTemplate programmatically

[亡魂溺海] 提交于 2019-12-23 02:38:14
问题 I've a GridView in my Xaml with a given DataTemplate set a StaticResource: <GridView x:Name="itemGridView" ItemsSource="{Binding Source={StaticResource itemsViewSource}}" ItemTemplate="{StaticResource MyItemTemplate }" SelectionMode="None" IsItemClickEnabled="True" ItemClick="ItemView_ItemClick"/> By clicking on a button in the AppBar, I'd like to restyle this template by applying another DataTemplate - MyItemTemplateWide to this particular list. My datatemplates are stored in an Xaml file

How to use template selector within a ContentPresenter in Windows 8.1

烂漫一生 提交于 2019-12-23 02:31:49
问题 I have a Windows 8.1 application. I have a requirement of selecting different templates based on a certain value. For this purpose I'm using ContentPresenter in the xaml with a Static Resource TemplateSelector. Here's my datatemplates and templateselector in xaml resources <DataTemplate x:Key="template1"> <TextBox Text="Temp 1" /> </DataTemplate> <DataTemplate x:Key="template2"> <TextBox Text="Temp 2" /> </DataTemplate> <DataTemplate x:Key="template3"> <TextBox Text="Temp 3" /> </DataTemplate

Rendering an image at runtime in WinRT

时间秒杀一切 提交于 2019-12-23 02:01:47
问题 I found that WriteableBitmap.Render() is not supported in WinRT. Is there any other API for drawing bitmap images in Metro? I need to render some xaml-primitives (Rectangles, Circles, Paths, etc.) to png-image. 回答1: It is indeed not supported yet. Your best bets are to either use WriteableBitmapEx or Direct2D. 来源: https://stackoverflow.com/questions/11840835/rendering-an-image-at-runtime-in-winrt

Keep selection visual in RichEditBox on unfocus?

我是研究僧i 提交于 2019-12-23 01:59:12
问题 Does someone know a way to keep the visual selection state of a selected text in a RichEditBox? I want to add some basic text editing to my Windows 8.1 App but every time I select a text and click on another UI Element within the app, the RichEditBox hides the selection. I already tried to register the unfocus event an set the selection range again but unfortunately this has no effect. I also tried to draw my own rect over the Text using richEdit.Document.Selection.GetRect(PointOptions

What is the equivalent of an app.config in a WinRT app?

北战南征 提交于 2019-12-22 18:34:12
问题 In windows desktop development (WinForms, WPF), the app.config is a potential place to put things like connection strings or uri's used within the app. This allows the end user to change these settings, application wide, without having to have a developer rebuild and redeploy. Is there a similar concept in WinRT apps? The closest thing I see is there is the local application data: http://msdn.microsoft.com/en-us/library/windows/apps/hh700361.aspx The trouble I am having is that it seems like

Metro style : Scrolling with mouse wheel

风流意气都作罢 提交于 2019-12-22 14:08:13
问题 I have gridview in the gridview and want to implement the mouse wheel scrolling functionality. So I added this block into the internal gridview <GridView.Template> <ControlTemplate > <ItemsPresenter /> </ControlTemplate> </GridView.Template> But in this case swiping doesn't work How manage I to solve this problem? part 2. I'll try to describe this situation more deeply. I have main screen that should realize functionality like on the main screen in Windows 8. It should be zoomed in/out. That

SimpleIoC - Type not found in cache: Windows.UI.Xaml.Controls.Frame

安稳与你 提交于 2019-12-22 12:17:10
问题 I am running into the below error the first time my ViewModel is being instantiated by the SimpleIoC. I believe I have setup the container as it should be, but for some reason, I am still getting the below error. Any ideas or assistance would be very much appreciated. Microsoft.Practices.ServiceLocation.ActivationException was unhandled by user code HResult=-2146233088 Message=Type not found in cache: Windows.UI.Xaml.Controls.Frame. Source=GalaSoft.MvvmLight.Extras StackTrace: at GalaSoft

Windows 8.1 how to automatically wrap grid items?

亡梦爱人 提交于 2019-12-22 10:43:43
问题 I'm building a universal app and my Win8.1 app has to show a grid of items. Normally the grid consists of 3 columns, but on smaller screens I want the items to wrap so that there are only 2 columns (or even 1). This is my code: <GridView ItemsSource="{Binding Regions}" IsItemClickEnabled="True"> <GridView.ItemsPanel> <ItemsPanelTemplate> <ItemsWrapGrid Orientation="Horizontal" MaximumRowsOrColumns="3" MinWidth="400" /> </ItemsPanelTemplate> </GridView.ItemsPanel> <GridView.ItemTemplate>

How to animate TextBlock when its value changes in WinRT XAML?

主宰稳场 提交于 2019-12-22 09:25:49
问题 I have the following Storyboard <Storyboard x:Name="DeleteStoryboard"> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="StatusTextBlock"> <EasingDoubleKeyFrame KeyTime="0" Value="1"/> <EasingDoubleKeyFrame KeyTime="0:0:4" Value="1"/> <EasingDoubleKeyFrame KeyTime="0:0:5" Value="0"/> </DoubleAnimationUsingKeyFrames> </Storyboard> and the following TextBlock <TextBlock x:Name="StatusTextBlock" Text="{Binding Status}"> Both are in