I have a problem with WPF Textbox CaretIndex. On GotFocus or PreviewMouseLeftButtonDown
or GotKeyboardFocus or PreviewGotKeyboardFocus I can't get CaretIndex value .It is always zero.
After those events are occured on LostFocus for example I can get CaretIndex value.
It seems that CaretIndex is setted after this events?
Can you help me?...
Hello,
I've noticed that the SL3 Validators automatically uses the properties from DisplayAttribute when creating validation messages. I'm interested in any suggestions on how to extract this information from a control's binding using code. I've included an example:
ViewModel code:
[Display(Name="First Name")]
public string FirstName ...
When I started to learn about WPF and MVVM recently, I came across some sort of framework or technology in .NET that made it really easy to request a service of some kind. In my particular case, I've got an assembly that handles writing application preferences to an XML file, and I want to let all of my assemblies in the larger applicat...
Hi :),
I am trying to get the XElement representing the contents of a Viewport3D control in a form in WPF.
If I do this: XamlWriter.Save(Viewport3DName)
then the attributes of the contents of the Viewport3D are not saved by the XamlWriter.
I thnk its described here: http://msdn.microsoft.com/en-us/library/ms754193.aspx
My aim ...
I have a WPF form, I want to lay out a standard form onto it. Each form element will have a label, and then a control. Pretty standard stuff.
If I use a wrap panel, it can cause the label and the control to be separated, but I want them to stay together. is there some WPF equivalent of nobr?
Grid works, and allows for column spanning ...
I'd like to have the nested containers inherit that property, but when I set it in the outermost one I'm not sure if it's working. It either is working but I'm not getting the results I want, or maybe I'd have to set up a property somewhere for it to carry.
Assuming that a) it is possible to do it and b) I'd have to change a property so...
Can anyone suggest a guideline on when to use SnapsToDevicePixels in WPF 4.0?
Should it only be used occasionally if there is an issue, liberally throughout an App, only on certain controls or what?
...
I am making a WPF Application in C# where I need to show the recent documents history (just like it happens in word, excel and even visual studio), showing the list the last 5 or 10 documents opened. I have absolutely no idea as to how I should go about it. Please help. And please be kind and gentle...I am an amatuer coder, and it is tou...
How can I get the ParentComboBox of an ComboBoxItem?
I would like to close an open ComboBox if the Insert-Key is pressed:
var focusedElement = Keyboard.FocusedElement;
if (focusedElement is ComboBox)
{
var comboBox = focusedElement as ComboBox;
comboBox.IsDropDownOpen = !comboBox.IsDropDownOpen;
}
else if (focusedElement...
* EDIT *
Sorry, I should make it clearer.
Imagine I have an entity:
public class MyObject
{
public string Name { get; set; }
}
And I have a ListBox:
<ListBox x:Name="lbParts">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</List...
I am using MVVM architecture.
I have a usercontrol UC as a View
Model is a ModelData class
ViewModel (UCViewModel) is binded to a usercontrol.
I have three more usercontrols that is inside the usercontrol UC ( discussed above).
Let's say uc1, uc2 and uc3.
and the visibility of uc1 , uc2 and uc3 inside UC depends on the type select...
Hello
I am trying to create a status window which content(textbox) should change in a lengthy operation.
This status window is called and updated from the main application.
Unfortunately, the content is updated only at the finish of the operation.
I am using VS2008, C# and WPF.
Thank you.
...
I'm creating a simple editor within our application using the WPF RichTextBox. Above it I've added the reguslar buttons like Bold, Italic, etc. These buttons use the RichTextBox's commands to set these properties, but next to these buttons, the commands also get send with CTRL+B, CTRL+I, etc. I want these buttons to represent the current...
Hi,
Within a Groupbox I have a Listbox, ListboxItems are defined in the XAML as well. The Listbox is defined:
<ListBox Name="lvAvoidCountry" Margin="5,5,5,5"
Background="Transparent"
ScrollViewer.VerticalScrollBarVisibility="Visible"
ScrollViewer.HorizontalScrollBarVisibility="Disabled" >
Items are defined like this:
...
Hi all,
Users around my country are currently beta-testing our application. My app uses WPF & Linq, so I need .NET 3.5 installation. On most system, everything works find, including automatic installation on .NET 3.5 on machines that do not have that installed yet.
However, on one machine (XP SP2) my application does not run. The user ...
Hi
I have a long list of data that I want to display in table format to users. The data changes when the user performs certain actions in my app, but it is not directly editable. So the user can create a reasonably big table of data, but he can't change individual cells' values.
However, I do want the data to be copy-able. So I want it...
I have a view model with a property Fields which is an ObservableCollection<FieldVM>. In the view that uses this property, I have an ItemsControl like so:
...
<ItemsControl ItemsSource="{Binding Fields}" />
...
FieldVM is an abstract class, implemented by such classes as TextFieldVM and EnumFieldVM. During run time, these FieldVM-impl...
Hi!
I would like to start a fontsize animation of a textblock from C# code. How can I do this?
I want increase/decrease fontsize during a period of 1 second.
Thanks!
...
In wpf how can i prevent user from moving the windows by dragging the title bar?
...
Struggling with styling the mouse over for a button ... I have managed to style the button (solid red), but I would like for it to change to solid black whenever a mouse over occurs. I am new to XAML, and I can see that it wants some type of story board/animation ... not sure exactly how to do this.
Any help would be greatly appreciated...