Is it possible to disable keyboard input to a control ? For instance a listview ? Ho do I do that? I've tried overriding the KeyUp KeyDown events but apparently that was not the way ?
IsEnabled is a good solution, however I only wish to disable keyboard interaction and leave mouse interaction intact.
...
I need to use some WPF components in an NUnit unit test. I run the test through ReSharper, and it fails with the following error when using the WPF object:
System.InvalidOperationException:
The calling thread must be STA, because many UI components require this.
I've read about this problem, and it sounds like the thread ne...
In my WPF application I have a TextBox and a Button. The button has a command binding to a command that will do something with the text.
<TextBox x:Name="_textBox"></TextBox>
<Button Command="{Binding SomeCommand}"
CommandParameter="{Binding ElementName=_text, Path=Text}"
Content="Trigger SomeCommand" />
Now, I want ...
Hello,
is there any "best practice" way to replace a part of the default template. The current use case is a treeview. As default, the treeview has this small triangle shapes to expand and collapse.
I know how to replace these if I replace the whole control template, as shown in the code below. I am not sure if there is a way to "keep ...
One Contextmenu in my application has Grid controls ( with buttons ) as menuitems.
<RichTextBox.ContextMenu>
<ContextMenu Width="280">
<Grid Width="240" Height="65">
[...]
</Grid>
</Contextmenu>
</RichTextBox.ContextMenu>
The Problem is when I first open the ContextMenu and move the mouse over it, ...
I have a UserControl which contains a ListBox. And ListBox uses another UserControl as DataTemplate.
<ListBox x:Uid="SectionList" x:Name="SectionList" ItemsSource="{Binding}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<expander:ExpanderDataTemplate/>
</Grid>
...
Hi,
I have the following listview, but it doesn't show the actual records, but only the namespace of the object. I wondered if I need to create the columns in XAML for it to show the records and then bind it to some properties of an object or what is wrong with this?
<ListView
Name="ListCustomers"
ItemsSource="...
Hi
i´ve got a problem with the databinding of a combobox in a listview.
i have two classes:
- Transaction
- Substrate
the Transaction has a attribute of the Substrate and the Transactiona are saved in a Datebase. At the start of the programm i want to load all Transactions as a list and show them in a ListView. Each possibility of Subst...
I'm playing around 3d objects in WPF. I have a viewport3d. This contains two 3d object (ModelVisual3d) named "A" and "B".
I want to just show A and hide B,
sometimes, I want to just show B and hide A.
How can I do hide it?
I'm found answer, but this tell "set the OffsetX property to 1000.". I don't like it.
Is it possible to hide ...
Im trying to learn MVVM so far its going well , I have stumble on a situation which I don't know how to implement ..
What I want :
- A view with left navigation and right details pane .. right details will have a contentcontainer which would hold my User Controls for the views to be selected by left pane
What I have :
- A MainVie...
Hello everyone,
technology: WPF, C#
pretext:
I am making a game with a custom gyroscope+accelerometer device. I have a sphere that has a labyrinth map on it. The texture is mapped by a set of positions and texture coordinates generated from 3rd party. The user rotates the sphere via device trying to solve the labyrinth.
question:
I ...
I want to have a command on my viewmodel execute on the selectionchanged of my ComboBox. Obviously Combobox does not support executing commands.
I have created a new class that inherits from Combox and implements this interface.
When I try to view the control (in the designer or in debug) the control doesn't show. I don't get any excep...
I have a dialog with two textboxes and a button. The button's IsEnabled style is set dynamically based on whether the data validation of the two textboxes succeeded.
<Button Content="Finish" x:Name="btnFinish" Click="btnFinish_Click">
<Button.Style>
<Style TargetType="{x:Type Button}">
<Setter Pro...
Hi,
I am using the WPF SortDescriptions sorting technique and I have found that it will not sort numbers. When given a column of numbers to sort it tells me that
"Failed to Compare two elements in the array"
Does anyone know how to get around this? Or maybe give me some hints?
I noticed that it will only sort strings right, but not nu...
I have a main window with a single user control in it, called SuperMode. SuperMode consists of a collection of people and each person in this collection has their own collection of tasks. Sounds simple, right?
From file SuperMode.xaml:
<UserControl
x:Class="Prototype.SuperMode"
xmlns="http://schemas.microsoft.com/winfx/2006/xa...
Hi,
I've got a parent UserControl which has a property which I would like to access from a child usercontrol of the parent.
Is this possible? I'll be doing this through the child control's viewmodel.
Just wanted to get an idea on the best approach to do this.
Thankyou.
...
Morning Guys,
I have a few ComboBoxes bound to List of TimeSpan. I am formatting the TimeSpans using IValueConverter and ItemTemplate. I was wondering if there were an easier way to format the TimeSpans. Here's what I'm currently doing.
public class TimeSpanConverter : IValueConverter
{
#region IValueConverter Members
public o...
I am not interested in animations and I am trying to make simple setter action to be set without key frames.
I wanted to inherit TriggerAction; make properties that set the new value on target, any additional optional properties so I can use:
<EventTrigger SourceName="btn" RoutedEvent="Click">
<BooleanActionTrigger TargetName="cb" ...
After selecting ListBox item programmatically it is needed to press down\up key two times to move the selection. Any suggestions?
View:
<ListBox Name="lbActions" Canvas.Left="10" Canvas.Top="10"
Width="260" Height="180">
<ListBoxItem Name="Open" IsSelected="true" Content="Open"></ListBoxItem>
<ListBoxItem...
Hello,
I am building an application using the WPF. This application is for presentation purposes, the user can draw shapes, write text play audio and video ...etc. but I have an error message about the NTLDR when I am running the application on the Windows XP and actually I do not have any clue of where I can find the problem.
I would ...