I am making a custom control I need to add some default keybindings, microsoft has already done with copy and paste in a textbox. However one of the keybindings needs to pass a parameter to the command which it is bound to. It is simple to do this in xaml, is there any way to do this in code?
this.InputBindings.Add(new KeyBinding(Change...
I have a ListBox with radiobutton on the horizontal line. Number of radiobuttons is optional. The text for each radiobutton is taken from a list of the model. Which radiobutton that is selected will be determined by the property SelectedOption. If none is select it shall be set to -1.
The problem is that I wish that in addition to the ch...
Hi,
I want to make a window interface just like "Devices and Printers" window in Windows 7 in which items can be suppressed and drilled down. Any ideas how can i build such a view and which controls from wpf can be used.
Any ideas are greatly appreciated !
...
I'm working on an application for a client, and one of the requirements is the ability to make appointments, and display the current week's appointments in a visual format, much like in Google Calendar's or Microsoft Office. I found a great (3 part) article on codeproject, in which he builds a "RangePanel", and composes one for each "pe...
I have a Canvas which has an image as background. When I do the ScaleTransform to increase the size of the image, the image blows out of the Canvas. Although I increase the size, I don't want the image to go out of the Canvas, I just want it to fit inside the Canvas. How to fix this issue in WPF?
...
I have a class which inherits from Canvas. On the OnRender method I draw a text which is being covered by the controls that are on the canvas.
Is there a method to place the text "above" the controls? is there an OnRenderComplete method (that is being called after the visual tree was rendered)?
...
I've defined the following TabControl called TabControl1:
<TabControl>
<TabItem Header="Cheese">
The Cheese Tab
</TabItem>
<TabItem Header="Pepperoni">
The Pepperoni Tab
</TabItem>
<TabItem Header="Mushrooms">
The Mushrooms Tab
</TabItem>
</TabControl>
I've defined another TabControl, TabControl2 which is dynam...
Hello,
I'm new to WFP and try to learn it via different examples.
Right now I want to create a custom user control, which have button inside it (among other controls). I want to expose Buttons Content property as User Controls own.
User Control:
<DockPanel LastChildFill="True">
<Button Name="ClickButton" DockPanel.Dock="Right" Foc...
Hi,
I have a control template in one of my pages and i am assigning this template to my textbox's Validation.ErrorTemplate property. The following code would give you a better view.
<ControlTemplate x:Key="ValidationErrorTemplate">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<AdornedEle...
Hi Experts,
I have implemented a binding on a selected item of a combobox as
ComboBox1.ItemsSource = Masters;
Binding binding = new Binding("RecordID");
binding.Source = Masters;
binding.UpdateSourceTrigger = UpdateSourceTrigger.LostFocus;
binding.ValidatesOnDataErrors = true;
binding.Mode = BindingMode.TwoWay;
ComboBox1.SetBinding(C...
In my WPF application I need to read text from several textboxes. Because the code is running in a different thread to the UI, I need to use Dispatcher.invoke. At the moment I’m working with one textbox which works fine, but now I need all the texts, do I need to write a Dispatcher.invoke for each textbox or is there a way to write a fun...
Hello,
My goal is to have a user select a year and a month. Translate the selection into a date and have the user control send the date back to my view model. That part works for me....However, I cannot get the ViewModel's initial date to set those drop downs.
public static readonly DependencyProperty Date =
DependencyPropert...
Hello,
I'm learning WPF, so I'm kind of n00b in this.
I saw some examples about how to do what I want to do, but nothing exactly...
The question: I want to bind List to ListBox. I want to do it in XAML, w/o coding in code behind. How can I achieve that?
Right now I do it that way:
<!-- XAML -->
<ListBox x:Name="FileList">
<ListB...
I want to change the style of a combo box control to look like a hyperlink.
When user clicks on the hyperlink ( combo box) it show options in the combobox to select.
The idea is that I want combo box control to display as a plain text ( more readable form).
If anybody created this type of sytle please let me know.
...
Hi,
I have a databinding problem in WPF.
I would like to "customise" a slider in a way that the thumb grows when you move the slider to the right and the thumb shrinks when you move the slider to the left.
So I edited the template for the slider and changed the look of the slider so the slider looks like I want it to.
But now I have ...
hello,
Can anyone tell me the difference between DataGrid(not GridView) and Grid controls in wpf?
Thanks
...
I have added the dependency property MyList to a wpf textbox. The dependency property is of type List<string>. In order to make things easier in xaml I have defined a converter so that I can have following syntax:
<Grid>
<controls:MyTextBox x:Name="Hello" MyList="One,Two" Text="Hello" />
</Grid>
In Visual Studio I can't edit the...
I have a GroupBox that contains a stackpanel holding a textbox and a datagrid. When I use the textbox to populate the datagrid. Sometimes I need to load the datagrid with values. What I am noticing is that when the groupbox renders when the datagrid has values that the height of the groupbox is maxed out to the size of its parent contain...
I've got a custom Button class, that always performs the same action when it gets clicked (opening a specific window). I'm adding a Click event that can be assigned in the button's XAML, like a regular button.
When it gets clicked, I want to execute the Click event handler if one has been assigned, otherwise I want to execute the defaul...
Grid related UI design question
I want some 16-grid (4 rows and 4 columns) user interface, and fill the grid with some round shapes. I also want to use the MouseOver, mouse left button down, and Mouse Left Button Up events to set the state of grids as selected or not selected.
My questions:
1. How fill the grid with some round shapes?...