I have a group of three radio buttons. Depending on which radio button is selected, I want to disaply one of three controls - a textbox, a dropdown list, or a button. How do I display controls based on the result of a selected radio button?
...
It appears that in a WPF TabControl the user can select multiple items, either via Ctrl-Click or Shift-Click.
Is there a property that controls this?
Or do I have to handle the click/select event and explicitly unselect other items?
...
We all know how sucky WPF validation is out of the box. I am trying a very simple thing and for some reason it is always failing. I have a TextBox and my only requirement is to validate that the user inputs something in the TextBox. The TextBox is bound to a Customer object with FirstName and LastName properties.
Here is the XAML code:...
I am throwing an ApplicationException if the FirstName value is null or empty and I am trying to display the error message in the TextBlock which is part of the ErrorTemplate. But it always shows "Exception has been thrown at the target of invocation".
public string FirstName
{
get { return _firstName;}
...
How to print multiply flowdocumets in a batch?
Following code should print different documents but print the same. This sample works pretty fine only if you print to the xps printer.
var printDialog = new PrintDialog();
if(printDialog.ShowDialog() == true) {
var xpsDocumentWriter = PrintQueue.CreateXpsDocumentWriter(printDialog...
Hi,
Currently I am using a sortable listview Which is bind to DataTable, I have a Serial number column which is auto incremented and displayed, Our requirement is when we sort other columns this column shall remain constant and show row numbers in series as in Excel.
I am planning to have a stack panel beside listview and adding Textb...
I'm currently very confused by the differing behavior regarding the FrameworkElement.Loaded event. I've put together a small example application that demonstrates this.
Xaml:
<Window x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/20...
Hey there,
I am using the Model View View-Model pattern for a WPF app. I have a ViewModel (set as a pages DataContext) with two properties, one of which is an Entity with a PropertyChanged event. In the event handler i set the value of the other property (a boolean) to some value.
Now the Button and TextBox properties are binding fine ...
Hi,
I want to create a container usercontrol with design time support in WPF ? How can I do ?
...
The Rectangle element has StrokeDashArray which allows it to be drawn with dashes, but it doesn't support rounded corners. The Border control supports nice thick lines with rounded corners, but will only draw solid lines.
What's the best way to achieve a dashed border with rounded corners, with any control?
...
I know Windows Forms quite good but I'm new to WPF.
I'd like to create application similar to RSS reader - in main window every note will be displayed in Post-it like frame and all notes should be chained and scrollable up and down. I also want to include kind of fisheye view - single note will be displayed full size in the centre of t...
I have a large list view in WPF window, and only a small part of the data can be shown at the same time. What I want to do is to create a thumbnail near it. When dragging a rectangle in the thumbnail, the list view will automatically scroll to the data surrounded by the rectangle, and vice versa.
I have found this artical: http://www.t...
Hi!
I'm currently messing around with Rob Eisenberg's Caliburn framework. When looking at the documentation that is provided on http://caliburn.codeplex.com there is an example of how to resolve a Caliburn service from the container.
It's something along the lines of this:
SimpleContainer container = new SimpleContainer();
CaliburnFr...
Hi,
Is it possible to call a command via an event in WPF?
I have a save button that when pressed calls a command, this is pressed when you have finished editing a textbox, it also passes an object as a command parameter
<Button Content="Save" Command="{Binding DataContext.SaveQueueTimeCommand, RelativeSource={RelativeSource FindAnce...
The Items collection of a ListView contains the actual business objects. How do I obtain the corresponding ListViewItem given a business object (SelectedItem)?
...
We're using a WPF GridView that is dynamically bound to a DataTable (which in turn is the direct result of a DB query). This basically works fine and displays whatever the results from the DB query are in a nice table.
Now the problem is that some of the results contain DateTime columns, and the date displayed is always in US format and...
Is using WPF navigation in standalone applications is best practice? And can it be used with WPF MVVM pattern?
...
Hi.
I am currently developing a WPF application for a Single Board AMD Geode Computer (touch screen).
Windows Embedded Standard installs fine on the device and it has .Net 3.5 loaded. The application runs fine for the most part but I am getting some anomalous behavior and I am suspecting it coming from the framework, as the problems ca...
I have the following code:
<Window.Resources>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="LayoutTransform">
<Setter.Value>
<TranslateTransform />
</Setter.Value>
</Setter>
<Style.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<EventTrigger.Actions>
<BeginStoryboard>
...
I've got a simple Item-class, that looks like this:
public class Item : DependencyObject
{
public int No
{
get { return (int)GetValue(NoProperty); }
set { SetValue(NoProperty, value); }
}
public string Name
{
get { return (string)GetValue(NameProperty); }
set { SetValue(NameProperty, value); }
}
public static readonly D...