wpf

Listbox scrollbar doesn't follow selected item (with ICollectionView)

I'm trying to implement the MVVM pattern in WPF. I've followed Jeremy Alles's Very simple MVVM demo application. I have a ListBox that has a binding to an ObservableCollection: <ListBox Name="myListBox" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Persons}"> <ListBox.ItemTemplate> <DataTemplate> ...

WPF Binding issue with updating values

I have a .xaml file and a .cs file that share value with Binding. To make it simples, I have 1 button and 1 textbox. I want to button to be disabled when the textbox's text has no character. Here is the two codes of the xaml for binding: <TextBox Name="txtSend" Text="{Binding Path=CurrentText,UpdateSourceTrigger=PropertyChanged}"></...

Sizing the content to fit into screen resolution

hello i have a window(wpf) with labels and text boxes, i want him to fit to the screen resolution as much as possible, how do i do it ...

Is there a way to resuse property setters amoung triggers

In WPF is there some mechanisim to reuse the property setters amoung differant triggers? For example I have the following. <Style TargetType="{x:Type Label}"> <Style.Triggers> <DataTrigger Binding="{Binding}" Value="{x:Null}"> <Setter Property="Content" Value="...

WPF application is crashing after publish

Hi, I've upgraded WPF application to Visual Studio 2k8. App is .NET 3.0 which is set as a platform in the project. If I build project & release confiuguration, app is running well. If I try to publish it using ClickOnce, it is crashing because xaml resources couldn't be find. Any idea? Thank you very much. P.S. It seem that XAML r...

wpf - how to support bitmap transparency in imagebrush

I have a lot of pre-existing BMPs (and our clients have pre-existing bmps as well) that prevent us from simply converting them to PNGs. How does one get WPF to respond to the transparency techniques formerly used in winforms? Thanks, jeff ...

Show WPF Tooltip if needed

I have a TextBlock inside a limited-size control. If the text is too long to fit into the control, I'd like to show a tooltip with full text. This is a classic behavior you surely know from many apps. I tried using a Converter to convert TextBlock width into Tooltip's Visibility. <GridViewColumn.CellTemplate> <DataTemplate> ...

How do I refresh a DataGrid at timed intervals in F#?

I have a background thread updating an array. At timed intervals I call myDataGrid.Items.Refresh(). However nothing changes on the screen. But when I for instance click on the column heading of the data grid on the screen the information is actualized immediately. I like to see the changes on the screen at timed intervals, for instanc...

My WPF app still running if I open another Window

Hello, I'm writting an WPF application using the mvvm toolkint. In the main windows I have a command in a button that open another window using: catView.ShowDialog(); Well, I close that window (using a close button or the X) and when I close the main window, the app is still running and I have to kill it. If I don't open the second ...

How do you pass data into an IValueConverter in XAML?

I have an IValueConverter whose job it is to convert a BlockId to a ConditionLabel. The problem is that my Model object is what has the smarts to do the actual conversion. My code looks like this so far... public class BlockIdToConditionLabelConverter : IValueConverter { private Model _model; public BlockIdToConditionLabelConve...

WPF Touchscreen User Interface Guidelines

Hi, Does anyone know of any good resources relating to UI design, specifically focusing on WPF and touchscreens? Thanks for your time ...

How can I debug the binding of my ViewModels to my View?

I have this ItemsControl in my View: <ItemsControl ItemsSource="{Binding ItemPageItemViewModels}" ItemTemplate="{StaticResource ItemPageItemViewModelsTemplate}"/> And above it I have this DataTemplate which renders all the items: <DataTemplate x:Key="ItemPageItemViewModelsTemplate"> <TextBlock Text="{Binding Title}"/> </...

multiple grid form layout

Hello: I have a time sheet type of presentation, which is currently using three (3) datagridview controls on a winform as follows: 1) projectGrid - rows are variable, with one for however many projects were worked on that week (typical is 1 to 5 for most users). 2) nonProjectGrid - four rows of fixed activities one can record time spe...

How can I add an "IsDirty" property to a Linq to Sql entity?

Okay, similar questions exist, but they are all about how to determine this from outside of the entity itself and use the DataContext the entity is attached to. I am binding my entities to an edit form in WPF. Within a DataTemplate, I want to be able to set the background color of the root container within a DataTemplate to show it has...

How do I notify a container control that a child control has changed size?

I'm making a UserControl that is a child of a StackPanel. When it's content changes the size of the control should also change. How should the UserControl notify the StackPanel (or any other container control) that it's size has changed? For example, if you have a Label control and change the Content element then it will be resized. How...

Set selection to newly added Item in WPF TreeView

I'm using a TreeView to let the user navigate a complex data structure more easily. I'm trying to add a feature to my application so my users can add new items to the datastucture by clicking a button on a toolbar. This new item has 3 levels, each with 1 item. I would like to select the item in the lowest level. Adding the data isn't a ...

WPF custom control style problem

Hi. I have a custom control (from MS Toolkit - DatePicker). I've made my own style like this: <Style TargetType="{x:Type local:DatePicker}"> But this style does not apply automatically. I have to add Key: <Style x:Key="DatePickerStyle" TargetType="{x:Type local:DatePicker}"> and reference it in each custom control like <toolkit:...

Manual Page loading in WPF

Hi, I have a button in my Main window, on the click of this button the Main window should be reloaded. How to achieve this? Please reply Thanks Sharath ...

Using Image control in WPF to display System.Drawing.Bitmap

Hey guys, How do I assing in memory Bitmap object to Image control in WPF?? PS: I googled about it but no luck :( ...

wpf: change font size for WebBrowser control

How to do this? ...