wpftoolkit

Centering DatePicker control

耗尽温柔 提交于 2019-12-06 03:48:17
问题 I am using datepicker control from wpf toolkit. I need to center align the content in datepicker control. How can I achieve this? Tried VerticalContentAlignment="Center". It didn't work. 回答1: <Style TargetType="DatePickerTextBox"> <Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="Padding" Value="2" /> </Style> 回答2: None of the other solutions will work because the vertical alignment of the DatePicker content (text and button) is hard coded in the default WPF style. i.e.

WPF DataGrid - How to move keyboard focus to newly added row after tab press

馋奶兔 提交于 2019-12-06 00:18:35
问题 WPF DataGrid add a new row if we press tab on last column of last row. But after adding the new row, the focus is moved to top row of the grid. How can we make sure that the focus is moved to the first column of new row? 回答1: You could try something like this.SelectRowCell(this.Items.Count - 1, 0); But I'm not sure if that will set the focus too. If not then try the following: DataGridCell cell = this.GetCell(this.Items.Count - 1, 0); if (cell != null) { cell.Focus(); } 来源: https:/

WPF Toolkit DataGridCell Style DataTrigger

大兔子大兔子 提交于 2019-12-05 18:46:52
I am trying to change the color of a cell to Yellow if the value has been updated in the DataGrid. My XAML: <toolkit:DataGrid x:Name="TheGrid" ItemsSource="{Binding}" IsReadOnly="False" CanUserAddRows="False" CanUserResizeRows="False" AutoGenerateColumns="False" CanUserSortColumns="False" SelectionUnit="CellOrRowHeader" EnableColumnVirtualization="True" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"> <toolkit:DataGrid.CellStyle> <Style TargetType="{x:Type toolkit:DataGridCell}"> <Style.Triggers> <DataTrigger Binding="{Binding IsDirty}" Value="True"> <Setter Property=

How to reset the WPF Toolkit Chart colour palette when resetting the data

…衆ロ難τιáo~ 提交于 2019-12-05 18:31:05
I have a pie chart on a WPF user control whose data changes periodically, however I am not instantiating a new chart control each time, just clearing the data in the ItemsSource and then inserting new values. Each time the values get refreshed, the colour palate continues rolling through its colour selections. The chart colour selection always starts off with the same colour selections (first is red, then blue etc), I would like to be able to tell the chart to restart its colour selection from scratch each time I reset the data source, instead of getting different colours everytime I clear the

How to turn off animations in WPF Toolkit charts

北城以北 提交于 2019-12-05 16:59:14
Is there a way to turn off the animations in Xaml directly? The animations are really sluggish as my chart has many points. i have downloaded the latest source code at http://wpf.codeplex.com/SourceControl/list/changesets my idea is, to remove the animation by changing the style for the different chart series (chart points, DataPointStyle) example for charting:PieDataPoint try to remove the animation for the shown data and take your own style with a given key (x:key="myStyle" -> DataPointStyle="{StaticResource myStyle}" ) and remove Opacity="0" at <Grid x:Name="Root" Opacity="0"> remove this

Order that DependencyProperties bindings are evaluated?

给你一囗甜甜゛ 提交于 2019-12-05 15:51:16
问题 What determines the order that multiple DepdencyProperties on the same control get evaluated in? I am using the Extended WPF Toolkit PropertyGrid and have both SelectedObject and PropertyDefinitions bound: <extToolkit:PropertyGrid AutoGenerateProperties="False" SelectedObject="{Binding ActiveDataPoint}" PropertyDefinitions="{Binding ActiveDataPoint.Properties}"> The problem is that the OnSelectedObjectChanged fires from the dependency property, and in that changed handler it is referencing

Overriding DataPointStyle in a WPF Toolkit Chart

久未见 提交于 2019-12-05 14:06:00
I'd like to override the DataPointStyle of the LineSeries in my WPF Toolkit Chart : <chart:LineSeries> <chart:DataPointSeries.DataPointStyle> <Style BasedOn="{StaticResource {x:Type chart:LineDataPoint}}" TargetType="{x:Type chart:LineDataPoint}"> <Setter Property="Width" Value="20" /> <Setter Property="Height" Value="20" /> </Style> </chart:DataPointSeries.DataPointStyle> </chart:LineSeries> However when I do this I lose the automatic palette coloring where each series has a different color. Applying a DataPointStyle causes them all to turn orange. Until someone suggests a better method, I've

Labels on Chart Toolkit WPF

偶尔善良 提交于 2019-12-05 12:43:46
Is there any way to label the axis on charts? <charting:Chart Name="EventAlertsChart" BorderThickness="0" Margin="0,10,0,0"> <charting:Chart.Axes> <charting:LinearAxis Orientation="Y" Minimum="0" Title="Number of Alerts" Margin="0,0,10,0" /> </charting:Chart.Axes> <charting:Chart.LegendStyle> <Style TargetType="Control"> <Setter Property="Width" Value="0" /> <Setter Property="Height" Value="0" /> </Style> </charting:Chart.LegendStyle> <charting:Chart.Series> <charting:ColumnSeries Name="LineSeriesBWSrc" ItemsSource="{Binding AlertPoints,UpdateSourceTrigger=PropertyChanged}"

MvvmLight EventToCommand and WPFToolkit DataGrid double-click

笑着哭i 提交于 2019-12-05 10:55:00
Trying to figure out how to use EventToCommand to set a datagrid double click handler for rows. The command lives in the viewmodel for each row. Just that much out of my experience, since I haven't used interactions yet. Thanks. I would have used mvvmlight tag, but I don't have high enough rep yet to make new tags. This would be the solution if the Command lives on the "GridVieModel" and not on the "RowViewModel". <Window... ...xmlns:dg="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit" xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns

WPF DataGrid Styling

混江龙づ霸主 提交于 2019-12-05 10:16:10
Does anybody know/have an example of how to change WPF DataGrid layout to be something like card-view or anything else, not just stack of rows? hughdbrown The result looks like this. alt text http://iwebthereforeiam.com/files/ScreenShot.gif Here's code that should demonstrate the idea. XAML: <Window x:Class="StackOverflow_545979.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:StackOverflow_545979" xmlns:debug="clr-namespace:System.Diagnostics;assembly=System" Title="Window1" Height="300