wpf

creating a custom user interface in WPF

I have a SQL database holding a number of numeric and text values that get updated regularly. The exact number/type/names of these data points can change depending on the source of the database writes. I would like to create a user interface editor, where the user can add database points to the UI and arrange them and format them as th...

How do I connect a dataGrid to a DataSet

using System.Windows; namespace Telephone_Directory { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); telephone2010DataSet dataSet = new telephone2010DataSet(); ...

MVVM Binding Orthogonal Aspects in Views e.g. Application Settings

I have an application which I am developing using WPF\Prism\MVVM. All is going well and I have some pleasing MVVM implementations. However, in some of my views I would like to be able to bind application settings e.g. when a user reloads an application, the checkbox for auto-scrolling a grid should be checked in the state it was last tim...

Add Table to FlowDocument In Code Behind

Hi, I have tried this..... _doc = new FlowDocument(); Table t = new Table(); for (int i = 0; i < 7; i++) { t.Columns.Add(new TableColumn()); } TableRow row = new TableRow(); row.Background = Brushes.Silver; row.FontSize = 40; row.FontWeight = FontWeights.Bold; row.Cells.Add(new TableCell(new Paragraph(new Run("I span 7 columns")...

How to exit a WPF app programmatically?

Hi All In the few years I've been using C# (WINFORMS), I've never used WPF. But now I love WPF, but I don't know how the hell I am supposed to exit my application when the user clicks on the Exit menu item from the File menu. Can somone please help me out!? I DID google this, and guess what? For such a Simple? thing... Nothing related ...

Wrapped WPF Control

Hi, I'm trying to create a GUI (WPF) Library where each (custom) control basically wraps an internal (third party) control. Then, I'm manually exposing each property (not all of them, but almost). In XAML the resulting control is pretty straightforward: <my:CustomButton Content="ClickMe" /> And the code behind is quite simple as well...

Hiding rows in a WPF datagrid - resizing issue

I have an issue with hiding rows in a DataGrid. I do this by creating a new DataGridRow template which has a DataTrigger bound to a property on the objects in ItemsSource. The trigger sets the Visibility of the border of the row to Collapsed if the IsVisible property on the model object is false and vice-versa. If I set one row's IsVi...

Bind event in custom WPF control to command in ViewModel

Hi, I have a custom control that has an event. I have a window using that custom control. The window is bound to a viewmodel. I would like to have the event from the custom control direct to an ICommand on my viewmodel. I am obviously being dense here as I can't figure out how to do this. Any assistance is most welcome. Thanks ...

How can I force a ContextMenu to close (WPF project)?

I have a ListBox with items, and have assigned a ContextMenu to it with three menu items. Everything is working fine except that one of the menu items launches a lengthy operation. I would like to close the ContextMenu from the handler, and maybe display an hour-glass cursor or something. Can that be done? Or, should I be using a Popup ...

WPF Properties Panel simliar to Visual Studio's

Just wondering is their any examples or elements which can look very similar to the Properties panel used in Visual Studio? My guess the one in Visual Studio 2010 is built upon WPF, almost definitely a treeview? ...

How can I create a profiler GUI in WPF?

I am looking to create a task profiler in WPF with an UI similar to the one of incredibuild. Eg, timed tasks appear as strips on their respective line. Have a look at: http://baoz.net/wp-content/2009/06/ib1.png to see what I mean. I am unsure what the best way to tackle this problem is? Should I override the Panel class creating a cus...

accept text when button is clicked

c# visual Studio 2010 how can I capture the text from last TextBox control that had focus on a click of a button. thanks TIA ...

XBAP Browser Control - Invoking Click event of the html Input type button

Hi, Here is what I have. XBAP application with WPF Browser control, hosted on Page1.xaml XBAP in Full Trust, certificate installed in client browser Once the XBAP loaded, the browser control is navigated to some third party site. We are using MVVM for XAML stuff So, when a certain page is loaded, I attach click event handler to th...

Importing ascii file into DataGrid in C# WPF

Hi, I just started programming in C# and using WPF so pardon my ignorance. I'm creating an WPF application where I need to dynamically make a grid. The grid headers will be different every time based on information in the text file and I will only need this grid if the user opens it. So right now, I'm able to brows for a file and get ...

How to force uniquness in collection Item

Hi I have scenario in project where we need to fetch all active book records from database and hold in observablecollection. This observale Collection is bound to grid control in WPF application where user can add remove books. We need to persist all added, removed and modified records in collection till user hit the save to database. O...

How can I get WPF to NOT display validation errors upon initial display of control?

When I first display my screen to the user, I'd rather not have all the validation messages show up for required fields and such before the user has had a chance to fill in any of the form fields. I've set the UpdateSourceTrigger on my bindings to LostFocus, but the errors are still displayed the first time the control is shown. Is there...

How do I use the OpenFileDialog class such that it opens on the Network area as default?

How do I use the OpenFileDialog class (in C#, WPF etc.) such that it opens on the Network area as default? This does not work: OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.InitialDirectory = "Network"; I also tried having "\" as an InitialDirectory and that did not work. I also tried having "\\" as an I...

Customizing WPF Expander; Make only icon clickable not whole header

I want an Expander that only expands/collapse it's content when the user clicks on the header icon. (Instead of the whole header being clickable.) Do I have to redefine the control Template to do this? How would it look like? Where can I find the standard templates/styles for controls? Thanks for your time. ...

Tools\addin's for formating or cleaning up xaml?

I'm guessing these don't exist since I searched around for these but I'm looking for a few tools: 1) A tool that cleans up my xaml so that the properties of elements are consistent through a file. I think enforcing that consistence would make the xaml easier to read. Maybe there could be a hierarchy of what comes first but if not alpha...

problem in multiple asynchronous calls on webservice method in wpf application

Hello Experts! i'm trying to create an application which connects to internet and consume web services for every of it's operation.As far as i'm concerned i'll like to useasync method which i'm using already to get a collection of Contacts.I've realized that when i'm doing the same for groups (meaning getting groups async) i'm having err...