wpf

Is there a way to use WPF Grid without specifying absolute cell coordinates for every item?

My typical form with Grid look like this in XAML: <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"></ColumnDefinition> <ColumnDefinition></ColumnDefinition> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto"></RowDefinition> ...

WPF - How can I place a usercontrol over an AdornedElementPlaceholder?

I'm trying to get the validation to not show through my custom modal dialog. I've tried setting the zindex of the dialog and and of the elements in this template. Any ideas? This is coming from a validation template: <ControlTemplate x:Key="ValidationTemplate"> <DockPanel> <TextBlock Foreground="Red" FontSize="20"...

DataTemplate-driven View injection with MVVM

I have a container view that looks something like this <UserControl x:Class="Views.ContainerView"> <UserControl.Resources> <ResourceDictionary> <DataTemplate DataType="{x:Type viewmodels:AViewModel}"> <views:MyView /> </DataTemplate> <DataTemplate DataType="{x:Type viewmodels:BViewModel}"> <views:MyView /> </DataT...

SQL Server - PIVOT

We are working on a C# application, we've been using Linq to SQL or standard ADO (when performance needed) to work with SQL Server. We have a table layed out like so: Customer ID, Year/Month, Product Name, Quantity Each customer has additional columns per product. We need display this information in a data grid like so: Customer, Y...

Wpf: Listing all control Names in an application

I need a way to list out all named controls in a wpf application. In C++ we could use the resources file to see a list of all the controls on a form(or so I'm told). I need a similar way to see the a list of controls in a wpf application. The names will be used in a database, so it doesn't matter how I get them, I just need to automate...

WPF TabControl Change selected tab

Hi I have two questions. How do I programatically change the selected tab in a WPF Tab control from one tab to another. How would I get a reference to this "other tab" in which I want to set the selected tab? ...

Easiest way to draw a sequence of points in WPF from code

I'd like to create a WPF app that traces the location of the mouse cursor, updating the image in the MouseMove event handler. My original thought was to create a GeometryDrawing and then add paths to that but I'm struggling with how to wire this up in code (though the Xaml for GeometryDrawings seems straightforward). What's the easiest...

How does Visual Studio set sizes for WPF controls?

In visual studio, when dragging a control from the toolbox onto the design area, VS automatic sets width and height of the control with some values. Do you know how it does it? I was suspicious that there were some kind of attributes for the Width and Height properties or even the class itself but could not find anything from reflectin...

C# WPF OnPropertyChanged Within a foreach loop

I have been trying to learn and take advantage of WPF and databinding. I have a listview that has a column that will display one of three images as shown in this snippet: <GridViewColumn Header="Status" Width="50"> <GridViewColumn.CellTemplate> <DataTemplate> <Image x:Name="TheImage" Height="18"/> <DataTemplate.Trig...

Change Property from within event trigger

What I want is simply that all my TextBoxes as by default set their cursor at the end of the text so I want in pseudocode: if (TextChanged) textbox.SelectionStart = textbox.Text.Length; Because I want that all textboxes in my application are affected I want to use a style for that. This one won't work (for obvious reasons) but you get...

UI automation tool for a windows based WPF application with Record and Playback feauture

I am in the process of recommending an UI automation tool for a windows based WPF application in a company Which targets wide range of customers . The Application lives on a layer of WCF services for getting The data. The company is already having a small VBScript framework written specifically for Test Complete and is really not robust...

WPF & MVVM: Any examples using VB.Net?

Almost every example of MVVM I found is coded in C#, are there any examples/tutorials coded in VB.Net? I'm having a hard time translating C# to VB.Net since I haven't really used C# in any meaningful way... Also, does a MVVM Template/Toolkit for VB.Net exist yet? ...

WPF Binding to local variable

Can you bind to a local variable like this? SystemDataBase.cs namespace WebWalker { public partial class SystemDataBase : Window { private string text = "testing"; ... SystemDataBase.xaml ... <TextBox Name="stbSQLConnectionString" Text="{SystemDataBase.text}"> </TextBox> ?? Text is set to the loc...

Own template for leaf nodes in a WPF TreeView with unknown levels

Hi! I'm trying to add checkboxes to the leaf nodes in a TreeView in WPF. I know how to do this if we have a fixed number of levels in the hierarchy and using a HierarchicalDataTemplate for each level. But what to do when I want this: -Node 1 -- Node 1a (leaf node with checkbox) -- Node 1b --- Node 1bI (leaf node with checkbox) -Node 2 --...

Icon like babylon with wpf

How to make a floating icon equal to that of Babylon, which is in the top-center of the screen and when the User puts de mouse over it moves? It is possible to make a wpf animation together? Can I make an animation when the WPF User puts the mouse? It would be perfect ... ...

Why is System.Windows.Shape.Path sealed?

I was trying to extend the shape class to contain an additional variable but have found the class is sealed. How can I achive this simply, using an alternate implementation approach? Is creating a new class and storing a shape an passing all the method calls through the easiest approach; I'm sure there is a better way though? ...

Does WPF have a native file dialog?

Under System.Windows.Controls I can see a PrintDialog however I can't seem to find a native FileDialog. Do I need to create a reference to System.Windows.Forms or is there another way? ...

WPF C# UI : New Window or Tab ?

Our WPF application in the current design opens new windows for list screen.We don't have restrictions on the number of windows you open etc.We are using a ribbon control and well it has tab support.Which is better a new window or a tab? (With windows 7 having a better group of window management etc) Should I go in for tab or leave it as...

Hide WPF Window Until Fully Loaded

For my WPF application, I am storing several user settings like window position, window state, and whether or not to display a welcome dialog. The problem is that while everything is loading up, I see a lot of flashing and flickering as the windows are loaded in, and then more flickering when the window is maximized after reading in the...

WPF (MVVM): Wiring up viewModel to view in code-behind of Window?

Hi there, I have been getting my feet wet with MVVM pattern for WPF and everything is working as it should.. But i am wiring up the viewmodel to my view datacontext from my codebehind of my window. Sure enough the point of MVVM is to get rid of code behind in windows... which it does great, so i am left with 2 simple lines to wire up...