I want to change the background color of our apps main window when a property changes. We have a business date that can be changed and I want to change the window background when it has changed from expected. I've set up a property to tell this. But can I set a style datatrigger on a window that changes itself? Or would I need to do ...
Weird question, but one that puzzles me a bit. In the old days when we had Terminals and DOS, applications generally only had one "window", and that was a fullscreen one. When people switched functions, there was no concept of opening a new window, but instead the content of the main window was overwritten. So there was only one main win...
Hi,
all I found so far about databinding to XML always only seems to be binding to a fixed XML structure. Would be nice, if anyone could point me in any direction, everything I tried so far seems very awkward.
This is what I would like to do:
Binding the Checked state of a Checkbox to a node within the XML.
So it is checked if this sp...
I've got some Columns in a DataGridView that have their Binding property set to something like the following:
Binding="{Binding NetPrice}"
The problem is that this NetPrice field is a Decimal type and I would like to convert it to Double inside the DataGrid.
Is there some way to do this?
...
The normal convention for UI controls is for selected text, items, or rows to be brightly colored (e.g., bright blue) when the parent control is in focus and desaturated/dim (e.g., pale blue) when the control is out of focus.
In contrast to the ListView/GridView, the WPF DataGrid control does not follow this convention by default. Selec...
From .NET Rocks! Show #488:
Richard Campbell: "In the GDI world we
got a document from Microsoft that
said you will build your apps in
battleship gray and here's now they
should look: File goes here and Help
goes here, and we all got that as
developers. There's no book like that
for WPF. There was this idea I've got
...
I just downloaded the nice themes collection from the Codeplex WPF Themes site. I like the WhisterBlue and BureauBlue themes a lot, but neither contain any styles for the new controls included in the WPF Toolkit (DataGrid, DatePicker, and Calendar).
It seems like someone out there must have extended the themes to cover these controls, b...
I want to fill a ComboBox with key/value data in code behind, I have this:
XAML:
<Window x:Class="TestCombo234.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:TestCombo234"
Title="Window1" Height="300" Width="300...
I have some XAML textboxes that need to allow nothing but double and some that need to allow nothing but int.
I could use Binding.ValidationRules with all its code behind, triggers, styles as described here, but isn't there a way for these simple validations to use an attribute something like this, just so nothing but that type can be ...
Hi,
I'm seeing some unexpected behavior using ComponentResourceKey. The problem came up because I was using names used in the SystemColors class.
Consider the following code:
First I expose a ComponentResourceKey in a as a static property:
public enum ColorKeys
{
ControlColor
}
public class MyColors
{
public static Compon...
It's "easy"!
I just came across this blog post by Rudi Grobler that says it's "easy" to port a theme from Silverlight to WPF. Unfortunately, he doesn't say how to do it.
Download and install
I have installed both the WPF Toolkit and Silverlight Toolkit from Codeplex.
I also went and dug up the source code for the theme I'm interest...
I have an animation that expand / collapse some StackPanels, in the window there are some ToggleButtons that must be unchecked when the StackPanel is collapsed. I have the animation like this:
<Storyboard x:Key="cmdUnchecked">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="StackPanel1" Storyboard.TargetPro...
I'm trying to find a simple way of binding a single control (eg. TextBlock or ListBox) to list all the validation errors on a WPF form. Most source code examples I have been able to find just bind a control to (Validation.Errors)[0].ErrorContent which only shows a single validation error.
I'm currently using ValidationRule classes, thou...
Hello,
i have this simplified version of my app in XAML:
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:uc="clr-namespace:myApp.MyControls"
x:Class="myApp.View.MyIte...
Hi
I have a weird problem that i can't figure out a solution for:
I've made a little WPF app written in C# that uses an attached SQL Server Express .mdf database which i then manipulates through LINQ.
I have a ListView on the form which datacontext is set to .DataContext = dr.FindAllBuyOrders() which returns an IQueryable BuyOrder obj...
ItemsSource="{Binding Source={StaticResource stringResources}, Path=MyProp}"
I tried and got so far but I don't get it compiled:
comboBox.ItemsSource = new Binding { Source = new StringResources(), ElementName = "MyProp" };
comboBox.DisplayMemberPath="Value";
comboBox.SelectedValuePath="Key";
It says that it cannot convert Binding t...
I'm opening valid XAML within my VS2008 solution in Expression Blend 3 and it is only showing XAML when I try to open individual XAML files. My solution/projects all build and run correctly.
When I go to View -> Active Document View the Design View, Split View and XAML View options are all grayed out... which doesn't make much sense.
I...
We have a WPF application in which we have the following XAML:
<TextBlock x:Name="HeaderRightSubtitle"
HorizontalAlignment="Left"
VerticalAlignment="top"
FontSize="10"
Foreground="#FFFFFF">
<TextBlock.Effect>
<DropShadowEffect
Color="#FFCACACA"
ShadowDepth="1"
Opac...
I've got a WPF view with two textboxes. I'd like to automatically move focus forward from the first textbox to the second when the user hits the down arrow on the keyboard exactly like Tab does.
It seems like I ought to be able to do this 100% declaratively, but for some reason the commands I thought would do this don't seem to do anyt...
I have a DataGrid in WPF app with several columns, including a Name column. If the users switches to a particular view, I want the data to be pre-sorted by Name (and I'd like a sort arrow to appear in the Name header just as if the user had clicked that header). However, I can't find the expected properties to make this happen. I was loo...