wpf

Tracking only the Items in the observableCollection that have changed.Is this possible?

Hi all, I have a datagrid that is bound to a observableCollection of Employees The user is allowed to do in line editing by double clicking the datagridRow. When binding the property in question I also use UpdateSourceTrigger. When I user presses the save button ,the saveCommand is triggered in my MVVM and I want to create a list of on...

How to use "{" symbol in xaml string

How can I use { symbol in xaml string? E.g.: <TextBlock Text="{0}"/> I can do it starting string with a space symbol: <TextBlock Text=" {0}"/> but I'm looking for a better solution. ...

WPF - Trying to animate height but getting error that height is NaN

Been trying to create an animation to dynamically adjust height. I found this info that helped but when I try to use it I get an error: 'System.Windows.Media.Animation.DoubleAnimation' cannot use default destination value of 'NaN'. If I specify the height I get that error. Style: <Style x:Key="bdrSlideIn" TargetType="{x:Type Border...

best way to develop multi user database driven application. (C# wpf sql server replication)

we have a C# wpf based application and want it to be a multi user thingy now. database is ready for it. We have database replication say across 10 sites ... which is the best architecture for converting this into a multi user application? this is a desktop application. thank you. ...

Custom date format for WPF Calendar CalendarItems

I plan to use a WPF Calendar control to display fiscal month/years. When I set the control's DisplayMode to "Year", the months (for my en-CA culture) are displayed as "Jan", "Feb", etc. I'd like to display them as "01", "02", etc but can't find a way to do this. ...

Drag drop a file on top of .exe file to get fileinfo

Hey, As the title say. I know how to do this in C# only, but when trying to do this with WPF I can't find out where or what to add to read the filename when the program starts. public static void Main(string[] args) { if (Path.GetExtension(args[0]) == ".avi" || Path.GetExtension(args[0]) == ".mkv") { string pathOfFile =...

Performance problem when applying a RenderTransform to a Viewport3d in WPF

I have implemented zooming and panning in my WPF app using a RenderTranform combining scaling and translations. Everything is peachy with bitmaps, text, graphic paths, shapes and more. As soon as I put a viewport3d in the visual tree and I zoom into the picture, performance drops to terrible (non-interactive!) levels. Any suggestions...

RoutedCommand.CanExecuteChanged event not consistently firing inside ElementHost

(Background: I'm porting a WinForms app to WPF in stages. At the present time, I still have a WinForms main form with an ElementHost that has WPF content in it.) I'd like my app to be told when certain ApplicationCommands such as Cut, Copy, and Paste change the value of their .CanExecute. I thought it'd be a simple matter of subscribing...

Editing a cell in a datagrid and bind to a command in a MVVM .Is this possible

Hi, I have an application where users are editing rows. Using MVVM Pattern and wondering if I can hook a command whenever a cell is edited. Is it possible? Thanks a lot. ...

WPF: How do I cause the DataGrid to recalc column widths?

I have a DataGrid that is bound to a drop-down list. Each time I change the selected item in the drop-down list, the grid's ItemSource changes. When this happens, the columns are automatically made wider if necessary. My problem is that the columns are never made narrower. They just keep getting wider and wider until they reach the ma...

WPF: Override style for RichTextBox

How do I make a disabled RichTextbox with a transparent background? I'd like to use the RichTextBox to display some rich text but make it disabled, so the text can't be edited. I want the background to be transparent while it's disabled, but the default behavior is to make the background greyed when the control is disabled. I've exper...

How to transtale some elements in rehosted workflow designer?

Hi! I want to translate some elements such as: "Variables" control, "Arguments" , "Expand all", etc. to another language (to Spanish, for example). Thanks in advance! ...

Guidelines for Sharing code between Silverlight and WPF

I want to share as much code as possible between Silverlight and WPF. My lowest level handles the difference between calling the database directly and calling a web service. My data layer on top of that is compiled with both .NET and Silverlight. My GUI layer is currently designed as a WPF Control Library. For sivlerlight... Is it ...

WPF layout for autosize textblock and icon floating on the right - how?

I am trying to get a layout where an icon floats on the right end of a textblock; the textblock grows/shrinks to content. I cannot make this happen without the textblock running outside the grid. For example: <Grid x:Name="LayoutRoot" Width="500" HorizontalAlignment="Left" ShowGridLines="True" > <Grid.ColumnDefinitions> <ColumnDefini...

How to change state of container items based on container state (WPF/XAML)

I have a Listbox with items created through databinding. The item template creates a custom view for each generated item. Each generated item view is its own user control. I'd like to change the state of the listbox to something like "Details" vs. "Compact" and have each item have its own state changed automatically. The view item kn...

Get the Thumb of a Slider

Hi, I'm just trying to figure out a way to get the thumb of a slider in WPF, something like so: Slider mySlider = new Slider(); Thumb thumb = slider.Thumb; Now I konw it's not possible as simple as this; but there must be a work around this. Let me know if you know any. Thanks! EDIT: Btw, I blogged my problem and solution: http:/...

WPF MediaElement, change audio track

I'm writing a Media Player using WPF and the MediaElement. I was playing a video i have that has several audio tracks. But they are both playing at the same time :( How do i just play one of them ? is it at all possible ? ...

How can I target multiple versions of .Net in a single application transparently to users?

I want to take advantage of the new features of WPF without breaking users that don't have .Net 3.5. I suppose if it doesn't already exist in .Net I would just need to build a loader exe that loads and executes either the .Net 2.0 or .Net 3.5 version depending on the current environment. Any better ideas? ...

Listbox with multiple columns wpf

Hi All, I want to show multiple columns in the list box. I have referred the following link http://stackoverflow.com/questions/908089/using-wrappanel-and-scrollviewer-to-give-a-multi-column-listbox-in-wpf. Problem: I want to scroll the content using repeat button. How to control the listbox scrollbar using button. Code: <ListBox N...

How to get logical tree of a DataTemplate

Is there a possibility to access the logical tree of a DataTemplate. <DataTemplate x:Key="Test_DataTemplate"> <Grid > <TextBlock>Test</TextBlock> </Grid> </DataTemplate> For the above example, if I get the DataTemplate by FindResource("Test_DataTemplate"), is it then possible to access the t...