I am using the following markup in WPF:
<StackPanel.Triggers>
<EventTrigger RoutedEvent="RadioButton.Checked" SourceName="xmlRadioButton">
<EventTrigger.Actions>
<BeginStoryboard Storyboard="{StaticResource ShowXmlPanel}"/>
</EventTrigger.Actions>
</EventTrigger>
<Event...
Greetings,
I have a problem with sorting ItemsViewSource in WPF. The problem is as follows:
My application has a listbox with items, there is a possibility to add new items to this listbox. I have ItemsViewSource which is of type CollectionViewSource and bouned to ObservableCollection as follows:
_ItemsViewSource.Source = Children;
W...
I have a brush that is part of a ResourceDictionary that is merged to Application.Resources.
But for some reason it's not resolved at runtime when a style is being applied to one of the controls. However, if I call Application.Current.FindResource("BrushName") from the Immediate Window at the time when exception is thrown, the resource ...
I need to have some generic colors in my application, which are based on the system colors, which change based on the active theme. So I believe I need some IValueConverters that each return a brush when given a system color brush.
But where do I put the logic? As I see it I might have 2 options.
Option 1) place SolidColorBrush(es) in ...
I am looking for a good way to simplify and organise a complicated WPF custom control.
My first thought is to factor it out into two simpler controls. For the sake of explanation I'll call these SimpleControl and AdvancedControl.
SimpleControl contains all the core functionality and is extremely reusable.
AdvancedControl depends u...
Hi,
I'm having following problem.
I should convert a control to a certain type, this can be multiple types
(for example a custom button or a custom label, ....)
Here's an example of what i would like to do:
private void ConvertToTypeAndUseCustomProperty(Control c)
{
Type type = c.getType();
((type) c).CustomPropertieOfControl...
Hi ,
i have implemented a treeview control on a buttonclick event like this:
namespace TaxonomyTreeview
{
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1 : Window
{
ObservableCollection<TaxonomyData> _TaxonomyCollection = new ObservableCollection<TaxonomyData>...
How to bind data to a combox column in a grid view in listview's view.
I have a Gridview in listview's view. Inside grid I have a grid column which contains a row of combo box.
How to bind data to this combo box using DataTable or DataSet?
Please help :-)
...
Hi.
We need to dynamically create (i.e. during runtime, via code-behind) UserControls and position them on a Canvas.
We want to bind the position (Canvas.Left and Canvas.Top) and width of those sizable (!) and draggable (!) UserControls to a ObservableCollection<>. That measn when the user drags or resizes the control, the datasource get...
I have a WPF textBox that is declared as ReadOnly
<TextBox IsReadOnly="True" IsTabStop="False" Width="200" />
So, User can not write anything into the TextBox or delete the content but it still allows user to drag the text from this textbox and drop it in any other textbox that caused the text removed from the first textbox(the read-o...
Hi everybody.
First of all, I've to admin that I'm absolutely new to WPF!
I think I've a problem with WPF Bindings or "PropertyChanged" notifications...
I have this XAML with a TextBlock and a listView
<StackPanel Orientation="Horizontal">
<TextBlock Margin="2" Name="UpdatesOperationResultcaption" Text="Operatio...
I want to retrieve the majority color in a background image in .NET. Is it possible?
...
I am creating a numeric TextBox in WPF, with two buttons to increase and decrease the value.
I have create two RoutedCommand to manage the behiavor and they are working well. There is only one problem that I would like to solve. I would like that the control notifies all object binded to its TextProperty when an increase or decrease com...
I have a bunch of different objects that are commonly edited in the same TabControl using different DataTemplates, but I want each DataTemplate to have a common look and feel with Ok and Cancel buttons at the bottom right of each tab that will close the tab or save the content and then close the currently selected tab. What's the best w...
Hi, I'm trying to set together a simple textbox with some watermark text in the background. My code is based on the example from Philip Patrick's blog.
I'm trying to tweak it so that the text displayed in the background is retrieved from the ToolTip property on the TextBox.
Currently this works:
<TextBox ToolTip="Type a name here...">...
In my WPF application there is a listbox with items. The listbox is populated via a xmldataprovider from XAML and then binding it to Itemssource property of the listbox.
Well, from XAML, I bind a comand to the listbox by doing:
<ListBox.CommandBindings>
<CommandBinding
...
Hi everyone !
I whant to apply a little storyboard to a collection of labels in my window.
My storyboard is like that :
<Storyboard x:Key="Storyboard1" AutoReverse="True" RepeatBehavior="Forever">
<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="label" Storyboard.TargetProperty="(Label.Foreground).(Soli...
I want my window to be on top of all other windows in my application only. If I set the TopMost property of a window, it becomes on top of all windows of all applications and I don't want that.
...
My ItemContainerStyle works perfectly when a ListViewItem is added:
<Style x:Key="ItemContStyle"
TargetType="{x:Type ListViewItem}">
<Style.Resources>
<SolidColorBrush x:Key="lossBrush"
Color="Red" />
<SolidColorBrush x:Key="newPartNo"
...
I've tried Google and I've tried Bing to no avail. Does anyone here have an idea on how to prevent partial items from appearing in a listbox in WPF? In case that does not make sense here is an example: Listbox is 200 pixels tall - each item is 35 pixels tall. That means I can show 5.7 items. 7/10 of an item is undesirable. I'd like...