datatemplate

Change frame and label colors on an item selected - syncfusion listview xamarin forms

馋奶兔 提交于 2020-01-25 10:13:48
问题 I have been trying to change the color of the first item of my list[0] and also when I tapped on an Item - the color I need to change is the frame and the labels inside it. I tried the following: BackgroundColor="{Binding IsActive, Converter={StaticResource colorConverter}}" This works at the list level only, but nothing inside the data template. What else could I do? <sync:SfListView x:Name="list" SelectionMode="Single" SelectionGesture="Tap" ItemTapped="Day_ItemTapped"> <sync:SfListView

Change TreeViewItem Template when IsSelected and two types using in TreeView

青春壹個敷衍的年華 提交于 2020-01-23 01:27:04
问题 In my TreeView I use two differnt classes for binding. For example, I have a Group what can have ChildGroup and can have Items. Example code of this classes: using System.Collections.Generic; using System.Collections.ObjectModel; namespace WpfApplication1 { public class Group { public Group(string name) { Name = name; items = new ObservableCollection<Item>(); groups = new ObservableCollection<Group>(); } public string Name { get; set; } private ObservableCollection<Item> items; private

C# WPF Programatically created DataTemplate Dockpanel in Stackpanel has no effect

人盡茶涼 提交于 2020-01-15 08:20:19
问题 I'm trying to dynamically create a datatemplate for a listbox. This is for a Custom UserControl. This UserControl has a DependencyProperty which accepts any types of IEnumerable<> . This works fine... But the Output is always Property / Value Property / Value if the objects contains 2 Properties. But i want that the properties are arranged side by side. Like: Object 1: Porperty / Value Property / Value Object 2: Property / Value Property / Value So where am i wrong ? i'm making first a

C# WPF Programatically created DataTemplate Dockpanel in Stackpanel has no effect

匆匆过客 提交于 2020-01-15 08:18:08
问题 I'm trying to dynamically create a datatemplate for a listbox. This is for a Custom UserControl. This UserControl has a DependencyProperty which accepts any types of IEnumerable<> . This works fine... But the Output is always Property / Value Property / Value if the objects contains 2 Properties. But i want that the properties are arranged side by side. Like: Object 1: Porperty / Value Property / Value Object 2: Property / Value Property / Value So where am i wrong ? i'm making first a

Custom validation error template not respecting ZIndex

删除回忆录丶 提交于 2020-01-15 07:36:27
问题 I have a view defined as a DataTemplate (for an "OrderEntryViewModel") with a Menu, ContentPresenter, and Expander inside of a 3-row grid. The content of the ContentPresenter is binded to another viewModel "OrderViewModel" (for which there's another DataTemplate-defined view). The expander has a ZIndex of 99, so that when it expands UP, it expands OVER any other controls (i.e. the ContentPresenter). This all works as expected EXCEPT when the ContentPresenter's content (the OrderViewModel) has

Custom validation error template not respecting ZIndex

柔情痞子 提交于 2020-01-15 07:35:10
问题 I have a view defined as a DataTemplate (for an "OrderEntryViewModel") with a Menu, ContentPresenter, and Expander inside of a 3-row grid. The content of the ContentPresenter is binded to another viewModel "OrderViewModel" (for which there's another DataTemplate-defined view). The expander has a ZIndex of 99, so that when it expands UP, it expands OVER any other controls (i.e. the ContentPresenter). This all works as expected EXCEPT when the ContentPresenter's content (the OrderViewModel) has

Enable DataGrid Copy with Custom Columns

柔情痞子 提交于 2020-01-15 07:26:08
问题 I have a DataGrid where I have Custom Columns with Column Templates to insert special Tooltips. When doing that, how do I enable copying this data to clipboard? XAML-Code of my DataGrid: <DataGrid x:Name="CapabilityGrid" IsReadOnly="True" AutoGenerateColumns="False"> <DataGrid.Columns> <DataGridTemplateColumn Header="Variable"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding Name}" ToolTip="{Binding Name, Converter={StaticResource tooltipConverter}}" /> <

WPF WrapPanel/StackPanel with DataTemplate?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-14 09:36:08
问题 What must I do to use a DataTemplate in a WrapPanel or StackPanel? On a ListBox its so easy but i cant find a way to do it on a Panel... Edit: What i want is a ListBox that places the items like a WrapPanel. 回答1: If I understand you correctly, you can use the ItemsPanel property of your container. I used something similar to make my ItemsControl layout using a horizontal StackPanel: <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal" /> </ItemsPanelTemplate> <

wpf applying datatemplates in code-behind

…衆ロ難τιáo~ 提交于 2020-01-14 05:35:08
问题 I'm creating a custom ItemsControl that contains a grid for display whatever. I'd like the user to be able to use datatemplates for displaying that whatever, but how do I go about doing that? I know how to create the templates, but I'm not sure how to go about applying a template such that the items are located properly within the grid (my code) and each item is displayed as the user wants (via the datatemplate). -- edit -- There appears to be a little confusion as to what I'm asking. Imagine

WPF: How to attach mouse events to a viewmodel?

喜欢而已 提交于 2020-01-12 02:28:21
问题 I am trying to use the MVVM pattern for the first time. So I have an ItemsControl filled with my viewmodel objects, displayed using DataTemplate 's; the objects are "nodes" and "edges" represented in DataTemplate 's with Thumb and Polyline objects and I want to be able to detect clicks and drags on the ItemsControl in order to move the nodes and edges. Two questions: How do I attach mouse event handlers to the Polyline 's and Thumb 's to be handled by the little viewmodels? (I could attach a