wpf

WPF Toolkit Datagrid - Show detail rows

Hi, I have a WPFToolkit DataGrid Control. The user should be able to toggle row details for individual rows. Details can be open for multiple rows at the same time. To display or hide row details the user has to check or uncheck a checkbox within the first grid column. How can I make the grid show or hide row details using a checkbox ...

WPF: How can I have controls in a grid automatically resize when the grid is resized?

I'm very new to WPF: I need to have buttons on a grid resize as the form is resized. The spaces between the buttons also need to stay constant. Is there some property that I can set? I played around with width/height as auto, but that didn't work. ...

Inconsistent results for WPF TextBox.GetCharacterIndexFromLineIndex

When using the following code, I'm getting inconsistent and wrong results from the GetCharacterIndexFromLineIndex method. var dt = new DispatcherTimer(); dt.Tick += new EventHandler(delegate(object obj,EventArgs e) { tb.Text = tb.Text + "a\r\nb\r\nc\r\nd\r\ne\r\nf\r\ng\r\nh\r\ni\r\nj\r\nk\r\n"; tb.ScrollToLine(10); MessageBox.Show...

add footer to Xps documents.

hi, I want to add footer to Flow documents in wpf. Please help me how to add? Thanks in advance Mehar ...

window being on top of the other windows in application

I write application in WPF and C#. I have 2 windows: MainWindow and ToolWindow. I'd like to have ToolWindow stick to the edge of the MainWindow and be always below MainWindow. When ToolWindow gets focus it is on top (with the glow around the edges) MainWindow. The user should be able to use ToolWindow but MainWindow must be on top of th...

WPF: Set Binding-property for ListBox-binding

I have a listbox where I bind the ItemsSource to a collection stored in the set DataContext object. This makes the list displayed using the ToString() function. <ListBox ItemsSource="{Binding SomeCollection}"></ListBox> Now I want to display a property for the objects in the collection instead. So I want to define a template etc to d...

Why would adding an assembly in a XAML file give an error?

I've got an application that reads in XAML files dynamically like this: StreamReader sr = new StreamReader(pathAndFileName); this.Content = XamlReader.Load(sr.BaseStream); In one of those XAML files that gets loaded in (they all have had their code behind removed), this works: <UserControl xmlns="http://schemas.microsoft.com/winf...

How can you draw separate parts a control in different places with WPF?

Hello. I'm trying to split the drawing of a WPF UserControl onto two separate pages of a custom Paged Panel that I'm writing. I thought of using a VisualBrush to draw bits of the control. Is this the way to go? I presume I'll also have to put the controls that need to be visually split in an invisible container. Has anyone come across a...

WPF : GridViewColumn.Header drag (reorder) problem

In my WPF Application I have an GridViewColumn that looks like this: <GridViewColumn Width="170"> <GridViewColumn.Header> <StackPanel Orientation="Horizontal"> <Path Data="{StaticResource pathStar}" Fill="Gold" Stroke="Red"/> <TextBlock VerticalAlignment="Center">New items</TextBlock> </Stack...

WPF - MVVM Command binding on Sub ViewModel

Hi, I've got a VehicleViewModel that has a sub ViewModel of NotesViewModel public IManageVehicleNotesViewModel NotesViewModel { get; set; } On the first activation of VehicleViewModel I activate the sub ViewModel. NotesViewModel.Activate(); The activation calls a method to init a number of Commands, I've break pointed this and its...

VC (win32) or WPF for developing a text editor

I have this confusion to develop this application in Win32 or WPF (.NET). This application primarily consists of a text editor (think of similar to the one in MS OneNote) with lot of customized requirements compared to a general text editor. I was thinking to use VC to work on this as lots of custom drawing is required. What do you guys...

WPF tooltip in MS datagrid

Hi I show my business objects in a MS datagrid, containing "country", "city", "street", for example. I can set a tooltip for each column showing its content using a style, so I get the "country" as tooltip when hooverinmg over the "country" column and so on. But I did not succeed 1) to show the content of "country" when hoovering ove...

WPF DataBinding to property in control

I Have A wpf UserControl with a property: private IEnumerable<PropertyBase> properties; public IEnumerable<PropertyBase> Properties { get {return properties;} set { properties = from property in value orderby property.Position select property; } } I want to create a ListBox that is bound to my Properties property with Pr...

WPF check if a dataproperty has an binding

Hej, I'm trying to make som general functionality for my ListView, so that the content of a ListView can be exported to CSV directly. I'm trying to achive this by getting the datacontext and analysing the ICollectionView for this. From here I have access to the all the objects from via ICollectionView via SourceCollection, in which I (...

WPF/XAML/C# Setting a Boolean

If i have a boolean in one of my ViewModel Class lets say public bool test = true; (This is in C#) Is there ANYWAY possible in XAML/Expression Blend that i can take this value and change it to false BUT USING PURELY XAML, no code behind or anything. I'm trying to do this for a mouse over event, but can't seem to be working. If a mou...

How can I write a test for a WPF Command binding?

I have a "commands" class: public static class MyCommands { private static ICommand exitCommand = new RoutedCommand(); public static ICommand ExitCommand { get { return exitCommand; } } } Code-behind in MainWindow.xaml.cs: private void BindCommands() { this.CommandBindings.Add(new CommandBinding(MyCommands.ExitCommand, t...

Windows Explorer-like search box on Aero glass frame with WPF

I'm extending the Aero glass frame into the client area and want to place a search box on the extended frame, just like it Windows Explorer does: The default WPF text box has a grey/blue border though, and not the dark, white glowing border that can be seen on the screenshot. How do I change the WPF text box to use the same style as ...

WPF Expander still shows Validation Error adorner when shrunk

I've got a style for a TextBox to show a validation error message as follows: <Style TargetType="{x:Type TextBox}"> <Style.Triggers> <Trigger Property="Validation.HasError" Value="true"> <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, ...

Getting Value from DataView C#

Hello, How to find a value of some column from DataView.CurrentItem. ...

WPF: ComboBox cannot be opened after appying style

I used XamlPadX to copy the defaultstyle of the ComboBox and pasted it into my app ressources. Now after that I cannot open the combobox anymore. If I click on the dropdown button, nothing happens. Another thing is bugging me. Altough the app compiles and runs, the designer shows me an error on the following line: <ComboBox Name="modi...