wpf

WPF bind to a list

I have a user control whose users I want to have them set a DataContext on to bind to a list of objects. In my control, however, I want to display that list in a grid, but in a non-trivial order. The column/row of display of each element will be determined by some code I will write. So I cannot do a straight databinding in my control,...

Detect when users log out of an application in C#

If the application I'm working on, is there any way to tell when users press the Logout button? ...

How can I apply MVVM and Commands in this specific WPF situation?

I am having trouble with the MVVM pattern and Commands in my WPF app. The problem is not so much the MVVM pattern, but more the stuff that is going on on my GUI. I'll explain the situation: My app can DoStuff to some files. I have a class with a function DoStuff(int limit). My user user interface has the following items: A Button DoSt...

WPF ListBox Show WAIT Cursor ?

I have a WPF ListBox that displays images loaded from a local folder, usually somewhere between 1- 300). I'm using a converter in my imageTemplate to make sure and show thumbnails of the images, and not the images in their full size. Even while doing this, it still can take several seconds to load initially. My question is, how do I know...

WPF wrap panel and scrolling

Hey guys, I have a simple wrap panel which contains a number of wide controls. When I resize the width of the window everything works as expected. The controls will go across on a single line if there is enough space or wrap down to the next line when there isn't. However, what I need to happen is that if all of the controls are basic...

Retemplating a Button control with custom properties possible?

I made myself a TransparentButton style that makes the Button portion behave the way I want it to (mouseover, enabled, etc), but what I haven't been able to do is set the content correctly in the style. Currently, I manually set everything in for every button, and clearly that stuff needs to go into the style. I have set the ContentTe...

How to bind objects list to infragistics data grid?

Pretty simple task, but the source code doesn't do required job... Please advise. There is Products collection in the class (approach is based on the MVVm pattern, but that is not influe on the current issue): public class ProductWindowViewModel : WorkspaceViewModel // implements INotifyPropertyChanged { public ProductWindowViewMod...

N-N table and WPF databing

I have 3 data tables: User UserID, UserName 1, Bat 2, John etc... Member MemberID, Member 1, Local 2, Zone etc... UserMember UserID,MemberID 1, 1 1, 2 2, 1 etc... On the user input XAML Form in WPF Check list box is bound to Member table. My Question: I want it so that when the user checks member type, the selected values auto...

WPF TextBox Validating results ToolTip

Experimenting with WPF validating input, I tried to use ToolTip for displaying results of TextBox input validation, like this: <Style.Triggers> <Trigger Property="Validation.HasError" Value="true"> <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].E...

How do I can close/hide a frame based upon a button click event in wpf?

I have two frames I need to a load the second frame based on the button click event which is there in the first frame, and need to hide the first frame once the second frame is loaded. ...

Get the size (after it has been "streched") of an item in a ViewBox

Consider the following: Let's say the Window is 1024x768 and the ViewBox fills the entire window, this means the TextBox is really large on the screen. I want to get the size of the TextBox as it is currently on the screen. If I get DesiredSize or ActualSize or even RenderedSize I always get 100. Any suggestions? Updat...

Filtering capabilities of WPF datagrid

In a WPF application I need to implement convenient for user possibility of quick and easy search for particular records from a SQL Server database. Please, could you share your expierience and opinion about filtering capabilities of WPF datagrid from a WPF Toolkit, comparing to third-party datagrids? ...

Make inactive window look like it's active - WPF...

As per the question located on: this page. Does anyone know how to do the same with a WPF window? Keep in mind that the answer I'm looking for must work with frame-less windows. I've tried the answer on the referred to page but, can only make it work with winforms windows. Thanks and best regards ...

Handler for Custom Attached Event

I'm using a custom Attached Event that I created and I'm trying to add a handler to this event public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void dataGridTasks_Drop(object sender, RoutedEventArgs e) { } } Here the XAML code <ListView util:DragDropH...

WPF: Animating in XAML, rather than C#?

.I am creating a user control that stacks three WPF month calendars (Master, Slave1, and Slave2) vertically. I want the second and third calendars to be hidden until the host window is large enough to show the entire month--no partial calendars. I have implemented the feature be trapping the SizeChanged event in an event handler in code-...

TargetInvocationException on Image update in WPF

I've built a WPF Control which displays an Image. Now I would like to change that image at a very fast rate. I've build an ImageContainer class which holds the image and has a ChangedEventHandler which updates the Image in my control when changed. The code which is executed looks like this: videoImageThread = new Thread( ne...

ListView that imitates Windows Explorer

How can I make a ListView imitate the ListView in Windows Explorer on the right side. Like how can I get icons in the ListView and get the arrows. ...

WPF Style Inheritance

I have this XAML. If I remove the StackPanel.Resources section I get the styles that were defined at the application level. If I leave it in, then I only get the new styles. How to I make it combine both the local and global styles? <Window x:Class="MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x...

WPF: Alternatives to Grid for displaying data?

What are the alternatives to Grid for displaying repeating data in WPF? For example, how would I show customers as a list of business cards? ...

WPF: Binding Visibility by string contents

Ok, so here is my XAML <TextBlock Text="{Binding Path=InstanceName}"></TextBlock> If InstanceName is null or an empty string, I want Visibility="Collapsed". Otherwise I want Visibility="Visible". How would I do that? ...