wpf

Show glyphs associated with selected OpenType features using WPF

I know that you can enable OpenType feature when rendering text in WPF: http://msdn.microsoft.com/en-us/library/ms745109.aspx Is there a way to know which glyphs in OpenType font belong to selected OpenType feature, such as Stylistic Alternates or Ligatures, using WPF. ...

How do you bring a sub-model into view in a 3D scene?

I have to modify a WPF application written in C# that displays a complex 3D model with many sub-models or parts. When the user selects a part via an alternate user-interface mechanism, I'd like to rotate, scale, or move the scene so that the sub-model comes into view. No sub-model is completely hidden (i.e. interior to the main model)....

WPF: Implementing a MediaPlayer Audio / Video Seeker

I am currently working on an MP3 player (in a WPF application) with a WPF MediaPlayer and basically, I want to implement a Song Seeker which moves along with the current playing song. I already implemented a song slider (from Sacha Barber's application) and it works when the user drags the seeker manually (as in, the song continues from...

Silverlight specific Image shifting to the right

I am generating a set images to form a human body so that I can use for a physics engine. The images generated are in a specific user control in where I set the dimentions and co-ordinates of each image. That usercontrol is then loaded in another user control but for some reason when the images are loaded, one specific image which I name...

How to close Popups used as sub-menus in WPF.

I have a button that when clicked opens a Popup. The Popup is a sub-menu containing more buttons. When one of the buttons on the sub-menu are clicked the Popup closes. I also want the Popup to close when the user clicks somewhere outside the Popup. It's also important to note that the majority of the screen is taken up by a WindowsFormsH...

WPF: How to attach mouse events to a viewmodel?

I am trying to use the MVVM pattern for the first time. So I have an ItemsControl filled with my viewmodel objects, displayed using DataTemplates; the objects are "nodes" and "edges" represented in DataTemplates with Thumb and Polyline objects, and I want to be able to detect clicks and drags on the ItemsControl in order to move the node...

WPF -- simple checkbox binding question

Hello, While it is trivial to store a checkbox's checked state in a variable using the checkbox's Click event, how would I do it via databinding? All the examples I have found have the UI updated from some datasource, or bind one control to another; I want to update a member variable when the checkbox is clicked. TIA for any pointers....

WPF Databound Bulleted List

How do I create a databound, bulleted list of hyperlinks in WPF? I've got this: <ItemsControl Name="lstScripts"> <ItemsControl.ItemTemplate> <DataTemplate> <TextBlock> <Hyperlink> <TextBlock Text="{Binding Path=Name}" /> </Hyperlink> </TextBlock> ...

TranslateTransform.BeginAnimation in Silverlight?

I have a working WPF application that would like to port to SilverLight. I have a piece of WPF code that I haven't found a way to mimic in SilverLight. WPF Code Snippet: TranslateTransform trans = null; trans = child.RenderTransform as TranslateTransform; trans.BeginAnimation(TranslateTransform.XProperty, new DoubleAnimat...

WPF App crashes outside of Visual Studio

I've got a WPF app that runs perfectly fine inside VS.NET, but if I try to run it outside of VS.NET, I get a "... has encountered a problem and needs to close.." dialog. This happens in Debug and Release modes. Why is this happening? ...

In WPF, is there a way to bind to sibling properties?

I have a series of TextBlock and TextBox controls. Is there a way to apply a Style to the TextBlocks such that they can databind to the control immediately after them? I'd like to be able to do something like this: <Resources..> <Style x:Key="BindToFollowingTextBoxSibling"> <Setter Property="TextBlock.Text" Value="{Bindi...

Why doesn't this data binding work?

I have a ViewModel class that contains a list of points, and I am trying to bind it to a Polyline. The Polyline picks up the initial list of points, but does not notice when additional points are added even though I implement INotifyPropertyChanged. What's wrong? <StackPanel> <Button Click="Button_Click">Add!</Button> <Polyline ...

Nested WPF DataGrids

I have a DataGrid (from the toolkit) and I want to nest another DataGrid in the DataGrid.RowDetailsTemplate. The trick is I want to bring back the data from one table in the main grid and then based on row selection go and get additonal detail from a different table and show it in the DataGrid in the detail template. This is easy enough...

WPF Button, Command Target, Binding Question

I have a DesignerCanvas (derived from canvas) that I can add UIElements to, then drag\drop\move\group and move them around. On the toolbar I have a button that is bound to a group command. <Button Margin="0,3,0,3" Padding="5" HorizontalContentAlignment="Left" Command="{x:Static s:DesignerCanvas.Group}" CommandTarget="{B...

Why doesn't this WPF code generate a context menu?

Perhaps I'm having a Post-Ballmer-Peak Moment. I'm hoping that someone can help point out the obvious to me. Why does this code generate a context menu on right click: <Canvas Background="Transparent"> <Canvas.ContextMenu> <ContextMenu> <TextBlock>WTF?</TextBlock> </ContextMenu> </Canvas.ContextMenu> </Canvas> And ...

Interpret enter as tab WPF

Hi, I want to interpret Enter key as Tab key in whole my WPF application, that is, everywhere in my application when user press Enter I want to focus the next focusable control,except when button is focused. Is there any way to do that in application life circle? Can anyone give me an example? Thanks a lot! ...

Silverlight crash course for WPF developers

Hi, I'm looking for a Silverlight book (unlikely) or some tutorials aimed at people who know how WPF operates. I mean there's obviously lots of overlapping stuff and I would prefer reading something that assumes that I understand how WPF works, describes things that are available in Silverlight and not in WPF and vice versa and highligh...

Ways of accessing MySQL from C#/WPF

Hi, I'm new at WPF and C# and I'd like to know the best way of accessing MySQL. Googling a little bit I've seen there's a Linq provider for MySQL. Is that the best way? http://code2code.net/DB_Linq/ I've never used Linq before so I'll start today unless somebody knows a better way of doing that. Thanks in advance ...

WPF: Is it possible to convert the following code from Procedural (C#) to Declarative (XAML) ?

I have the following content in a Window (removed unnecessary sections): XAML: <Style x:Key="itemstyle" TargetType="{x:Type ContentPresenter}"> <EventSetter Event="MouseLeftButtonDown" Handler="HandleItemClick"/> </Style> <ItemsControl ItemsSource="{Binding ArtistList}" Margin="10" Name="artist_list" ItemContainerStyle="{Stati...

Help with some very basic WPF databinding

Hi, I'm new to WPF and trying a simple example of databinding, but it's not working. My window has a TextBlock, which I bound to a property of the window object. I declared the property in code. When running this, I see the correct value appearing in the TextBlock. There's also a button, which when clicked updates the property, except...