When I use a ListBox - the elements inside are of type ListBoxItem, for ComboBox they are ComboBoxItems. What type are they for an ItemsControl? I've been digging through Blend's templates to no avail.
I wish to create a new ControlTemplate for the items inside the ItemsControl.
To clarify with code:
EDIT: Figured out the type as show...
I have a WPF UserControl that contains a ComboBox. I need to attach an event listener to the ComboBox.Items collection.
public MyUserControl()
{
InitializeComponent();
((INotifyCollectionChanged)comboBox.Items).CollectionChanged +=
ComboBoxItemsChanged;
}
But I cant seem to figure out how to detach it. Or is that han...
I have a problem with a solution that I'm trying to develope. This is my scenario:
I have a VB6 application and I would call from this application some WPF windows. I've used the Interop Form Library to define a WinForm like a bridge from VB6 to WPF. The Interop WinForm exposes the methods to start and shutdown the wpf application.
To d...
Greetings,
Is there any way to create something like automatic combobox switcher in WPF? The case is that I want to add some links to combobox and these links should automatically changed after, let's say 10sek. Something like dynamic advertisements or combobox links rotator. Is there any way to achieve something like that ?
EDIT: To b...
<DataGrid ItemsSource="{Binding}" AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridTextColumn Header="First Name" Binding="{Binding FirstName}" />
</DataGrid.Columns>
</DataGrid>
In the above snippet the DataGrid columns are hard coded in the XAML.
Is it possible to have the column definitions be defined elsewhere, ide...
I have code like this
<GridViewColumn Header="Status" Width="75" DisplayMemberBinding="{Binding Path=TimesheetStatus}"/>
<GridViewColumn Header="Reviewed?" Width="70">
<GridViewColumn.CellTemplate>
<DataTemplate>
<CheckBox Margin="1,2,1,0" IsEnabled="{Binding Path=EnableReview}" IsChecked="{Bi...
I have settings dialog with a number of ComboBoxes. More often than not, these ComboBoxes will only have one selectable value. So to make the dialog easier to use I want the ComboBox to autoselect the single value if, and only if, Items.Count == 1 && SelectedItem == null.
I found this but dont want to add additional dependencies if I ca...
This is probably a simple question but i've been unable to find a quick answer.
I have a WPF application which has a Windows Forms Control hosting a GeckoFX component (doesn't really matter).
What i want to do is capture key down events inside the Windows Forms Control and grab focus of a WPF control for some particular key combination...
Hi, I'm binding an Image control to a value set at runtime, but I want to set the FallbackValue to a resource named "checkerboard.png".
As Converters aren't applied to FallbackValues I need to use the Pack notation, which leaves me with the following XAML:
<Image x:Name="imgButton"
Height="{Binding Path=Height}"
Width="{Bindi...
Gentlemen,
I have a button bounded on Validation.HasError property of a textblock. The textblock has a validation rule that checks the value entered by user. The purpose of the binding is that the button should be disabled if the user enters a wrong data.
The problem is that the ValidationRule executes AFTER the binding. So when the u...
I have a got a small issue with the wpf project I am currently working on. I am new to WPF. In my app.xaml I am using the Microsoft Aero theme for my application. I have got something like this in my app.xaml
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/PresentationFramew...
I am trying to use MVVM in my WPF application which displays data from a class in the business logic layer called 'Employee' with a property 'Salary'. I have a simple XAML window with a text box with binding to the Salary property in a ViewModel class 'EmployeeViewModel'. The ViewModel implements INotifyPropertyChanged so that when the ...
Hey all...
I was building a quick mock-up of a WeakEventManager/Listener using buttons but after two clicks, the StopListening event is getting fired and I'm not quite sure why.
Essentially, the Manager is listening for Click events. My listener gets instantiated in the Window1_Initialized event
Application.Current.Properties.Add("Eve...
Hi everyone
I have a TreeView with a given width. When I add a node with a name which makes it exceed the maximal TreeView width it displays a vertical scrollbar.
I'd prefer to display only the beginning of the name followed by '...' to avoid the scrollbar. I tried googleing it but I fail to find a result.
Could someone tell me how it...
i have a listview that is bound to a datatable(not using any custom object to represent the fetched data). How do i create a view so that i can filter,sort the collection. (i tried google and the samples i found were using objects(eg:product) to create views)
sample code:
Private Sub ShowOnlyBargainsFilter(ByVal sender As Object, ByVa...
In order to create a screen shot, I am hiding a wpf window. The code looks like that.
Hide();
var fullScreenshot = _cropper.TakeFullScreenshot();
Show();
Sometimes the Application is not hidden when the screen shot is taken. How can I can I identify, that the window is completely hidden?
...
how could i implement autosave in C#? i felt that saving to the currently open file is a simple but i may not want to overwrite my previous file (or should i just do that? i think google docs saves/overwrite the document tho they have version control?). i thought of saving to another file, but where do i save to?
also i guess i will ha...
OK I have a weird one here. What I am trying to figure out is how to have one listview, populated by an ObservableCollection, update another ListView, populated by another ObservableCollection, based on the first listview's selection and then use a valueconverter to check or uncheck a checkbox based on the selection combined with the cur...
Hi, i've got following problem:
i have to display tabular data in some kind of grid.
Say class A is a data item, with properties Foo and Bar, and i have a list of items List or sth like this. i want to display these items in a grid, where items with same Foo are in one column, and items with same Bar in one row. basic. simple. i thoug...
Good day,
I have a class ShipmentsCollection that inherits ObservableCollection which contains shipment objects (entities). This is displayed in a listbox on my ShipmentsView UserControl. My intent is to allow a user to type into a textbox above the list and filter the list with items that contain that string, as well as filter based ...