styles

Center text in XAML Column and ListViewItem

纵然是瞬间 提交于 2020-01-30 11:00:48
问题 I want to be able to center the text in the column and the cell for one column. This is the XAML that I have so far. I cannot figure out how to do it for one item opposed to all of them. <ListView Grid.Column="0" Margin="3,3,0,3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Visible" SelectionMode="Single"> <ListView.View> <GridView AllowsColumnReorder="False"> <GridView.Columns>

How to set default WPF Window Style in app.xaml?

爱⌒轻易说出口 提交于 2020-01-26 08:46:59
问题 I am trying to set the default Style for every window in my WPF Windows application in my app.xaml. So far i have this in app.xaml: <Application.Resources> <ResourceDictionary> <Style x:Key="WindowStyle" TargetType="{x:Type Window}"> <Setter Property="Background" Value="Blue" /> </Style> </ResourceDictionary> </Application.Resources> I can get the window to appear with this style when running the app (but not is VS designer) by specifically telling the window to use this style via: Style="

How to set default WPF Window Style in app.xaml?

给你一囗甜甜゛ 提交于 2020-01-26 08:46:24
问题 I am trying to set the default Style for every window in my WPF Windows application in my app.xaml. So far i have this in app.xaml: <Application.Resources> <ResourceDictionary> <Style x:Key="WindowStyle" TargetType="{x:Type Window}"> <Setter Property="Background" Value="Blue" /> </Style> </ResourceDictionary> </Application.Resources> I can get the window to appear with this style when running the app (but not is VS designer) by specifically telling the window to use this style via: Style="

Custom WPF TreeViewItem style is behaving incorrectly when databound

谁都会走 提交于 2020-01-26 00:29:10
问题 I have adapted a TreeViewItemStyle to my need and it works great when I have hardcoded my TreeViewItems like so: <TreeView Grid.Column="0" HorizontalAlignment="Stretch" Name="treeView1" VerticalAlignment="Stretch" > <TreeView.Items> <TreeViewItem Header="McDonalds" IsExpanded="True"> <TreeViewItem.Items> <TreeViewItem Header="Burger" IsExpanded="True" IsSelected="True"> <TreeViewItem.Items> <TreeViewItem Header="Meat" /> </TreeViewItem.Items> </TreeViewItem> </TreeViewItem.Items> <

How to style RibbonComboBox

这一生的挚爱 提交于 2020-01-25 23:12:08
问题 I have described my problems with binding the SelectedItem of the RibbonComboBox. Another very ugly issue arises when trying to style this control. Starting with the unstyled ComboBox from the post mentioned above: <r:RibbonComboBox > <r:RibbonGallery SelectedItem="{Binding SelectedItem, Mode=TwoWay}"> <r:RibbonGalleryCategory ItemsSource="{Binding Controls}" DisplayMemberPath="Caption" /> </r:RibbonGallery> </r:RibbonComboBox> I get the expected result: But when applying a style with the

DataGridView change cells background and restore default style

霸气de小男生 提交于 2020-01-24 20:20:07
问题 In my DGV, after clicking on a cell, I want to change the background color of all the cells of the same column with some value. After clicking on another cell, the previous cell (and all its column) must restore default style int currCell = dgvLogHeader.CurrentCell.ColumnIndex; string pattern = dgvLogHeader.CurrentCell.Value.ToString(); dgvLogHeader.AlternatingRowsDefaultCellStyle.BackColor = SystemColors.ScrollBar; dgvLogHeader.DefaultCellStyle.BackColor = SystemColors.Info; for (int j=0; j

Changing the style of a Combo-Box in WPF (in Blend preferably)

落爺英雄遲暮 提交于 2020-01-24 14:07:44
问题 I'm having some issues trying to change the look / style of a combo box in Expression Blend / WPF. While there are tutorials out there describing setting styles for buttons, there seem to be a few wrinkles with ComboBox controls. Can anyone offer any advice, or point me towards good tutorials that cover re-styling something more complex than a button? 回答1: The ComboBox style template has 3 parts to it. The ContentPresenter you should have come across styling Buttons. There is a Part_Popup

what is the difference between jQuery(function($) and $(function()?

偶尔善良 提交于 2020-01-24 12:47:06
问题 I'm looking at a piece of code I did not write which contains: jQuery(function($) { $('#interaction').find('.item').hover(function() { var $this = $(this); $this.addClass('hover'); }, function() { var $this = $(this); $this.removeClass('hover'); }) .click(function() { var $this = $(this); var thisID = $this.attr('id'); //hide all visiable detail pages resetpage($('.item-detail:visible')); ... etc. Normally I would write my code to run inside of $(document).ready({ ... }); for example: $

WPF - ListView Item on Selected change Font size

旧城冷巷雨未停 提交于 2020-01-24 11:24:31
问题 this is my code: <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid> <ListBox ItemsSource="{Binding Persons}"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <Border Background="White" BorderThickness="5" Name="Bd"> <Border.Style> <Style TargetType=

WPF - ListView Item on Selected change Font size

情到浓时终转凉″ 提交于 2020-01-24 11:23:47
问题 this is my code: <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid> <ListBox ItemsSource="{Binding Persons}"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <Border Background="White" BorderThickness="5" Name="Bd"> <Border.Style> <Style TargetType=