itemscontrol

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl

懵懂的女人 提交于 2020-01-31 04:43:19
问题 i have a problem with WPF Binding. I want to bind a list of Months to a ItemsControl that shows a Calendar Control for each month. But each rendered Calendar shows DateTime.Now,not the bound DateTimes. Does anyone know why this is happening? This is what i have so far: The MainWindow.xaml <Window x:Class="CalendarListTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width=

XAML Itemscontrol binding to property outside of the control

折月煮酒 提交于 2020-01-30 11:24:51
问题 I have a list of transactions that I am loading into an ItemsControl but I want to show the UserId from my viewmodel in each row/transaction. The userId is not in the transaction list, it's a property in the viewmodel I am trying to access but it seems everything I've tried doesn't work and I don't know why. All I get is a blank column value. (yes, I did confirm the property is not empty. even hardcoded a value and got nothing). My understanding is I should be able to use the RelativeSource

XAML Itemscontrol binding to property outside of the control

喜你入骨 提交于 2020-01-30 11:24:46
问题 I have a list of transactions that I am loading into an ItemsControl but I want to show the UserId from my viewmodel in each row/transaction. The userId is not in the transaction list, it's a property in the viewmodel I am trying to access but it seems everything I've tried doesn't work and I don't know why. All I get is a blank column value. (yes, I did confirm the property is not empty. even hardcoded a value and got nothing). My understanding is I should be able to use the RelativeSource

Spacing and aligning Rectangles in ItemsControl

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-25 08:22:49
问题 I've this class: public class MyRect : FrameworkElement { public Visual Visual { get; set; } protected override int VisualChildrenCount => 1; protected override Visual GetVisualChild(int index) => Visual; protected override void OnRender(DrawingContext drawingContext) { var drawing = new DrawingVisual(); using (var dc = drawing.RenderOpen()) { var brush = new SolidColorBrush(Colors.Green); var pen = new Pen(new SolidColorBrush(Colors.Blue), 1); var rect = new Rect(new Size(Width, Height)); dc

Automating ScaleTransform for Rectangles in bar chart

若如初见. 提交于 2020-01-25 08:15:48
问题 I've this UserControl for the bar chart: <UserControl ... Name="uc"> <Grid> <Canvas> <Canvas.Resources> <Style TargetType="Line"> <Setter Property="X1" Value="0"/> <Setter Property="X2" Value="{Binding ActualWidth, ElementName=uc}"/> <Setter Property="StrokeThickness" Value="1"/> </Style> <Style TargetType="TextBlock"> <Setter Property="Canvas.Right" Value="0"/> </Style> </Canvas.Resources> <Line Y1="{Binding HighestPoint}" Y2="{Binding HighestPoint}" Canvas.Bottom="{Binding HighestPoint}"

adding items to columns/rows in listview using foreach

∥☆過路亽.° 提交于 2020-01-25 03:46:05
问题 I am into day 5 of learning c#, and am trying to figure out how to fill/re-fill a ListView control, containing 10 rows and 12 columns, using a foreach loop. I have coded the functionality I'm after in C. void listPopulate(int *listValues[], int numberOfColumns, int numberOfRows) { char table[100][50]; for (int columnNumber = 0; columnNumber < numberOfColumns; ++columnNumber) { for (int rowNumber = 0; rowNumber < numberOfRows; ++rowNumber) { sprintf(&table[columnNumber][rowNumber], "%d",

Bind to ActualHeight of Item ItemsControl

我与影子孤独终老i 提交于 2020-01-22 20:36:32
问题 I have two separate ItemsControl s that appear side by side. The ItemsControl s bind to the same ItemsSource , but they display the data differently. Each item displayed on the left will most likely be smaller than the same item on the right. This causes a problem because the rows will not line up, so I need the item on the left to bind to the item on the right. ItemsControl ItemsControl |Item 1 |Item 1 |Item 2 |Item 2 |Item 3 | |Item 4 |Item 3 As you can see, Item 2 on the right is larger,

Bind to ActualHeight of Item ItemsControl

女生的网名这么多〃 提交于 2020-01-22 20:35:08
问题 I have two separate ItemsControl s that appear side by side. The ItemsControl s bind to the same ItemsSource , but they display the data differently. Each item displayed on the left will most likely be smaller than the same item on the right. This causes a problem because the rows will not line up, so I need the item on the left to bind to the item on the right. ItemsControl ItemsControl |Item 1 |Item 1 |Item 2 |Item 2 |Item 3 | |Item 4 |Item 3 As you can see, Item 2 on the right is larger,

Scrollviewer and ItemsControl VerticalScrolling into nirvana

别等时光非礼了梦想. 提交于 2020-01-17 08:00:11
问题 Hi i've got a complex ItemsControl wich is used to display news (variable height!) with a slide/fade in effect. (like google currents) my problem now is that the scrollviewer will calculate the available scrollingsize left based on whatever.. that will end up in a very ugly way of scrolling if the user scrolls fast! sometimes the scrollview scrolls into the nirvana. i thought this might be the cause of virtualization but i'm not able to deactivate it. as you can see i ve already replaced the

Scrollviewer and ItemsControl VerticalScrolling into nirvana

天涯浪子 提交于 2020-01-17 07:59:29
问题 Hi i've got a complex ItemsControl wich is used to display news (variable height!) with a slide/fade in effect. (like google currents) my problem now is that the scrollviewer will calculate the available scrollingsize left based on whatever.. that will end up in a very ugly way of scrolling if the user scrolls fast! sometimes the scrollview scrolls into the nirvana. i thought this might be the cause of virtualization but i'm not able to deactivate it. as you can see i ve already replaced the