wpf

How can I detect Ctrl-Alt-Del either before or after the OS detects it?

I need to initialize a variable when the user presses Ctrl-Alt-Del. Because this key combination is treated differently than others, the Windows Security Dialog Box appears immediately after it is pressed and my program can not detect whether it is pressed. I tried adding the code below to the KeyDown event, but it does not work. i...

How do I update an ObservableCollection via a worker thread?

I've got an ObservableCollection<A> a_collection; The collection contains 'n' items. Each item A looks like this : public class A : INotifyPropertyChanged { public ObservableCollection<B> b_subcollection; Thread m_worker; } Basically, it's all wired up to a WPF listview + a details view control which shows the b_subcollection...

Is it posbile to set a mouselistener in WPF?

Can i set a mouselistener (Clicked) in WPF? ...

MVVM Pattern - How can I trigger an ICommand or CommandReference in the code behind

Hi... I have been looking for this on Stack Overflow, but couldnt find an answer to this yet so I hope this isnt a duplicate... I have an app using the MVVM pattern, I like to keep things clean, but sometimes a little code behind seems cleaner than the XAML workaround. I want to know if it is possible to trigger a command from the code...

Silverlight or WPF?

I’m about to start work on a new LOB application which is mainly forms over data. I am going to use either WPF or Silverlight but am not sure which technology to use. Silverlight seems to have everything I need with the bonus of being cross platform as well. Is there any reason why I should use WPF in this context? or is Silverlight the ...

How to show WPF ValidationResult in a seperate textblock?

I am trying to use in WPF a validating input of databound controls with validation rules. I have a posintValidationRule class: public class posintValidationRule : ValidationRule { public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo) { string _strInt = value.ToStri...

Determine owner of a BitmapSource?

I have a BitmapSource that was created and frozen by a background thread. On the UI thread I want to rotate the image and freeze it again (so the background thread can create thumbnails). // transforming the image works var img=new TransformedBitmap(Image, new RotateTransform(90)); // but Freeze is not allowed - will throw "The calling...

[WPF] Borderless window application takes up more space than my screen resolution

Hello All I have created a borderless application in WPF, and it works pretty good. However, when I set the WindowState to full screen, the application takes up more space than my screen resolution, so there are some pixels outside the screen in all directions! (looks like some hard coded negative margins are added to hide the default b...

Add hyperlink to textblock wpf

Greetings, I have some text in db and it is as follows: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis tellus nisl, venenatis et pharetra ac, tempor sed sapien. Integer pellentesque blandit velit, in tempus urna semper sit amet. Duis mollis, libero ut consectetur interdum, massa tellus posuere nisi, eu aliquet elit lacus ...

Creating a quiz application in wpf

hello everyone. I make 2 tables tbl_Question Question_Id, Questiontext, AnswerId AnswerText and Userid, topic_id tbl_option OptionId QuestionId OptionText any idea how to make an aplication of quiz using wpf? thanks in advance. ...

wpf inc custom gesture

Hi, I can't seem to find any info on wpf ink gesture. I want to make my own custom gestures and add it so the ink control knows its a new custom gesture. Does anyone know how to do this? Andrew http://mypcprogrammer.com ...

ComboBox binding

I've got a simple question, I've got a combobox whose itemsSource is bound to a relatively expensive service call. If I have the combobox in question disabled will the binding still fire? If so what I can I do to ensure that the expensive call is only made when it really needs to be? ...

WPF window in front of another WPF window

I have a WPF-window, in this you can click a button to see a new window. Now I want to disable, that you can click the main-window. It should be like a MessageBox. ...

Public class modifier for WPF control

I'm creating Windows application and Class library. Class library contains WPF control named "InsertForm.xaml" InsertForm contains TextBox named eUserName. I'm using the following code to show InsertForm. That's successful. But I can't access eUserName. How to set Textbox modifiers to public? using System.Windows.Forms.Integration E...

Using Microsoft Windows Standard Style in WPF-Window?

Is it posible to use the Microsoft Windows Standard Style in a WPF-window? If I create a normal WPF-Window with a textblock or something like that, the font is very small and not the same like in Microsoft Windows. The background of the window is white. Maybe you can tell me how to use the Style or an information source or things like th...

How to apply an effect of dimmed semi-opacity to a WPF window?

When showing a progress bar over WPF window during some process, I would like the rest part of the window gets semi-visible, maybe with some color blend. How is it possible to achieve such effect? ...

How to update the position of a drag adorner during WPF drag-n-drop?

I'm using an adorner to show a 'ghost' of the element being dragged... var adornerLayer = AdornerLayer.GetAdornerLayer(topLevelGrid); dragAdorner = new DragAdorner(topLevelGrid, itemToDrag); adornerLayer.Add(dragAdorner); dragAdorner.UpdatePosition(e.GetPosition(topLevelGrid)); DragDrop.DoDragDrop(sourceItems, viewModel, DragDropEffect...

WPF MVVM: ICommand Binding to controls

I've totally lost in the command binding that is used in MVVM. How should I bind my object to the window and/or its command to the control to get method called on the button click? Here is a CustomerViewModel class: public class CustomerViewModel : ViewModelBase { RelayCommand _saveCommand; public ICommand SaveCommand {...

TextChanged/LostFocus/etc. event for DataGridTextColumn

I have a list of object bound to a DataGrid in a WPF page and I am looking to add an object directly after the current one if the value entered in a specific column is less than a certain number. <my:DataGridTextColumn Binding="{Binding Path=Hours}"/> I cannot for the life of me figure out how to bind to an event on the underlying Tex...

How to show progress animation without knowing percentage of its completeness?

In a WPF application I need to show user that some process is in progress and one should wait. I don't need to show particular percentage of completeness of this process, moreover, I don't exactly know it. What is the way to do it? Some special settings of the progress bar or maybe there are other common ways to show animation of this k...