wpf

Wpf, using a StaticResource SolidColorBrush to define the Gradient Stop Colors

I am creating some wpf resourceDictionaries whit all the styles for an application! I have a few LinearGradientBrush'es, where the color is set directly in the LinearGradientBrush reference as GradientStop's. However, I want to have a predefined set of colors that I can use a a reference for each GradientStop, so that changing the color ...

How to get text fit in text block in WPF

I have string which i have to display in TextBlock, my TextBlock have some fixed size, i need display the text in such manner if string cannot fit in TextBlock, then i have to split the string in next TextBlock, how can i do this same. ...

how to implement componentmodel in WPF

i am dynamically creating WorkFlows in WPF .i can't able to add workflowdesigner to the wpf window controls but i can able to add it to windows forms.how to use this workflow designer in WPF ...

DataTrigger / Style quick in XAML

Hey I have an Ellipse defined as so <Ellipse Stroke="#FF474747" Style="{StaticResource SelectedTemplate}" Fill="{StaticResource RedGradient}" /> I also have two styles setup like so <RadialGradientBrush x:Key="RedGradient" GradientOrigin="1,1"> <GradientStop Color="White"/> <GradientStop Color="Red" Offset="1"/> </RadialGrad...

Embed multiple icons in WPF EXE

I have a WPF assembly in which I would like to embed five icons for different filetypes associated with my application. How can I embed these icons into my EXE? @smoore @Groky @ChrisF, thank you. Unfortunately, this is not what I asked. I see that my question was quite vague 0_­°. Let me rephrase the question: I have icons, say App...

how can I control the opacity and z-order of the top level window in WPF?

I would like to make a small WPF app window semi-transparent and on top of other windows. When I change settings on the top level Window it only seems to effect the contents, not the titlebar or border. Is this possible with WPF?? Thanks ...

WPF ItemsPanelTemplate not working

I'm trying to get an ItemsPanelTemplate working for a ListBox. The ListBox is used in a DataTemplate, and none of my implicit ListBox styles override the default visual style. For some reason, the ItemsPanelTemplate I'm specifiying for the control (a WrapPanel) is being ignored and a StackPanel is used instead. This is the entire templa...

Preventing WPF event tunneling..

I would need to draw lots of WPF-paths. I have set them to children of canvas. Problems is that events are tunneled to path-objects. That slows down the performance. I know overriding preview-method fix the problem, but do I really have to override all preview-methods.. ...

user control in a treenode of treeview wpf

Just wondering if it is possible to display a usercontrol or a shape inside a treenode of a treeview. When you click on the node i would like to display a square for one node or a circle for another node. Please let me know if you have any suggestions. Thanks N ...

WPF - Make a line shorter by X amount each end

I'm making a flow-diagram like WPF app and I've drawn arrows between the centre point of my nodes, trouble is that I want the arrows to start and end on the edge of my nodes. The solution is simple - shorten each of the arrows by 2X, where X is the "radius" of my nodes. I'm a mathematician by trade so I know how to do this using trig...

How can I stop a TreeViewItem from fireing the Selected event for itself, and its parent?

I have a TreeViewItem that when Selected, calles a method. However, I am finding that when the Selected event is called, the Selected event for the parent TreeViewItem also seems to be called. I would really rather than not happen, but I haven't been able to find any documentation telling my why this is happening in the first place. Co...

WPF - Can't get storyboard to affect another local resource

Hi, I've set up a Transformation and a Storyboard as local resources, but when I trigger the storyboard from a button I get the following error: {"'WorldTranslation' name cannot be found in the name scope of 'System.Windows.Controls.Button'."} Can someone point me in the right direction please? <Window.Resources> <Transform3DGro...

How do I load different images, PNG, GIF and JPG in the background using WPF?

I am using WPF to load an image in the background using the answer at Stackoverflow: How do I load images in the background? The problem is the URL string could be PNG, GIF or JPG and I need to use either JpegBitmapDecoder, PngBitmapDecoder or GifBitmapDecoder If the correct decoder is not used then a FileFormatException occurs. I c...

What is currently the best, free time picker for WPF?

I'm looking for a simple time picker control for WPF. I've found found this one: http://marlongrech.wordpress.com/2007/11/18/time-picker/ but it has some issues e.g. you can't type in "00" into it, the second zero won't appear. Silverlight seems to have one: http://jesseliberty.com/2009/03/28/toolkit-control-%E2%80%93-timepicker...

Validity Check, which button image should i use?

Hello, in my software there is a validity check, which checks each input in my form. The user can click on a button to do this check. My question is, if there is a recommendation which button-image should be used for a validity check, to get a homogenous gui in a windows-environment. Or are there some gui-design-guidelines which describ...

How to I manipulate cell data being displayed in WPF Toolkit DataGrid at runtime?

The following WPF code displays the contents of FirstName and ZipCode in the WPF Toolkit DataGrid. However, I don't want to just display the data as it is but slightly modified, e.g. I might want to display all the zipcodes to display with a "-0000" on the end, or I may want to display "n/a" if a cell is blank. I could only find Copyin...

WPF: PreviewMouseMove not firing when left mouse button is pressed?

I'm writing a small drag and drop feature on the project I'm working on. I've done this type of feature several times before, and I always use a combination of PreviewLeftMouseButtonDown and PreviewMouseMove to detect the start of a drag. It's always worked before. On this project, though, I'm finding PreviewMouseMove is not firing when...

WPF Data Binding - Example of "Custom Type Descriptor"

I see several people saying that WPF can use "Custom Type Descriptors" for "Change notification". The ways I know how to do Change Notification are: object.GetBindingExpression(Bound.property).UpdateTarget(); Or have my object implement INotifiyPropertyChanged. I see comments saying that Custom Type Descriptors will work too, but no...

RichTextBox in WPF not resizing contents correctly

I need to display text with colors and formatting in a List. I'm using a ListBox with a RichTextControl to display the data. I also need the contents to size to the window, but the text does not need to wrap. When I make this simple example the text appears vertical and doesn't change as I size the window. If I set the Width of the Rich...

How to encode/decode video using C#?

A little background, I was given the task of fixing a few "small" bugs and maintaining this solution for streaming video across the network between two instances of our application. The solution was written by someone who is no longer here so there is some mystery in the code as well as some really fun pitfalls. The solution was writte...