I have an MVVM application. In one of the ViewModels is the 'FindFilesCommand' which populates an ObservableCollection. I then implement a 'RemoveFilesCommand' in the same ViewModel. This command then brings up a window to get some more user input.
Where/what is the best way to do this whilst keeping with the MVVM paradigm? Someho...
Hi,
I am working with binding an xml structure to a listbox. I am quite confused hoe to do this.How to put a datatemplate inside a datatemplate or i need to use a hirarchialdatatemplate...for example from the xml, I want to display the Make Name of the cars in a list box and i want to show the corresponding Suvs's as a tooltip or context...
This is a bit of a noob question but I've just realised that if i create a UserControl and choose to name some of its child elements a la -
<UserControl x:Class="UserControls.uControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="300" Width="300">
<Grid...
I'm sure I am missing some of the basics here so please bear with me.
I have a two objects, a SalesOrder and a SalesOrderLineItem. The lineitems are kept in an Observablecollection<SalesOrderLineItem> of SalesOrder, and if I add line items my databound listView knows about the new items.
Now where I am having a problem is here: The Sal...
I have a WinForms usercontrol hosting a WPF custom Listbox in it. After the WinForms user control gets disabled and then re-enabled the WPF control in the WinForms usercontrol is unresponsive. Has anyone else experienced this?
We had to hack a soultion into remove and re-add the element host each time the control gets disable / enable...
I'm trying to figure out how to read from the standard input stream of my own WPF application but I can't find a way to get the stream. The standard way to do it,
Console.ReadLine()
returns Null(Nothing) immediately. I'm assuming because it's not a console application and no console window is open. How can I read from standard input ...
<ProgressBar Foreground="Red"
Background="Transparent"
Value="{Binding NumFailed, Mode=OneWay}"
Minimum="0"
Maximum="{Binding NumTubes, Mode=OneWay, Converter={x:Static wpftools:DebuggingConverter.Instance}, ConverterParameter=Failedprogressbar}"
FlowDirection="RightToLeft"...
I have a listview control that is bound to an observable collection that I frequently update. When I update the collection, I clear the collection and then add the values. While this is a bit overkill for simple changes, it's very simple and accomplishes the job. In doing so, I lose which item was selected in my listview control and cann...
I'm doing some Drag and Drop operations, and I want to use a visual copy of the element I'm dragging for the cursor. It's easy enough to get a VisualBrush of the element, but I have no idea how to turn this into a cursor.
I've read the Jamie Rodriguez blog posts, but his solution isn't quite what I'm looking for because he essentially ...
I want to apply a format (align text, format for the currency 0000.00) to the columns in the GridViewColumn.
<GridViewColumn TextBlock.TextAlignment="Center" Width="80" DisplayMemberBinding="{Binding XPath=Name}"/>
The idea is the following one: In the columns (GridViewColumn) the text that our could apply a format to him (Aligners o...
I've got a xaml TabControl and on one page, there are 3 RadioButtons each bound to a different property on the selected value of an adjacent ListView. After switching between selected items in the ListView, my radio buttons seem to forget they're bound and don't refresh.
So watching it in the debugger, when I switch to a new selected it...
Have I missed something with WPF (and Windows Forms before it) in regards to the need to write a lot of repetitive code when developing multi-threaded applications. Every UI control in the application ends up needing extra lines of code to get and set each property.
internal delegate void SetElementIsEnabledDelegate(UIElement element, b...
I have a class with an indexer property, with a string key:
public class IndexerProvider {
public object this[string key] {
get
{
return ...
}
set
{
...
}
}
...
}
I bind to an instance of this class in WPF, using indexer notation:
<TextBox Text="{Bin...
We have built a XBAP application and have given the access keys (keyboard shortcuts) on labels/buttons. But IE seems to capture the access key first and hence the application does not get a chance to handle the access keys.
Is there any workaround/solution so that XBAP application overrides the access key of IE?
...
What is the most minimal way to dynamically interchange UIElements at a certian "slot" on the UI? I have a number of UIElements and based on some external databinding (e.g. a combobox selection) I want one of them to be shown and the one that was currently visible to be hidden. So the behavior is sort of like the tabcontrol but without t...
I know that in XAML/WPF, I can set the Window size using the Width and Height properties, but suppose I want to set the window size such that the client area (minus the Windows borders/decorations) will be a certain fixed size, what is the easiest way to do that?
Like, suppose I want the client area of the window to be 640x480, ala this...
Assuming we have such control:
public partial class MyUserControl : UserControl
{
public MyUserControl() {
InitializeComponent();
}
public string Foo { get; set; }
}
How can I set "Foo" property value declaratively in MyUserControl.xaml?
<UserControl x:Class="Test.MyUserControl"
xmlns="http://schemas.microsof...
I'm trying to bind to a Readonly property with OneWayToSource as mode, but it seems this cannot be done in XAML:
<controls:FlagThingy IsModified="{Binding FlagIsModified,
ElementName=container,
Mode=OneWayToSource}" />
I get:
The property 'FlagT...
I have a wpf datagrid (the one from the wpf toolkit), which when there are too many rows to view on the screen it gets a vertical scroll bar. What I would like to know is if there is a way to know what the top visible row is when the user is scrolling. Ideally I would like to be able to wire up to an event to know when the user is scro...
I am brand new in the world of Wpf, and am thinking it's time to get into it for my next project.
I'm a hardcore Winforms guy. Many of my projects perform tons of custom drawing - for example drawing a virtual baseball strike zone and then drawing icons to represent pitches thrown by a pitcher or seen by a batter. The pitches are in...