xaml

ListView with horizontal items

只愿长相守 提交于 2021-02-20 06:53:09
问题 I come from WPF and I don't know if it's possible to make a ListView to distribute items horizontally, with all the extras like mouse-wheel scrolling (mouse devices) and swiping (touch devices). I've tried this, but it doesn't behave like the vertical one. Example: I cannot scroll with the mouse-wheel. <ListView ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Auto" ItemsSource="{Binding Collection}" > <ListView.ItemsPanel> <ItemsPanelTemplate>

How to disable expanding/collapsing of tree items in WPF TreeView on double-click

浪子不回头ぞ 提交于 2021-02-19 08:09:06
问题 How can I disable tree items collapsing/expanding when I double-click on tree item? I still would like to do this by clicking on toggle button, but not when I double-click on item. This is XAML I have: <TreeView Grid.Column="0" Grid.Row="0" ItemsSource="{Binding Categories}" helpers:TreeViewHelper.SelectedItem="{Binding SelectedCategory, Mode=TwoWay}" > <TreeView.ItemContainerStyle> <Style TargetType="{x:Type TreeViewItem}"> <Setter Property="IsExpanded" Value="True"/> </Style> </TreeView

Select only one item in two ListViews

亡梦爱人 提交于 2021-02-19 06:02:58
问题 I have two ListView , each bound to a specific collection in my ViewModel and I want to be able to select only one item globally. Each ListView has its SelectedItem property bound to the same property in the ViewModel. My probleme is as follow: when I select an item in a ListView , and then select another item in the other ListView, the first item stays selected. I could achieve this with some code-behind, but I want to know if a pure XAML solution exists. XAML: <ListView SelectionMode=

Toggle Button Two Way Binding Not Working (Universal Windows Platform)

ⅰ亾dé卋堺 提交于 2021-02-19 05:36:19
问题 I am trying to bind the "IsChecked" property on the ToggleButton to "ModelView.IsEnabled". "ModelView.IsEnabled" is always "false" but somehow the ToggleButton can still show as "Checked". Is there anything wrong with the binding? XAML ... <Page.Resources> <ModelView:ModelView x:Key="ModelView"/> </Page.Resources> <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> <ToggleButton IsChecked="{Binding Source={StaticResource ModelView}, Path=IsEnabled, Mode=TwoWay}">

Trigger inheritance in WPF?

浪子不回头ぞ 提交于 2021-02-19 05:36:04
问题 I have 2 triggers for a WPF TabItem control, both are identical except for this line: <Setter Property="Opacity" Value="0.8" /> Is there any way I can make the trigger for IsMouseOver inherit from IsSelected and simply add the additional setter?Could you please provide an example if something like this is possible Complete XAML: <ControlTemplate.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter Property="Panel.ZIndex" Value="100" /> <Setter TargetName="Border" Property=

Binding question in WPF - Diference between Properties and Fields

断了今生、忘了曾经 提交于 2021-02-19 01:35:51
问题 I have a question about how bindings work in WPF. If i have a viewmodel with a property like this: private string testString; public string TestString { get { return testString; } set { testString = value; } } Then if I bind it to a xaml with something like this: <TextBlock Text="{Binding Path=TestString, Mode=TwoWay}" Foreground="Red" HorizontalAlignment="Center" VerticalAlignment="Center" FontFamily="Calibri" FontSize="24" FontWeight="Bold"> </TextBlock> It works... Nothing new here.

Printing large WPF User Controls

帅比萌擦擦* 提交于 2021-02-19 01:33:32
问题 I have a huge data which I want to print using WPF. I found that WPF provides a PrintDialog.PrintVisual method for printing any WPF control derived from the Visual class. PrintVisual will only print a single page so I need to scale the control to fit on the page. Unfortunately this would not work for me since the report was sometimes long enough that it could not be read easily when scaled to fit on the page. Another option for printing provided by WPF is to create a separate view in a

WPF designer issues : XDG0008 The name “NumericTextBoxConvertor” does not exist in the namespace “clr-namespace:PulserTester.Convertors”

守給你的承諾、 提交于 2021-02-18 09:53:09
问题 I have an error that not let me see my designer.. but I have no error on a build and my program runs fine with no problem I have tried to: Clean and Rebuild Update Visual Studio Repair Visual Studio Restart my pc Nothing helped. I have no idea what more I can to do to solve it. I have to try to see in here and not worked for me even after restarted visual studio, re-built the solution the name <...> does not exist in the namespace clr-namespace <...> this is my Error: this is Xaml file:

How to highlight selected row in WPF Listview control with alternating background

风流意气都作罢 提交于 2021-02-18 08:32:36
问题 I am using VS 2008 with 3.5 of the .NET framework. I have set up my code to alternate the background lines in a WPF ListView control. One color used is white. The other color used is a light shade of green. When a white line is clicked on, it highlights the line in light blue. When a green line is clicked on, there is no highlighting and the background color remains light green. I have tried specifying the HighlightBrushKey and the ControlBrushKey in XAML, but they had no effect. What do I

Binding ViewModel to multiple windows

倖福魔咒の 提交于 2021-02-18 05:47:05
问题 I'm re-writing my windows forms project that does scoring for sheep shearing events (don't ask, its a huge sport in New Zealand) from vbnet to wpf c# and have struck a problem that I can't seem to overcome. I have two windows. One is the source window where you type things in (like the current event name), and the other window will display this information in a flash way for projection onto a screen (so will be on a second monitor) along with some other data coming in via XML over the network