wpf

Problem with manually editing a textbox bound to a property that's continuously updated

Hi, I have a textbox bound to a property. The property continously gets updated from a timer. What I'm trying to do is to make it so that when I'm in the middle of typing something in the textbox, the textbox should stop updating itself from the property. Is there a way to do that? Thanks! ...

WPF - creating content for a tabitem dynamically

Hi, I'd like to set the content of a tabitem dynamically, based on the content/actions taken on previous tabitems. I'm advancing through the tabs via a command like: tabControl1.SelectedIndex++; However, the Loaded event doesn't get fired after this like I thought it would. tabControl1_SelectionChanged() is getting called, however....

wpf ComboBox Async binding to items source problem

i have a mvvm app that the main window is a tab control. i use the itemssource to bind items to the combo box, everything works fine until i go to another tab and for some reason the selected item of the combo box getting the null value, any ideas ? the binding is twoway updatesource onpropertychanged and the property is type of observa...

How to disable some items in XAML for a WPF ListView

ok, sorry for the overly broad question, but lets see what you guys suggest.. I have a WPF ListView loaded by an XML file, using XAML (code below) I have a second xml file with items that match what is in my ListView. However, if there is not a match in the 2nd file, then i want that listitem disabled. a simple example: my ListView...

Programatically turn on and off databinding?

Hi, I have a text box declared in xaml that uses databinding to a string property. How do I disable and then re-enable binding in code? Thanks! ...

How do you force a WPF ListView to Requery its ItemSource?

I'm rewriting its XML itemSource on the fly and want it to use the new data right away... ...

How do I create and show WPF windows on separate threads?

Hello, I need to create two (or more) WPF windows from the same process. But the windows must be handled by separate threads because they should not be able to block each other. How do I do this? In WinForms this is achieved by: Start a new thread Create a form from the new thread Call Application.Run with the form as parameter But...

Poor Performance When Dynamically Resizing a WPF TextBlock

I'm currently working out the layout of a WPF Application and seem to have it a bit of a snag in the layout of one of my controls. This control is a dynamically sizing, so it should fit the size of the viewport it's a part of. The problem I'm running into is a very visual problem, so I'll do my best to describe it. Here's what it looks l...

Getting inactivity/idle time in a WPF application

I was looking for the best approach to find out the if my users are idle in my WPF application. Currently, I take this idle time from operating system, and if they minimize the application, and go and search in Internet, there is a process in the operating system, so Operation system does not consider this as inactivity time even though ...

Data-Binding a WPF DataGrid Control to a System.Data.DataTable Object?

What do I need to do to get my WPF DataGrid control to bind to a DataTable object? I've been suffering over this for several days now. Even when the binding and the query both work correctly, and there is observable data in the table - nothing shows up in the data grid. My XAML code resembles this: <Window x:Class="DataGridTest....

Show/Hide a grid row based on a property?

Hi, I have a grid that has multiple rows. I want to hide/show one of those rows based on a property. Is that possible? In my case, I have two grid rows. One has a property grid and the other a list box. The list box is bound to an object and the list items are bound to an array inside that object. What I want is to hide the row (incl...

How do you disable a WPF ListViewItem in C# code?

I'm used to the old Winforms way of doing things.. Apparently WPF ListViews are full of... XmlElements? How would I do something as disable a ListViewItem? foreach (XmlElement item in this.lvwSourceFiles.Items) { //disable? } ...

How do you map mac fonts to Windows fonts

I need to display a file that comes from a mac on a Windows machine. The font name in the mac file is "Helvetica". Windows does not have Helvetica but it has "Arial" which is the close. However, if I pass "Helvetica" to a WPF control the font family is ignored. How can I get programmatically the closest font from "Helvetica" on Windo...

System.Windows.Controls.Theming.Toolkit

I've seen some people that have managed to use the themes in the Silverlight 2.0 Toolkit in Windows WPF applications. In fact, it looks like it's pretty easy...for them. I've run into an odd issue early on in my attempts. Here is all it take to fail: Create a new WPF Application project in VS2008 sp1 Add a reference to System.Window...

WPF toolkit calendar HOWTO refresh ?

hi, howto refresh automatically (e.g. assign a DateTime in C#)? calendar.SelectedDate=dt; does not work if a user clicks on the (old) year in the control it will be refreshed. ...

How to disable keyboard and mouse events in a part of the visual tree without using IsEnabled?

I've the requirement to build pseudo-modal dialogs in WPF. That is, for some specific (technical) reasons the software is not allowed to spawn modal dialogs. Instead, the user should interact with "embedded" modal dialogs when necessary. I found a solution that works pretty well with MVVM and takes care of the Dispatcher and the synchro...

Styling ListBoxItem's of nested ListBoxes [WPF]

Hello, I have a ListBox with ListBoxItem's that contains a nested ListBox. Now I want the top-level ListBox's items to not have a blue background then they are selected (see pic). I tried to use the XAML below with a style to change the background color to transparent as descibed in this blog post. This works, but it also changes t...

conditional formatting in wpf toolkit datagrid

hey i wanna change row foreground color according to a boolean in the model, whats the best way of doing it? ...

XBAP: Binding to object from resource not work?

In “Wpf Browser Application” project. Page: <Page.Resources> <local:SomeClass x:Key="someClass" Value="String from XAML"/> </Page.Resources> <StackPanel> <TextBox Text="{Binding Source={StaticResource someClass}, Path=Value}" /> </StackPanel> and class: internal class SomeClass { public SomeClass() { Value = "...

WPF Themeing of windows background dynamically

Ok, I'm working on an application that will allow you to switch themes at runtime. So far so good with all the controls and what not. However my Window object will not apply any of the base items. Here is an example of the xaml from one of my resource dictionaries. <SolidColorBrush x:Key="GrayBrush" Color="Gray" /> <SolidColorBrush x...