wpf

How do I anchor an expander to right side of a ListBox?

The XAML code below works fine except I want the expander button to be between the listbox and the grid. If I set the ExpandDirection="Left" the button is between the listbox and the grid but the direction indicator on the button is confusing to users - it point to the right when expanded and it points to the left when it is not expanded...

WPF GridView, Display GetType().Name in DisplayMemberBinding

I want include the Type name of each object in my collection from my GridView. I have a collection which has four different types in it that all derive from a base class. Call them, Foo, Bar, Fizz, and Buzz. I want to have that column read, Foo, Bar, Fizz or Buzz, respectively. Below is the Binding I'm using, however, it doesn't work...

WPF deployment project: trigger another msi installation during commit stage of the original installer

Hi everyone, I am having a WPF project and created a deployment project. I was able to get the installer running and it works fine. Now during the commit stage of the application, I want to trigger another installation. I tried creating a custom action and added below command in the customactiondata field. msiexec.exe /i "[SOURCEDIR]\A...

What's new in WPF 3D in .NET 4.0 ?

Did anyone find something? Even a little thing? Does anyone know if anything has been quietly announced in the blogosphere or anywhere else? ...

WPF Toolkit DataGrid scrolling performance problems - why?

Hi, I have a performance problem with the (WPF Toolkit) DataGrid. It contains about 1.000 rows (only eight columns) and scrolling is horribly slow and laggy. Also the initial load of the Window containing the DataGrid takes 5-10 seconds. I did some research (using google and StackOverflow) but couldn't find anything besides the advice ...

How to stop WPF TopMost flag on parent window from being inherited by the child

I have a WPF window that has TopMost=true . When I call another Window from this window and specify the topmost window as the parent the owned window also displays as TopMost. I would like to find a way to stop that from happening so that my parent can still own the child yet the child does not have TopMost=True. I know I can just no...

wpf datagrid observablecollection

Im working on a large database application using WPF. So far, I was able to create a DataContext using Link to Sql class, store it in an ObservableCollection, and fed it to my DataGrid as DataContext. The main table in SQL I'm trying to read/write looks like this Work_Table WorkID[pk int] | frn_CustomerID[fk int] | frn_UserID[fk int] |...

WPF Binding objects defined in codebehind

I have some object that is instantiated in code behind, for instance, the XAML is called window.xaml and within the window.xaml.cs protected Dictionary<string, myClass> myDictionary; How can I bind this object to, for example, a list view, using only XAML markups? Edit v2 (This is exactly I have in my test code): <Window x:Class=...

WPF: Progress bar in ListView

I'm trying to display information from my ObservableCollection. MyData has: string Name string Location int Progress Using data binding, I'm able to display the Name and Location for all the items in my ObservableCollection in their own column. But how can I add a "Progress" column with a ProgressBar inside? Progress is a percentage...

WPF Memory Leak on XP (CMilChannel, HWND)

My WPF application leaks memory at about 4kb/s. The memory usage in Task Manager climbs constantly until the application crashes with an "Out of Memory" exception. By doing my own research I have found that the problem is discussed here: http://stackoverflow.com/questions/801589/track-down-memory-leak-in-wpf and #8 here: http://blogs.ms...

How to reference a generic type in the DataType attribute of a HierarchicalDataTemplate?

I have a class of MyClass<MyObject> and want to set it as the DataType for a HierarchicalDataTemplate. What is the syntax for this in XAML? (I know how to set namespaces, I need just the <HierarchicalDataTemplate DataType="{X:Type ..... syntax ...

WPF How to select node from node-list with binding.

Hello, I want to know if the following in XAML is possible: I have a FlowDocument used for printing. The FlowDocument is bound to a DataSource from which I get the current data. The data is a XML-Document which is also bound to an gui where the Data is inputted. The gui contains some comboboxes with a text-representation of the data-val...

Should I be using Expression Blend to design really dynamic UIs?

My company's product is, at its core, a framework for developing metadata-driven UIs. I don't know how to characterize it less succinctly than that, and hope I won't need to for purposes of this question, but we'll see. I've been trying to come up to speed on WPF, and have been building UI prototypes here and there, and recently I deci...

WPF font scaling

I have a WPF application where the user interface should be scaled so that it should become larger if the windows is made larger. In one of the dialogs, I need to present a list of items to a user and the user should click one of them. The list will contain from 1 to around 15-20 items. I want the font size for each individual item to be...

How do I bind a ComboBox to a one column list

I've seen how to bind a ComboBox to a list that has columns like this: ItemsSource="{Binding Path=Entries}" DisplayMemberPath="Name" SelectedValuePath="Name" SelectedValue="{Binding Path=Entry}" but If I got a plain list with lets say countries in an 'ObservableCollection' How do I bind to this? I can't use 'DisplayMemberPath' since...

WPF animate linear gradient

You can animate linear gradient by: <Storyboard x:Key="Focused" > <DoubleAnimation Duration="0:0:0.3" Storyboard.TargetProperty= "BorderBrush.GradientStops[0].Offset" Storyboard.TargetName="Bd"/> </Storyboard> Fine so far. You can set a color To animate it to. How can you set the To property to point to a gradient resource you already...

How to add content control to a shape added to a canvas all runtime.

I have a static canvas. I have added a shape runtime. Then I try to add a contentcontrol which will hold the shape. But as the the shape is already added to the canvas, it gives a logical child error. Can anyone help me how to get this done keeping the logic of adding the contentcontrol later dynamically? XAML: Inside window tag keep a ...

FlowDocument Force a PageBreak (BreakPageBefore)

hi, I'm using C# to create a FlowDocument and fill it with data within a table. Example: FlowDocument flowDoc = new FlowDocument(); Table table1 = new Table(); flowDoc.Blocks.Add(table1); table1.RowGroups.Add(new TableRowGroup()); table1.RowGroups[0].Rows.Add(new TableRow()); TableRow currentRow = table1.RowGroups[0].Rows[0]; table...

Solution for overlapping windows bug?

WPF is promising us a lot of niceties, but some of them don't live up to our expectations. One example is the borderless window. So just this simple code added to the Xaml of the window: AllowsTransparency="True" Background="Transparent" WindowStyle="None" will make my it look nice like this: (ignore the ugly colors they got messed ...

Displaying Content only when ListViewItem is Selected

I have a ListBox when one of the ListBoxItems are selected I want to change the visibility of the button "View" and display it. Meaning that the default state is Hidden. Is this possible and if so, do I solve this with a trigger in XAML or in code behind? XAML Piece <ListBox Background="Transparent" ItemContainerStyle="{StaticR...