I have datepicker on my window and want to achieve simple behaviour: when user clear datepicker's text set datepicker date to Today XAML: <DatePicker SelectedDate="{Binding DateFrom}" Width="150" Margin="0,20,0,0"></
I'm using WPF. I have a simple GUI with 2 text boxes, 2 radio buttons. I want set the GUI components to default (textboxs with empty text and radio buttons unchecked). How can i do it? Thanks. Explain: I receive every 1 seconds tcp message. If the he
I have simple wpf window: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <StackPanel> <TextBox AcceptsReturn="True" Text="{Binding A}" /><!-- TextBox1 --> <TextBox Accept
When looking at a DependencyObject instance in the Watch window while the debugger has stopped on a breakpoint, I can see every of its "hard" properties and what values they're on, if any. This window however - or at least AFAIK -, won't show if
I've been asked to allow the user to (try to) change the selected value in the combobox event when its not valid. When he does so, I have to show an alert, and revert the SelectedItem of the combobox to its previous value. I have something like: priv
I'm trying to draw several lines to the canvas within a for loop but only seems to be drawing one. What am I doing wrong? for (int x = 0; x < 10; x++) { Random rand = new Random(); double newTop = rand.Next(0, 50); Line top = new Line(); top.Stroke =
I'm trying to style a button, but it ends up not showing when I apply the custom style, only its content (the button's text) is visible. This is how I declare my style: <Color x:Key="NormalColor" A="255" R="60" G ="15
I am creating a control in WPF that shows units using a System.Windows.Control.RichTextBox. The problem is the RichTextBox control shows a plain text instead of a formatted text. I guess the RichTextBox control has a bug and I don't know how to do it
When pressing a button I select a user control and set ItemsSource to null CategoriesListBox.ItemsSource = null; As soon as this code runs, a SelectionChanged event fires private void CategoriesListBox_SelectionChanged(object sender, System.Windows.C
I have a WPF program where my model need to load a "Out-of-Proc" (.exe) COM component in order to achieve some validations when a user make an action on the UI. I'd like to inform the user that a long action will take place to let him know that
I am using a barcode scanner and we were looking for a way to determine if input was from a keyboard or the scanner. The input will be used in a WPF POS application. We thought we had come up with a good method by using the scanners ability to prefix
I have 2 combo boxes, one that contains a list of 'Items' and another that contains a list of 'Subitems'. The list of Subitems depends on the currently selected Item. I've got most of this working (by binding the ItemSource of the Subitems to a Possi
I read a lot about the listView and still cant understand... I defined the following listView with 5 column, the first is label and the rest are texboxes. I need to add 13 rows that every textbox and labels needs to be bind to something diffrent. So
Before refactoring my code to start experimenting, I'm hoping the wisdom of the community can advise me on the correct path. Problem: I have a WPF program that does a diff on hundreds of ini files. For performance of the diffing I'd like to keep seve
I have written a WPF user control that uses Tahoma as a font to display unicode strings, which works fine. However, I have noticed that some eastern asian characters are actually missing in Tahoma, i.e. this font does not support all common Unicode c
I have a style described in Grid.resources. How could I modify height and width(in my sample they are 20 and 20) of Ellipse from Thumb? Other properties are accessible from other parts of code but not this(( <Style x:Key="CustomThumbForSlider"
I'm trying to access a user control which is inside the control template of a content control. Specifically: <ContentControl x:Name="MyList" > <ContentControl.Template> <ControlTemplate x:Name="MyControlTemplate"> <
This is my DataTable. DataTable _simpleDataTable = new ataTable(); var person = new DataColumn("Person") {DataType = typeof (Person)}; _simpleDataTable.Columns.Add(person); var student = new DataColumn("Student") {DataType = typeof (St
<Window x:Class="Binding2.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="
I have the following MenuItem inside of a Context Menu in my WPF application: <MenuItem Header="Email"> <MenuItem Command="Commands:CommandRepository.GenerateUserEmailCommand" CommandParameter="{Binding Path=SelectedItems
I have been stumped with trying to convert the following code into pure c#. This XAML code is from Cavanaghs blog on how to make rounded corners on anything. The code works but I need to convert it to c# as i need it to be dynamic in some cases. If y
I have the following simple code: <Window x:Class="WpfApplication3.MainWindow" x:Name="WindowInst" -> <local:UserControl1/> </Window> <UserControl x:Class="WpfApplication3.UserControl1" -> <Button C
I'm working on a diagnostic tool and receives data every 25 ms. I need this data to be drawn in my chart using a lineSeries. I'm using a a wpf chart with a lineSeries which I bind in xaml to an ObservebleCollection. The problem is that I need the col
Problem When you search for such question using google you get a lot of hits but all solutions assume you have at least one window. But my question is just like I phrased it -- not assumptions at all. I can have a window, but I could have zero window
I am new in the Wpf world, so I created a couple of views and all of them have at least one ComboBox, as I am using the MvvM pattern, I get my self re-typing all the time the same line of codes to fill the Combo and to get the SelectedItem (creating
I'm trying to call Dispatcher.PushFrame() from several different thread but encounter an error: Must create DependencySource on same Thread as the DependencyObject. Here is a code snippet: _lockFrame = new DispatcherFrame(true); Dispatcher.PushFrame(
I would like to understand the general requirements for WPF/Silverlight layout for making it possible to implement pan&zoom (drag and zoom) features. I don't mean pan&zoom for an image but for a total page (window) layout (or part of it) with some
I've got many user controls like this: PageManageCustomers.xaml.cs: public partial class PageManageCustomers : BasePage { ... } which inherit from: PageBase.cs: public class BasePage : UserControl, INotifyPropertyChanged { ... } Since PageBase.cs has
Couldn't find an answer to this one. I have a WPF ListView control that can contain varying number of columns. For example, it can display customer data, displaying columns Id, Name, Email etc, or it can contain products, displaying ID, Name, Price,
I need to be able to fill a stackpanel with buttons but the buttons must appear at the bottom of the stackpanel first and populate upwards. The buttons are created dynamically and there's an unknown number of them so visual hackery just won't work. I