wpf

how to bind ComboBox with DataTable

Hi, I have the DataTable with following columns: id, Name, Description, ParentId and would like to create a WPF control (.NET 4.0 framework) which implements a combobox which displays the names which are bound to values of id. So when the user selects a name displayed in the combobox the behind logic has to retrieve its id value. I w...

ListBoxItem height not getting updated

Hi, I have a listbox inside another list box, in inner list box listboxitems height may grow or shrink. My problem is that when the inner items shrink the outer list box doesn't re-render its height. Thus - stays with the previous height before the inner list shrinked. I have tried so many things here, among Invalidate of all types, s...

Is there a library to display a Virtual Human [WPF]

While there are a lot of 3D libraries out there, I'm in struggle to find one suitable for WPF. Basically, I want a Character Animation engine, which loads bone hierarchy and allows me to manipulate the skinned mesh. I know, this is a classic topic for all the 3D engines. And they are made for building games. How do I display a Skinned...

WPF Button Styling with OuterGlowBitmapEffect

I have managed to style a button such that there is a the background I wanted (Normal). However, I want to create an OuterGlowBitmapEffect on the content. Also, when I modify the style, it reverts to the default for MouseOver, Pressed, and HasFocus. Here is the image of what I want, how could you do this using WPF Styles http://tinypic...

How to create unselectable TreeViewItem in WPF

I'm binding TreeView. My reason is treeview level 0 is unselectable. When i click level 0 treeviewitem, current item must be collapse and first child item must be selected. ├ Item 1 //<- level 0. this item must be unselectable ├─ Child Item 11 //<- level 1 ├─ Child Item 12 ├ Item 2 //<- level 0. When i click this item, that is auto...

Subscript / superscript in FormattedText class?

Hello, I'm creating Text using the FormattedText class - but how can I subscript oder superscript Text when using this class? I found solution on how to do this when using a TextBlock, but I'm using FormattedText and not the TextBlock ): Thanks for any hint! ...

WPF: Implementation of ApplicationCommands.Copy?

I just created a menu with Command="ApplicationCommands.Copy" and I thought I had to handle the Executed event of the binding, and add a binding but I just don't need to. Now I'm confused! Where is the implementation of this command? How can it automatically copy a text selected in any of the textboxes I have in my window? thanks! ...

Binding WPF ComboBox in XAML - Why is it Empty?

I am trying to learn how to bind my simple database (.sdf) to a combobox. I created a dataset with my tables in it. I then dragged a table from the DataSource onto my control. There are no build warnings/errors, and when it runs, the ComboBox is empty. <UserControl x:Class="OurFamilyFinances.TabItems.TransactionTab" xmlns="http...

where store event handler method in WPF - MVVM

Hey, Where should I store event methods for button Click event ?Normally it's store in code behind of wpf page, <Button Name="myButton" Click="myButton_Click">Click Me</Button> but in MVVM it should be store in other view-model class and bind to click property of button like that?? <Button Name="myButton" Click="{Binding StaticReso...

Databinding an enum to a ComboBox in WPF, filtering some of enums

Hello everyone. I need to bind an enum to a combobox that is inside a DataGridTemplateColumn, but only some of the options that the enum has. Example: Enum options: Unknow, One, Two, Three, Four, All Bindable ones: One, Two, Three, Four Any way to do this? Many thanks. Best regards ...

Preview of code-only WPF controls in VS2010 - how?

Hi, I hope I am able to illustrate the problem using a lot of images. First of all, I was no real fan of XAML (Silverlight issues, crashes in Preview, and so on...) Now, with VS2010 the situation has become better. There are still a lot of things I like better in code, but I also want a preview in my VS. So, take a look at the followi...

BDD in WPF/.NET

Hi there, I've just found Swinger (http://github.com/demetriusnunes/swinger) and I was wondering: is there something like this for WPF? ...

How can data templates in generic.xaml get applied automatically?

I have a custom control that has a ContentPresenter that will have an arbitrary object set as it content. This object does not have any constraint on its type, so I want this control to display its content based on any data templates defined by application or by data templates defined in Generic.xaml. If in a application I define some da...

WPF ComboBox binding

Here is peace of the XAML code from my page: <ComboBox Grid.Row="2" Grid.Column="1" Name="Player2" MinWidth="50" ItemsSource="{Binding PlayersTest}" DisplayMemberPath="ShortName"> custom object is binded to the page data context: page.DataContext = new SquadViewModel(); Here is part the source co...

Binding to an ObservableCollection attached property.

I want to create an attached property of type ObservableCollection<Notification> and bind it to a property of the same type on the DataContext. Currently I have: internal static class Squiggle { public static readonly DependencyProperty NotificationsProperty = DependencyProperty.RegisterAttached( "Notifications", ty...

WPF: Combine Geometries / Canvas for Geometries?

Hello, I have 2 geometries A and B which I'd like to combine like shown at the end of the following drawing: http://www.imagebanana.com/view/9vm6zoy/geocombine.png How could one do this? Is there something like a "virtual canvas for geometries" where I can place A and B, move B accordingly and then get a geometrie from this? Thanks for...

Screenshot from WPF application as SVG / vector graphic?

Hello, is it possible to create a screenshot of a WPF application as SVG / is there some WPF built-in function to get the XAML code for the current drawn window that then can be converted to SVG? I need some screenshots for documenting a WPF application and I'd like them to be zoomable like a WPF program is using e.g. Snoop or Vista Mag...

What is the correct pattern for using a global mutex in WPF?

So I've found this information http://stackoverflow.com/questions/229565/what-is-a-good-pattern-for-using-a-global-mutex-in-c/229567 But it's based on the main entry point of a standard app. How do you modify this to work for the WPF event model of starting the app? ...

Does WPF use native Windows contols?

Does it perform drawing by itself, or uses the native UI components provided by Windows in any way? ...

What is the least intrusive way to display WPF tooltip on focus?

What is the minimum number of steps required to display a tooltip when the following control gets focus? <TextBox ToolTip="Hello there!" ... /> I tried the following in GotFocus private void ..._GotFocus(object sender, RoutedEventArgs e) { var element = (FrameworkElement)sender; var tooltip = element.ToolTip; ...