wpf

Sliding effect when adding new items to a WPF ListBox

I have a WPF ListBox control which displays items of an RSS feed. I occasionally check the source of the RSS feed for new items. Once I detect a new item I add it to the observable collection which immediately adds the new item to the ListBox display. Is there a way to 'slide in' the new item from the top, pushing down the existing item...

WPF Databinding in code question

I've got the following collection, which serves as a global storage for a group of LineSeries ItemsSources for a chart. public ObservableCollection<ObservableCollection<Data>> AllDataSeries; The said collection may change every now and then, when it's reset I clear the chart from all series - and when it's re-populating again I'm addi...

Programmatic WPF FlowDocument generation and dynamic styles.

I'm generating a FlowDocument in code but I want it to apply dynamic styles defined in the resource dictionary. Even though I set the key using SetResourceReference, it seems like the resource lookup doesn't occur once I add the TextElements to the FlowDocument. My guess is that just adding the control to the document doesn't hook u...

Save file dialog - path not working

Hello all: App.config: <add key="SaveDraftPath" value="C:\Drafts\"/> C#: var saveDraftPath = ConfigurationManager.AppSettings["SaveDraftPath"]; var sfDialog = new SaveFileDialog(); sfDialog.InitialDirectory = saveDraftPath; sfDialog.FileName = "FILE"; For some reason this doesn't open the filebrowser in the path like planned, any...

MVVM visual studio project template for VS2010?

I am running VS2010 and Windows 7. I have seen many people with the template for MVVM. Where can I get this template? I already have WPFToolkit installed, but the template does not appear. I tried to go to the sites, like codeplex, that say they have it and it turns out to be the WPFToolkit installer. ...

XPS open source implementation???

Does any know of any C/C++ open source for XPS [XML Print Specification]. I found http://www.ndesk.org/Xps, but it is c# ... Any help will be highly appreciated. ...

WPF Databinding to generic List<>

SOLVED SOLVED SLOVED the generics list was a list of structs if you use a class instead of a struct it works fine i.e. public class Person { public string Name { get; set;} public string ID { get; set;} } instead of public struct Person { public string Name; public string ID; } I am doing somethin...

Button control template with resizable circle

I am learning about control templates in WPF and checking out how to replace the button look with custom template styles. I see that to make a circle button, a Ellipse has to be defined with the same height and width. <Style x:Key="Button2" TargetType="Button"> <Setter Property="Template"> <Setter.Value> <Control...

MouseBinding the mousewheel to zoom in WPF and MVVM

OK, I've figured out how to get my Grid of UI elements to zoom, by using LayoutTransform and ScaleTransform. What I don't understand is how I can get my View to respond to CTRL+MouseWheelUp\Down to do it, and how to fit the code into the MVVM pattern. My first idea was to store the ZoomFactor as a property, and bind to a command to adj...

How to make reusable template for non-rectangular window with code-behind?

I've created non-rectangular window with my own style. It is Grid which contain custom close/min/max buttons, title area, 8 rectangles for resizing and of course Grid for window content (LayoutRoot). All of it working with c# event handlers at code-behind file. Now i need to make this construction reusable and available from toolbox at ...

Exemplary open-source C# / WPF apps

I'm looking for a high-quality open-source C# / WPF app to dissect and learn from. I have about 5 years of C# and WinForms and almost zero WPF experience. I'm not terribly fussed about the functionality of the app; the WPF paradigm seems markedly different from Winforms and I want to look at an example of how it "should" be done. Thanks,...

Reference images stored in external dll using wpf

Hi all, I have a wpf application and a class library(dll) project. In my dll I have an images folder with some .png files set as Resource. I want to reference and display the image using the wpf main application. Any ideas? I want to do this in the xaml not the code behind if at all possible. Ta, Matt. ...

NavigationWindow history is not saving states properly

I have a NavigationWindow (window1) and a custom navigationstate. What I currently am using to do my navigation is as such: a function (navigate(string,bool) ) which takes the location (a URL) that I want to go to, plus a boolean which defines if I should make a Back entry (i.e. I've gone into a folder) A seperate function which ties ...

Default settings for bound WPF DependencyProperty

Ive created a custom user control named MyCustomComboBox. Everywhere in the application I put it I do the following: <Widgets:MyCustomComboBox Foo="{Binding Foo, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" /> MyCustomComboxBox has the dependency property Foo, I have some validation and other logic in t...

Create Dependency Properties for setting Custom EventHandlers in XAML

Hi, i want to do add custom event handlers to default framework elements using DependencyProperties. Something like the following: <Border custom:MyProps.HandleMyEvent="someHandler">...</Border> Here is the code behind for the control that contains the Border element: public class MyPage : Page{ public void someHandler(object se...

WPF ListView Keyboard Navigation Problem

I've a listview like this ListView: ————----- Mango Orange Grapes Grapes Grapes Apple Strawberry Whenever i navigate using downarrow, the BlueHighlight pauses at the first Grapes, a dotted rectangle start from second grapes and pauses at the third grapes, then the BlueHighlight resumes from Apple. This seems weird and it...

Cannot find the Parts Panel in Expression Blend 3

Hi all, I am developing WPF 'lookless' controls in Visual Studio 2008. I am also using the WPF Toolkit so I can have the Visual States. I have loaded the controls into Blend and editing the control template. I can see the Visual States fine in the States Tab but I cannot see the Parts tab anywhere on screen or in the menus! I know it e...

ICollectionView.SortDescriptions does not work for boolean

Hi ! myListBox.Items.SortDescriptions.Add( new SortDescription("BoolProperty", ListSortDirection.Descending)); This sorting works only for string properties of the underlying project. Not with boolean? Is there a reason for that ? Thanks ! UPDATE: Yep, your example really works. But what's wrong on my example ? public clas...

WPF Charting: how to collapse datapoint dots in lineseries

I have multiple line series in a chart. Chart lines are drawn first and then dots follow the lines. It's annoying and the size of big dots makes large datasets simply useless. Currently I am doing this for each lineseries... <chartingToolkit:LineSeries Title="Socket 2" Name="LineSocket2" LegendItemStyle...

WPF: Center TabItems in a TabControl

Hello, in my XAML code, I have a TabControl with multiple items. The problem I have is that I can not center the tabitems about the content area. The tabs are always starting on the left side, but I need them centered. This is my code: <TabControl> <TabItem Header="Test 1" Style="{StaticResource LeftTab}" Height="40" /> <TabIt...