wpf

Display Dynamic Number in WPF TabItem Header

I have a TabControl where every item contains a User Control called Timeline. This "Timeline" has a property called "Number" which changes during runtime. I want to make the property "Number" to be displayed in the TabItem header. And i have really no idea how to do that to be honest. My first thought is that i have to create a Custom ...

ComboBox SelectedItem changes when parent TabItem loses focus

I have a ComboBox hosted in a TabItem. When I select an item from the ComboBox, an appropriate ListView is populated. When I navigate away from the TabItem and then return, the SelectedItem in the ComboBox is empty, but the ListView remains populated correctly. The SelectedItemChanged event has not been raised. Why is the selected item ...

WPF rotate animation

Hello, I'm working with WPF and I can't achieve an animation. I have a rectangle which rotates from x degree with a render transform origin from 0,0. I want this rectangle to rotates from y degrees with a render transform origin from 0,1 after 2 seconds. Of course I want to keep the rectangle position for the second animation. My prob...

How to create a custom observable collection using ConcurrentDictionary, INotifyCollectionChanged, INotifyPropertyChanged

Hi All I am trying to create an ObservableConcurrentDictionary. This object will be used in a multithreaded application, and it's data is used to populate a control via the controls ItemsSource property. This is the implementation i have come up with: public sealed class ObservableConcurrentDictionary<TKey, TValue> : ConcurrentDiction...

wpf - Get values from App Config file

Hi All, How to get values from App.Config. Code: <configuration> <appSettings> <add key="ShowRoomCode" value="1000"/> <add key="FolderPath" value="D:\\Images\\Book\\"/> </appSettings> </configuration> string imageFolderPath = ConfigurationManager.AppSettings["FolderPath"]; But it returns null value. Config file is in t...

WPF Printing - Multipage Invoice Via Flowdocument, Paginator and FixedDocument

Hi Everyone, We're currently using WPF to create a multi-page invoice document, to then be printed / exported via XPS. The route we've taken to achieve this is to create a UserControl containing a standard ListBox etc displaying the Invoice lines, this is then included in a FlowDocument inside BlockUIContainer tags. When this FlowDocu...

Handle Copy & Paste (Clipboard) in MVVM

If I want to access the clipboard with MVVM how can I do it? ...

Converting WPF Browser App to WPF Desktop App

Without copying all the code from one project to another, is it possible to convert an XBAP browser app into a WPF forms app? ...

XamlParseException initialising a static class

I've got a XamlParseException in some code which is trying to select all the text in a TextBox. Xaml: Common:SelectAllTextOnFocus.IsTextSelectedOnFocus="True" /> Code behind: public static class SelectAllTextOnFocus { public static readonly DependencyProperty IsTextSelectedOnFocusProperty = DependencyProperty.Registe...

Databound WPF TabControl with ListView is causing scrolling issues

I have a WPF application using a TabControl bound to a collection of the MyTab class. Each TabItem has a ListView bound to the Items property of the MyTab class. My problem is that scrolling up or down in any ListView is affecting the position of all the others. XAML: <Window> <Window.Resources> <DataTemplate x:Key="TabHeaderTem...

Actipro property Grid show/hide properties

Hi, I am Using Actipro version 4.5.0485 property grid. i have a requirement to show/hide properties if a checkbox is check. i was able to do this by applying filters. but then i need to refresh the property grid every time chexbox selection is changed. i am using selectedObject to populate the property grid. Can any one please help me ...

How to do lazy loading with wpf DataGrid Control when scrollviewer reached at bottom?

<ScrollViewer Name="svDataGrid" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" ScrollChanged="ScrollViewer_ScrollChanged" > <DataGrid VerticalScrollBarVisibility="Disabled" Background="Transparent" Visibility="Collapsed" Name="dgList" Grid.Row="1" IsSynchronizedWithCurrentItem="True" ...

What is a good way to bubble up INotifyPropertyChanged events through ViewModel properties with MVVM?

I'm trying to figure out the best way to bubble up PropertyChanged events from nested Properties in my ModelView. Say I have my ModelView PersonModelView which has a Property PersonModelView.Address. Address in turn has a property City. When I bind to City in my view, I would do something like {Binding Address.City}. My problem is that ...

background timer working only in one thread C#

hello, I have a kinda awkward problem, I'm working with C# and WPF in .NET 4.0 and what I need is a timer that will create only one thread but it will need to work in the background, so not in the main thread, the problem is using System.Windows.Forms.Timer or DispatchTimer will automatically force it to work on the main thread and be i...

Moving from Winforms to WPF

I know this could be a subjective question, but I want to know your experience and an estimation of how long it would take for a Winforms programmer to switch to WPF and write a simple application. I'm starting to build a windows application using .Net Winforms. Since the customer cares about the UI, I thought that it's a good idea to...

WPF/WinForms DragDrop IDataObject

Hi, I was wondering why WPF defines a new and apparently identical version of IDataObject for its drag/drop system? I have application code which uses the winforms IDataObject which I now need to interoperate with WPF drag/drop events. Would it be safe to simply write an adapter class which implements System.Windows.Forms.IDataObject b...

WPF, silverlight video streaming, catch streamed video

Hello. I would like to stream videos, and save it to the hard disc using WPF MediaElement. For example, I'm using this code to play a video from the net: <MediaElement Source="http://some.url/video.wmv" /> I need to save somehow streamed media file to the hard disc. Can anyone tell me how this is done? Thanks! ...

c# Interrupt an executing Key event from a TextBox at the next key event

Hi All, I am using the input from a TextBox to filter information displayed in a ListBox. I want the filtering to occur each time a key is pressed. The problem I am faced with is that if the user types a second, third etc. character, the filter will carry on through for each of the key presses. E.g. The user types 'a' and the filtering...

same two user control in xaml

Hi, I have one user control in wpf. And I want to use this user control two times in same view. I am using mvvm approach. Can anybody give me a good suggestion that what approach I should follow. ...

WPF RichTextBox - get whole word at current caret position

I enabled spelling on my WPF richtextbox and I want to get the misspelled word at current caret position before the context menu with spelling suggestions is displayed. ...