wpf

WPF how to set a tooltip to textbox (in style file)

Hi I wanted to have nice tooltip for my TextBox, so I started with simple tooltip. <TextBox> <TextBox.ToolTip> <StackPanel> <TextBlock>Nice text</TextBlock> <TextBlock>Nice text</TextBlock> </StackPanel> </TextBox.ToolTip> </TextBox> However I have a dozen textbox...

How to change templatized controls using styles

Hi, I'm using a ControlTemplate for defining the appearance of my buttons in a WPF application. Additionally I would like to use styles to set certain aspects of my buttons. These styles should set properties on elements defined in the ControlTemplate, like (simplified): <Window.Resources> <ControlTemplate x:Key="Template1" TargetTy...

WPF Calendar: Binding to MVVM commands?

I am wiring up a WPF calendar to an MVVM view model. I'm not sure how to bind date selections and month changes to MVVM ICommand objects. For example to process a selected date change, what object would I bind in XAML to the appropriate command property in my view model? As nearly as I can tell, I am stuck with event handling in code-be...

WPF Prism Assembly StrongNaming.

I am trying to strong name my WPF assemblies to add to the GAC. I have references to the to the prim assemblies in my project and the compilation fails with Error 1 Assembly generation failed -- Referenced assembly 'Microsoft.Practices.Composite.Presentation' does not have a strong name What am I missing? I do understand what is h...

System.Windows.Media.Animation.AnimationTimeline)' is inaccessible due to its protection level

Hi I am trying to programmatically control a WPF animation but am getting the error above, could someone help with the error - not very familiar with c# - thanks using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using Sy...

Some wpf Font_Combobox questions

Hello folks, I have this code: <ComboBox Width="100" ItemsSource="{Binding FontList}" x:Name="fontComboFast"> <ComboBox.ItemsPanel> <ItemsPanelTemplate> <VirtualizingStackPanel /> </ItemsPanelTemplate> ...

WPF: Check mouse movement and cursor position within mouseleftbuttondown handler

Hi, I'm working on restoring the aero snap functionality in my wpf c# app which was lost when setting the resize to none. I have a rectangle at the top of my window of which I add code to its mouseleftbuttondown event. I want to check whether the mouse has moved when the rectangle is being clicked so I can then de-maximize the window u...

Remove or modify the default key gestures of standard commands

Hello everyone, I need to remove (or at least change) the default gestures associated with the wpf standard commands. Here's my problem : I have a Datagrid (XamDataGrid from infragistics) to which i have associated a custom command I've created. That command uses the "ctrl-delete" gesture. That works as long as I'm not editing the v...

WPF how to bind gridview ?

i am doing this xaml : <StackPanel Margin="320,0,0,0" Grid.RowSpan="2"> <ListView ItemsSource="{Binding employeeCollection}"> <ListView.View> <GridView> <GridViewColumn Header="Employee ID" DisplayMemberBinding="{Binding Path=EmployeeID}"/> <GridViewColumn Hea...

wpf: custom window drop shadow

Hi, I'm working on a c# wpf app with a custom window (allowtransparency = true, resize = none, window style = none). Now I would like to add drop shadow similar to the zune pc software. I read up on this and the included dropshadoweffect is not covering all angles of my window and it is said to kill performance. I want to implement i...

Polygon shape usercontrol

Hi Is there any way to set style for my UserControl to look like polygon, for example triangle or sth more sophisticated? I was reading that in WPF there is almost no limits when it comes to modifing graphical interface ...

WPF Data Binding

when do i use each of the following? {Binding ElementName=...} {Binding Source=...} {Binding ... Path=...} <TextBox DisplayMemberPath=...} // and i think i saw something like ... {Binding xxx} i also wonder if there are any other ways of data binding i need to be aware of? i am new to C#/WPF ...

Drawing text on/on top of line in WPF

Hi guys (and girls); I was wondering if it was possible to do either in WPF: I guess the main problem here that I can't embed a textblock in a line in XAML, which is something I'm use to doing. Does anyone have any idea of how I can tackle this problem? EDIT: It would also have to handle diagonal text. ...

Collision Detection Implementation

Hi I have a collision detection class that works by finding the distance between the centres and whether that distance is small enough to be a collision (see Collision Detection error). My problem is trying to make this actually work, with ellipses colliding. I will explain more if necessary. Thx ...

Treat multiple objects like one - WPF

Hi I am making a WPF soccer game using C#, and was wondering if it was possible to, say, put players in a class and when the ball hits them the same collision properties apply to all. And when you get the bounds for a bunch of objects, it gets the bounds for all in one sweep. Anyway, is it possible to treat multiple, identical but sepa...

wpf my UI doesnt refrash

my xml is : <Window.Resources> <Style TargetType="ListViewItem"> <Setter Property="HorizontalContentAlignment" Value="Stretch" /> </Style> </Window.Resources> <Grid > <Grid.ColumnDefinitions> <ColumnDefinition Width="381*" /> <ColumnDefinition Width="20*" /> <ColumnDefinition Width="101*"...

POCOs, DTOs and IDataErrorInfo

Hi Everyone, I awake this morning to a problem! In all of my components, I have a set of Business Rules which are used to validate DTOs before any changes are committed to the repository. I've been trying to figure out the best way to get validation errors back to the UI and I came across the IDataErrorInfo interface. Fantastic! How...

binding an observable collection with a combo box in a user control

Hi Experts, I have a combo box inside a user control and i am trying to update an observable collection with the change event of this combo box. This combo box has a list view inside it. I have added a working example of this scenario so you can copy paste it in your VS IDE. The user control in this example is just a part of the origina...

Help with my WPF Layout

Hello, I have a WPF Line of business application. Most of it is hosted in user controls in tabs. I'm having an issue finding out how to layout this so it would fit any resolution (with scrolling if necessary). Here's the issue described in code because i really can't figure out how to put this to text, if it's not clear please let me kno...

CurrentItem in paging problem

Hi, i've DataGrid with CurrentItem bind on property. DataGrid has implemented Paging. If i select in first page items, CurrentItem is changing, all is right. But when i set another page...I change Observable collection to display another 30 rows, the CurrentItem binding doesn't be functional. I have: <DataGrid CurrentItem="{Binding Cur...