wpf

How to bind a property of buisness layer class in the UI layer in WPF?

Hi, Can i bind a property of a class from the other layer to the UI. I have that class object in the UI. ...

WPF listbox datatrigger hide selected

I have a listbox which has a datatemplate. Within the template I've got a trigger to hide a lsitboxitem if it's IsDeleted property is set to true. <DataTrigger Binding="{Binding Path=IsDeleted}" Value="True"> <Setter Property="Visibility" Value="Collapsed" /> </DataTrigger> This work OK but the problem I have is that the listbox its...

Styling WPF controls inline with Infragistics themes

Hi, we are using Infragistics WPF controls (e.g. xamDataGrid, xamDockManager etc), and we will be using the Infragistics Office 2007 Blue theme which these controls support. We also want to style the rest of the application (i.e. standard WPF controls) using the same Office 2007 Blue style. What's the best approach? Are there Office ...

wpf menu displaying problem

I have a problem displaying menu (normal and context menu). I don't know if this is some bug, things to do with my graphic drivers or something. here is the link for the screenshot how it looks like: http://img191.imageshack.us/img191/2896/menuproblem.jpg It only happens on my computer and only in wpf applications (no matter what kind ...

How can I set the height of a WPF-Control to the maximum which is available?

For example: I have a Stackpanel with height of 200px. In this panel a grid with a height of 50px. How can I add a control (for example a textblock), which use the complete rest of height (150px) and not only the height of the textfont? ...

WPF: Change the text of menuitem on context menu

I have context menu in XAML with the following MenuItem: <MenuItem Command="local:MyClass.MyCommand" "/> I'd like to change the Header of menu item by somehow changing the Text of RoutedCommand. And I'd like to do that in CanExecuteRoutedEventHanlder. If I just change the RoutedCommand Text, Menu items doesn't get updated, I assume t...

Displaying large sorted lists in WPF QUICKLY?

I am developing a program that should be able to display long (up to 500 items) lists of data that need to be resorted when their contents change. Essentially, I have a viewmodel with an observable collection that contains classes with observable data bound to the gui, which is displayed in a ListView. The data must be sorted, but the ...

is it a bad idea to have static wpf value converters?

Instead of declaring the converter in the Resources, i can do something like IsEnabled={Binding Path=SomeProp, Converter={x:Static namespace:Converter.Instance}}" where Instance is instantiated only once (lazy sinlgeton) But i'm worried about keeping references to static variables might get in the way of garbage collection when dispo...

How can I process a 3rd-party key combination when my app is active?

There is a small 3rd-party program in the notification area of the taskbar that uses Ctrl-F11 key combination to do a task. The problem is I am using the same shortcut but mine is shadowed by the other one. Basically, I can not do my thing when the user presses Ctrl-F11 even though my window is the one that is currently active. I thought...

How to add condition to a WPF Context Menu?

How could I add some conditions changing list of MenuItems in a WPF Context Menu, depending on some attributes of clicked objects?: <Grid.ContextMenu> <ContextMenu> <MenuItem Name="EditStatusCm" Header="Change status" /> ... <MenuItem ... /> </ContextMenu> </Grid.ContextMenu> ...

Changing FontSize relationally to the windowsize with WPF?

Is it possible, that the FontSize getting smaller if I shrink the window and getting bigger if I enlarge the window? ...

WPF Grid Show/Hide Column

I have the following layout in my grid <Grid> <Grid.RowDefinitions > <RowDefinition Height="50" /> <RowDefinition /> </Grid.RowDefinitions> <Button Click="Button_Click" Grid.Row="0" Width="50" Grid.Column="2" Content="Test" /> <Grid Grid.Row="1"> <Grid.ColumnDefinitions> <ColumnDefinition Wid...

How to set FontSize of a Textblock, which is in a Viewbox

I can't set the FontSize of the Text in a TextBlock, since the TextBox is in a Viewbox. Why? ...

What is the correct way to initialize a model and view in WPF CAL MVVM.

I have come accross two ways of initializing Views and ViewModels in WPF CAL MVVM. 1 - Seems to be more popular. Requires you to resolve the ViewModel to automatically resolve the View. The ViewModel contains information about the View. public interface IView { void SetModel(IViewModel model); } public interfac...

WPF RadioButton selected in UI, but seen by code as IsChecked == false

I have some radio buttons in a group box. I select the buttons randomly, and all works perfectly from a visual standpoint and also the event handler is called each time a new button is selected. Now I have a dependency property with a callback when the value changes. When in this callback procedure I read the IsChecked value of any butt...

ComboBox SelectedItem does not change after clearing the observable collection.

Hi, I'm having an issue witha combobox whixh is bounded to an observable collection and I was wondering if anyone can point to what am i missing. I have a combobox which is bounded to a simple ObservableCollection also I bind the selectedIndex in a OneWay binding to some property. In my application i get to a point where i want to clea...

Adding a window listener to a WPF-Window?

How can I add an window/event listener/handler to a wpf-window? I want to know, if the user wants to close the window. ...

DependencyProperty value not getting set through data binding

I have a class which has a DependencyProperty member: public class SomeClass : FrameworkElement { public static readonly DependencyProperty SomeValueProperty = DependencyProperty.Register( "SomeValue", typeof(int), typeof(SomeClass)); new PropertyMetadata( new P...

WPF - C#: This element is not currently associated with any context

I have a WPF UserControl, which I use in a WinForms Control within an ElementHostControl. Then I start a WPF Window, while the Windows Form is still open. If I then close the WPF Window, and try to add a Child Element to my WPF UserControl, it crashes at "InitializeComponent()" (of the Child Element) with the exception: "A first chan...

Passing text info to a WPF "balloon" window

I want to be able to launch a "balloon"-type window when errors happen in my command line apps that I run in a batch. I'm thinking of creating a WPF executable, and passing it the message to be displayed on its command line. Will I be able to pass in Unicode characters on its command line? Can anyone suggest a different approach of ...