wpf

How to find its owner DataGrid and DataGridRow from DataGridCell in WPF?

In an event handler for a Command for a DataGrid, I get DataGridCell in ExecutedRoutedEventArgs. However, I couldn't figure out how to get its associated DataGrid and DataGridRow. Your help is much appreciated. ...

OnPropertyChanged reaction different the first time and the second time

hello, I have got a collection of viewModels(InputViewModel) in an other viewModel(ScenarioManager). each InputviewModel has an instance of a Class(RestOfInput) which contains properties able to raise the OnPropertyChanged. when one of these properties changes the event is handled by this method (in InputViewModel) : public void...

How do I update the status bar from multiple viewmodels?

I have MainWindow with a statusbar and multiple user controls in it. Each user control has a viewmodel. How do I bind/update the statusbar text from multiple viewmodels? ...

EventTrigger with Setter in WPF?

I have a normal Button and TextBox in a WPF-Window and I want a Template for the Button with a EventTrigger that listens to Button.Click and then sets a boolean-property of the TextBox. No code-behind. Something like this: <ControlTemplate.Triggers> <EventTrigger SourceName="MyButton" RoutedEvent="Button.Click"> <Setter TargetNam...

Casting Windows.Controls.UserControl to Windows.Forms.Control

Can we cast a WPF User Control to a form control?? ...

WPF Set Owner on Window created on own dedicated UI thread

Hi All I have the following code, which runs a WPF window on it's own dedicated UI thread: // Create the dedicated UI thread for AddEditPair window Thread addEditPairThread = new Thread(() => { // Initialise the add edit pair window addEditPair = new AddEditPair(this); addEditPair.PairRecordAdded += new EventHandler<PairRec...

Does there exist any commercial WPF control similar to the recipient TextBox in Outlook 2010 ?

Hello, our company wants a TextBox very similar to outlook recipient Textbox. Not emails but displaying people`s names delimited with a e.g. semicolon and even more crazy ideas on it... Do you know of any commercial WPF control who can handle that job? I already checked DX,Telerik,Infrapistics,Farpoint,componentone,Nevron,Syncfusion, e...

Stopping Mouse Hover Effect on Selected labels in wpf

I use Some Label For menus (Like websites vertical Tab Menu) if a label is clicked then the Hover effect of the labl wont take effect.., But i cant able to do that., For Hover I am Using StoryBoard ...

Is it absolutely safe to display a WPF window from a WinForms form?

I would like to display a WPF window from a windows forms application (.NET 3.5). This code seems to work without any problem in a sample project: public partial class WinFormsForm1 : Form { public WinFormsForm1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { WpfWindow1 w =...

Bind CheckBox from DataTemplate to TemplatedParent in ListBox

I have next code: <ListBox Grid.Column="1" Grid.Row="4" Grid.RowSpan="2" Margin="0,0,1,0" MinHeight="80" Name="lbThemes" SelectionMode="Multiple" IsEnabled="True"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <CheckBox x:Name="ThemeCheckbox" /> <TextBlock Text="{Binding Path=labe...

WPF code & resources

hey all i want to change in my style resources on the runtime does any body have an idea how can i deal with that from the c# code file????? thnx ...

Forcing initialization of a HwndHost

In my WPF application, I host Win32 content using HwndHost. However, creating a HwndHost does not create the native window. Rather, this is done in the overridden BuildWindowCore() method which is called sometime later by WPF. My hosted content needs the window handle of the native window for its own initialization. Unfortunately, there...

WPF: Bind to command from ControlTemplate

Hi. I am trying to add a button to a custom ListView (MyListView) which triggers a command (MyCustomCommand) defined in MyListView. I have added the button (and a title text) by applying a ControlTemplate. The problem is that I have not found a way to trigger MyCustomCommand when clicking the button. What I eventually want to achieve is ...

Restoring a Visual Element to its initial position in WPF application

Hi there, I'm implementing a WPF application where one can drag & drop a element in a designated area where this element is restored to its initial position. The drag & drop is working, and already have the events for the dragging and drop actions; my problem is how to restore the visual element to the correct position, previously stored...

memory card game wpf problem

Hello I have a memorey card game where my binding is to public ObservableCollection<List<memoryCard>> MyCollection { get; set; }//holding the array where is initlized like this : for (int i = 0; i < Size; i++) { List<memoryCard> list = new List<memoryCard>(); for (int j = 0; j < Size; j++) ...

How to use markup extensions from C# code?

Assume I have SomeExtension markup extension. Does anyone know how to assign it to a property from C# code? That is for example in xaml I have <TextBlock Text="{l:Translate LocalizedByMarkupExtension}" /> I want to do the same using C# code. ...

Why does the style change when I add an an accelerator to my button?

When I have my button's content as a normal string e.g. <Button Content="Ok" /> then button behaves as normal. But if I change the content to have a keyboard accelerator e.g. <Button Content="_Ok" /> the button's style changes to have different margins and sizes. I have a TextBlock style that doesn't have a key so is being applied to al...

How do we do idle time processing in WPF application?

Is there a way to do idle time processing in WPF application equivalent to OnIdle event in MFC? ...

DataBinding happens only first time

I have two User Controls in my window, both are bound to the same context. One of them is getting updated and the other is not. What could be the reason? ...

How to change image source on runtime ?

I get new bitmap from some other component ( dont have any control on the other component ) every 5 seconds and i need to update my wpf image control with the new bitmap ( every 5 seconds ... ). I cant find any way to update this wpf image control in run-time. How can i do it ? Thanks. ...