wpf

Data Grid Shows extra column

I have a wpf data Grid where I created twlo columns. But whenever I run the window the datagrid shows a extra column. I can't figure out why.? Below is my code <Custom:DataGrid Background="White" AlternatingRowBackground="#103D7EC5" RowHeaderW...

TextBox and Button - Binding and Command problem

I am using MVVM pattern. I have a Text box whose Text property is bound to ViewModel's(VM supports INotifyProperyChange) Text property Button whose command is bound to VM's ICommand property type You may think of this as a SearchTextBox and SearchButton The problem I am facing is that when I enter the text in SearchTextBox and cli...

WPF SelectedItem not working in MVVM

Hi, I'm trying to display the data from two sql ce 3.5 sp1 database tables linked with foreign key - Customers and Orders. When the customer is selected in a datadrig, I want the other grid to be populated with the Orders. I'm using a query: var profiles = from c in db.Customers.Include("Orders") select c; A...

How to bind a datatable to a wpf editable combobox: selectedItem showing System.Data.DataRowView

Hello Good People!! I bound a datatable to a combobox and defined a dataTemplate in the itemTemplate.i can see desired values in the combobox dropdown list,what i see in the selectedItem is System.Data.DataRowView here are my codes: <ComboBox Margin="128,139,123,0" Name="cmbEmail" Height="23" VerticalAlignment="Top" TabIndex="1" ToolTi...

.Net: How to use a WPF user control in a windows forms application?

How to use a WPF user control in a windows forms application? ...

How to copy a string to Clipboard with utf-16 encoding in WPF app

My understanding is that string in .net is utf-16 by default. But when I copy my string to Clipboard, it is changed to sjis encoding (my OS is Japanese). Here is what I am doing: string myStringToCopy = "Some text Here"; System.Windows.DataFormat myDataFormat = DataFormats.GetDataFormat("MyFormat-V1"); Clipboard.SetData(myDataFormat...

WCF how detect client existency

Hi all, As writen in my title, background: I have 2 different type of applications (WPF-silverlight) which can talk each other - Doctor application and Patient application - but it doesn't mean only 2 apps will run, for instance: i can run 3 doctor app and 7 patient app. and all of those apps is communicate using wcf via tcp connection...

WPF resource not found

If I use the following in XAML I get an error: <Style TargetType="TreeViewItem"> <Style.Triggers> <DataTrigger Binding="{Binding Selected}" Value="True"> <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightColor}}"/> </DataTrigger> </Style.Trig...

Drawing a 2D line on a canvas

I have the datalist = 62, 76, 80, 72, 71, 75, 77 that i want to present as a 2D line drawed point to point. In my Wpf application i have a canvas with the height: 173 and width: 455. How do i go about it and draw a line by my datalist and use almost the whole height of the canvas? as it is now the data is just represented on a line at t...

Designing a data model in VS2010 and generating ORM code, application

Simply put: I have a database design in my head and I now want to use Visual Studio 2010 to create a WPF application. Key is to use the VS2010 tools to take much as possible manual work out of my hands. -The database engine is SQLite -ORM probably through DBLINQ -Use of LINQ -The application can create new, empty database instances ...

WPF: How can I bind a label to ObjectDataProvider and specify the parameters?

What I need to do is: a) I MUST use custom localization (legacy system) b) Users need to be able to change the localization at will from with the application c) Localization must be done via data binding So, I guess the way to go would be to use the ObjectDataProvider, but how would I specify the parameter being passed? Such as "okb...

Which is better for multi-core hardware? multithreading or asynchronous methods

We need to develop a dashboard application for a giant screen. What it is does is collect all KPIs(Key Performance Indicators) and shows it on the giant screen in realtime in a visual manner so that the management leads know whats going on. So giant screen will have 20 to 30 independent graphs & pie charts(the number might increase soon...

WPF TreeView MouseDown

I've got something like this in a TreeView: <DataTemplate x:Key="myTemplate"> <StackPanel MouseDown="OnItemMouseDown"> ... </StackPanel> </DataTemplate> Using this I get the mouse down events if I click on items in the stack panel. However... there seems to be another item behind the stack panel that is the TreeViewItem - ...

Possible to use XmlDataProvider with d:DataContext?

I'm wondering how I can use an XmlDataProvider to provide arbitrary XML data for design time use in Blend 4. I've tried a few ways of specifying it but Blend doesn't pick it up. My UI elements end up blank. I realize Blend has functionality to generate and manage sample data but that's a lot of overhead for some of the simple user contr...

WPF Binding not updating when binded object is updated

I'm trying to bind to a custom control like so: <my:GanttChartTaskListView Name="ganttChartTaskListView1" ItemsSource="{Binding Source={x:Static local:TaskCollection.taskList}}" /> In my WPF Window constructor I add add an item to my taskList, when it loads I can see that item in my custom control, however, when I subsequently add ite...

Trying to create a WPF Touch Screen Keyboard Appliaction, Can't get WPF App to Send Keys to another window? Any suggestions?

My touch screen keyboard is highly customizable interface and has every component I need except for sending keys, anyone see a problem with this. Originally when I was creating it I was going to use the Forms.SendKeys.Send() but it's a WPF application... no go. For starters VB.Net in its infinite wisdom decided it would not handle defaul...

Deciphering which control fired an event

I have an application with many images that all look the same and perform similar tasks: <Image Grid.Column="1" Grid.Row="0" Name="image_prog1_slot0" Stretch="Uniform" Source="bullet-icon.png" StretchDirection="Both" MouseDown="image_prog1_slot0_MouseDown"/> <Image Grid.Column="1" Grid.Row="1" Name="image_prog1_slot1" Stretc...

Possible to implement an IsViewPortVisible dependencyproperty for an item in an ItemsControl?

I need to enable/disable spell checking in a richtextbox in an ItemsControl, based on whether the RichTextBox is visible in the ItemsControl's Scrollviewer. I think the route is to implement an IsViewPortVisible dependency property and wire an event handler for a changed event... I found this article that describes the lengthy process ...

Using different validation rules based on user input.

I have a simple form: a combobox and a textbox. My combobox has 2 values: A and B. When value A is selected I want textbox to use a validation rule. When value B is selected there should be no validation rules applied to the textbox. I've read an article that has a solution and I'm trying to use it, but had no luck so far, and I think t...

WPF Embedded Database Application

Hello everyone, im new with wpf and want to make a small Application with the embedded (local) database in WPF. Im using VS08, ->add new file -> local Database, so far so good. I also can add a table (test table called Person with Name and Age), this works good. And now comes my problem, could anyone tell me how to make (select... inser...