itemcontainerstyle

How to handle enabled property of multiple tabs using Data Templates?

旧巷老猫 提交于 2020-03-04 06:25:23
问题 I have a Window with two tabs, that holds two different user controls. In order to enable/disable navigation to the second tab, I implement an IsEnabled property in both VM's from the IPageViewModel interface. The IsEnabled boolean property is set to true when a SelectedCustomer is received in the CustomerOrdersViewModel , via Messenger service from CustomerDetailsViewModel . So far this method works, as the second tab is enabled when I select a customer from the data grid in the first view.

WPF ComboBox: How to you utilise a generic ItemContainerStyle with binding

佐手、 提交于 2020-01-05 07:22:18
问题 I want to utilise a generic style for my ComboBoxItem content and have the text content bound to different properties on my underlying class. So this is the best I can come up with but the bindings are hard coded. So for every class bound to a combobox using this ItemContainerStyle I'd have to implement a "MainText" and "SubText" property. Question is, is there a way to have the binding soft coded so where the style referenced from a combobox I can specify which string properties of the

ItemContainerStyle blocks ItemContainerStyleSelector

老子叫甜甜 提交于 2019-12-23 05:59:31
问题 I have the code: <ListBox Style="{StaticResource DeviceListBox}" ItemsSource="{Binding MeterList, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" SelectedItem="{Binding CurrentMeter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" ItemContainerStyleSelector="{StaticResource DeviceListItemStyleSelector}"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal

What's the difference between ItemTemplate and ItemContainerStyle in a WPF ListBox?

梦想与她 提交于 2019-12-17 21:57:46
问题 In WPF Listbox , I'm confused with these 2 notions: ItemTemplate and ItemContainerStyle Can someone explain me more? 回答1: The ItemTemplate is for styling how the content of your data item appears. You use it to bind data fields, format display strings, and so forth. It determines how the data is presented. The ItemContainerStyle is for styling the container of the data item. In a list box, this would be a ListBoxItem. Styling here affects things like selection behavior or background color. It

UWP Binding in Style Setter not working

南笙酒味 提交于 2019-12-17 02:38:23
问题 I have problem with creating xaml control. I'm writing new project in VS 2015 in universal app. I want create grid. In this grid I want to have a button. In model I specifi the column (Level) and Row. this is my code: <ItemsControl Grid.Row="1" ItemsSource="{Binding Path=TechnologyList}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Grid> <Grid.RowDefinitions> <RowDefinition Height="10*"/> <RowDefinition Height="10*"/> <RowDefinition Height="10*"/> <RowDefinition Height="10*"/>

UWP Binding in Style Setter not working

♀尐吖头ヾ 提交于 2019-12-17 02:38:18
问题 I have problem with creating xaml control. I'm writing new project in VS 2015 in universal app. I want create grid. In this grid I want to have a button. In model I specifi the column (Level) and Row. this is my code: <ItemsControl Grid.Row="1" ItemsSource="{Binding Path=TechnologyList}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Grid> <Grid.RowDefinitions> <RowDefinition Height="10*"/> <RowDefinition Height="10*"/> <RowDefinition Height="10*"/> <RowDefinition Height="10*"/>

Strange Behaviour WPF TreeView ItemContainerStyle and ItemTemplate

女生的网名这么多〃 提交于 2019-12-13 01:16:14
问题 I just noticed some strange behaviour of WPF's TreeView. I added both ItemContainerStyle to bind to "IsSelected" of my ViewModel and an ItemsTemplated for custom display of my data. But now the user cannot change the selected node anymore. For testing purposes I created a similar UI using ListView and Expander. This version works as excepted. Any tips why TreeView does fail? <TreeView ItemsSource="{Binding ElementName=frame, Path=list}"> <TreeView.ItemContainerStyle> <Style TargetType="{x

DataTrigger not changing template in ItemContainerStyle for Listbox

旧时模样 提交于 2019-12-12 03:52:54
问题 my idea is to change appearance of ListboxItem when MouseOver or Button is clicked etc. <ListBox Name="listbox" Height="250" Grid.Row="4" Grid.ColumnSpan="5" HorizontalAlignment="Center"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Template" Value="{StaticResource control_mouseover}" /> </Trigger> <Trigger Property="IsMouseOver" Value="False"> <Setter Property="Template" Value="{StaticResource

WPF: how to recreate ItemContainer?

有些话、适合烂在心里 提交于 2019-12-11 05:27:32
问题 Following my previous question How to change ComboBox item visibility, since the problem is slightly changed i decided to open a new post to solve the it. For those who don't want to read all the comments on the previous post, here is the situation. I have a DataGrid that is generated at run time. Each column of this datagrid have a combobox inside the header. All those comboboxes have the same Source, that is an observable collection of a class item. Every item show a property that i use in

DataTemplate vs ItemContainerStyle

谁说我不能喝 提交于 2019-12-09 10:53:25
问题 I've seen a few other Silverlight 'vs' questions around, but couldn't find any for this particular match-up. I'm trying to define the way in which my objects bound to a ListBox will display. I've defined a DataTemplate , but I'm really not sure where this should end and the ItemContainerStyle should begin. Question 1: Is the ItemContainerStyle just a wrapper for the DataTemplate so that a common item style can be applied to different data layouts? Question 1a: If so, in the event that a