I have a class that derives from InlineUIContainer. I want to take an action when an editing command (like ToggleBold) is performed on a FlowDocument selection that includes an instance of this class. I've tried registering for this command but it isn't raised. I've tried overriding OnPropertyChanded, but it is only called on explicit...
I have a window with 3 textboxes in a grid -this is my view- and I have Save button to add a new user to my user list with the datas from the textboxes.
I want to use a relay command to do this on my viewmodel class but I am quite confused with how to make the bindings. I hope it's clear enough. Any ideas, or examples will be helpful.
t...
WPF ListBoxItem how to wrap text in it? My Item container style looks like this:
<Style x:Key="GroupListBoxItemStyle"
TargetType="ListBoxItem">
<Setter Property="OverridesDefaultStyle"
Value="True" />
<Setter Property="FocusVisualStyle"
Value="{x:Null}" />
<Sette...
Hi,
What would be the best/right way to have a set of DataGrid columns have proportional width (Width="*"), but to have their MINIMUM width be at least the width of their content? At the moment, if I use Width="*", then the columns stay exactly proportional, but content gets cropped if the columns get too thin. If I use Width="Auto", th...
I want to simulate user input to a WPF TextBox. I want to input a character such that the OnPreviewTextInput event is triggered. I tried setting the Text through the Text property, but this didn't trigger the event:
public void SomeFunction()
{
var textBox = new TextBox();
textBox.Text = "A";
}
Can I trig...
I have a ListBox which binds to a child collection on a ViewModel. The listbox items are styled in a datatemplate based on a property on the parent ViewModel:
<Style x:Key="curveSpeedNonConstantParameterCell">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=DataContext.CurveSpeedMustBeSpecified, ...
I have a TextBox which I'm using to handle numbers. I therefore only accept [0-9.,]. However, "." is the only valid decimal separator. I therefore only want this in my text, but I want to accept "," too, and swap it with a "." such that the displayed character is a valid one.
So - how do I swap an input character? I'm assuming I can fe...
I have a visual studio 2010 project that is trageted to .Net Framework 3.5. The project build fine from the Visual Studio but when I try to compile it from command line or from TeamCity I get the following build error:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFX.targets(269,9): error MC1000: Unknown build error, 'Ca...
I will appreciate if some body can explain with a simple example.
...
Hi,
How can I bind a collection of Commands in viewmodel to a toolbar in related view?
...
I'm developing a WPF applicaition to try and get a better understanding of what it's about and what it can do. I've got a situation though which I'm not sure how best to implement, where basically my UI needs to change depending on user selection.
Essentially I wish to build up a set of 'ConditionRows', where the user specifies a 'Field...
I am using a TabControl to programmatically show or hide groups of form controls. I have implemented the technique described here and it approximately works as expected, except that there is a band approximately 1 or 2 pixels high in the location where the tab headers are normally displayed.
I have verified this by using Snoop to naviga...
Hi,
Let's say I have a WPF application that shows "questions". Questions can have different statuses, such as "open", and "answered". The questions are stored in an ObservableCollection and displayed on a DataGrid.
I want to have a toggle button at the top that switches between "open" and "answered" questions. When a user clicks the "...
I have a window in one assembly that has a TextBlock control that I want to bind to the value of a Property of a class that is the property of the DataContext of that windows parent. The class that is serving as the DataContext is only defined within the second assembly. My question is what type do I need to specify as the Type in my b...
Hello,
I'am just coding some global gesture handlers for a wpf application. For example I am supposed to use right click as a trigger to proceed UI.
<Window.InputBindings>
<MouseBinding MouseAction="RightClick" Command="NavigationCommands.NextPage"/>
</Window.InputBindings>
But now the problem appears that <ListBox/> consume...
I have a MediaElement where the source is bound to some data
<MediaElement Source='{Binding Something}' />
What is the simplest way to have the video repeat? Ideally, MediaElement would have a repeat behavior property.
<MediaElement RepeatBehavior='Forever' ... />
But I can't find such a property.
...
If I have the following data template for a TreeView, what do I need to change so that each TreeViewItem shows the value of the name attribute on each XML node, instead of the node name?
<HierarchicalDataTemplate x:Key="NodeTemplate">
<TextBlock x:Name="tb"/>
<HierarchicalDataTemplate.ItemsSource>
<Binding XPath="child::...
Can someone shed some light on active aware interface is in Prism, how it helps delegate command.
...
Hi,
I currently have a listboxitemcontainer, which if selected turns the background blue.
However later I programatically set : Border.Background = new solidcolorbrush(colors.white);
How do I reset the the border background now to use the template colors again? Now when I select the box again, it doesn't turn to the selection color an...
I have a ContentControl in my view which is databound to the CurrentItem property of my viewmodel. The objects that are exposed via CurrentItem each has its own DataTemplate.
When the CurrentItem property changes, the appropriate DataTemplate for that item is displayed, as it should be. However, I cannot find out a way to set the keyb...