wpf

WPF - What to do when a Dependency Property is another Control in the XAML

I'm hoping this will be my last question today. I'm in a hurry and google is not helping much (that or I'm searching the wrong places). I created some custom properties and behaviors so my RadioButtons can alter my labels Content and the mask of my TextBoxes. I could pass a String as a property, but how do I pass another control as a p...

How to get datagrid to show in toolbox

Hi, I am new to wfp and am looking for the datagrid tool, how do I add it to the toolbox. I have checked in the options and it all appears checked etc. Thanks, R. ...

WPF animation stops when another thread running

Hi, I've a window that shows a 'working' animation when another thread is running. The window shows and I can see the progress bar but the animation is frozen. The code runs on a ViewModel, and the dispatcher is created in the constructor: _dispatcher = Dispatcher.CurrentDispatcher; The code to create the animation and run the proces...

Interface Controller (ViewModel) for multiple UI's

I am currently designing a new .NET application and would like to keep it UI independant. Whilst I initally would like to use WPF, I would like to have the option of swapping the UI to ASP or WinForms if necessary. In a layered design: View - Interface Controller (ViewModel) - Model - Persistance is it possible to design the Interfa...

WPF, animate over container boundaries

Hi, I'm learning WPF and have a specific goal. Imagine you have a grid (3 rows by 3 columns), and a control, say a simple blue rectangle fills the middle cell. When I click on the cell I want the square to rotate smoothly through 180 degrees. The specific issue I have at the moment is; as the rectangle rotates, it won't change its ...

WPF ControlTemplate Expander issue

The following control template code (from generic.xaml) gives me an error, 'The attached property ControlTemplate.Triggers' is not defined on 'Grid' or one of its base classes. Any help is appreciated. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winf...

Two Way DataBinding with WPF User Control in Windows Forms

Hi, I have a user control with a WPF Data Grid. I used this user control in a Windows form using Element Host. I can bind the data to the user control using ListCollectionView but when i make updates to the datagrid the changes are not reflected back. I set the Mode = TwoWay but no use. Any ideas ? Here is a sample of my code: User...

What is the different between 'IsEnabled' and 'Start/Stop' of DispatcherTimer?

I think that IsEnabled = false/true is equally the same with Stop/Start method of class System.Windows.Threading.DispatcherTimer Am I right? [EDIT] Start() : begin timer with a full interval countdown. IsEnabled = false : pause the timer, the interval countdown remains. IsEnabled = true : resume the timer & continue with the ...

How to handle wpf datagrid MouseMove event in viewmodel...in MVVM pattern?

HI, I have a wpf-datagrid in view, i am following mvvm model...so no code in "codebehind". I wud like to handle "mousemove" event in viewmodel..how do i do this ? ...

Hide a Group Name in wpf data grid

I've got two groups in my datagrid. First one is the main group and the second is the subgroup, what I want to do is hide the Main group and just show the subgroups in my data grid. Here is the code: ListCollectionView collection = new ListCollectionView(bdata); collection.GroupDescriptions.Add(new PropertyGroupDescription("tid"));// I ...

WPF window doesn't get focus

I'm having a problem where my main application window keeps the focus after a non-modal window is initiated from it. It seems at first glance that it might be the hollow windows issue with WPF (we use transparent backgrounds), but the window doesn't even have focus at all (this.IsFocused STAYS false). As soon as you click on the window...

What is Plastic SCM written in?

I see they have a windows version that looks like WPF and a mac screenshot shows Mono in the title bar. Is it written in C# .NET with Mono? (I'm only asking because they seem to do it right) Thanks. ...

WPF include resource directory XamlParserException

Hi, I have a userControl like this: <UserControl x:Class="LoginModule.LoginView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:controls="clr-namespace:UserControls;assembly=UserControls" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > <UserControl.Resources> <ResourceDiction...

What's with empty code-behinds?

I understand the benefit to unit testing of preferring the view-model over the code-behind. However, I cannot understand the obsession with achieving completely empty code-behinds. At compile time, the code behind and the XAML are combined, so they are actually the same thing. I, to, love using XAML due to its declarative nature which...

WPF RichTextBox - Merge/Split cells

I´m developing a rich text editor using the WPF RichTextBox control. I´ve been searching for a way to implement merge and split functionality on selected cells/rows, but can´t find a good way of doing that. Anyone who knows? Edit: Anyone? ...

Creating a dynamic checkboxes against the list of items using mvvm light wpf?

Hi, I have the following scenario: I have one window say MainWindow where I am displaying the list of activities as per the specific user from the database. There is a one button present on the window. By clicking on that button a new window is getting opened having all the list of activities from the master table. Now I want add a che...

WPF DataGrid and parameterless constructors

I have a class "MyEntity", which does not have a default constructor (well, it does, yet it is not suitable for use). I have a form with a DataGrid, which has a cool feature for creating new rows. Problem: DataGrid cannot create new object when no parameterless constructor is defined. Question: is there a way to provide the DataGrid w...

What is the different between 'Auto' and '*' when setting width/height for a grid column?

I cannot distinguish the different between 'Auto' and '*' when setting width/height for a grid column. Please help! ...

Can not change own property in style

I'm creating dependency property in my custom controll class DataPoint: public abstract class DataPoint : Control { public Color BaseColor { get { return (Color)GetValue(BaseColorProperty); } set { SetValue(BaseColorProperty, value); } } public static readonly DependencyProperty B...

WPF DropShadowEffect on a transparent object

I want to be able to see a drop shadow, but not the object that is creating the drop shadow. The code below will only work if I give the ellipse a fill colour. <Ellipse Width="640" Height="640"> <Ellipse.Effect> <DropShadowEffect Color="Cyan" BlurRadius="60" /> </Ellipse.Effect> </Ellipse> This makes sence as an invi...