I'm trying to bind a datagrid to data from within a collection of a collection of the datacontext. The result should be as though all of the nested collections were just one collection with the parent collection properties still available.
For example
I have a series of products associated to an order and each product can have multipl...
Hello,
So if I created a silverlight app, can I take the markup + code and put it in a WPF app? I was just curious if we decide to use silverlight, whether I could also take advantage of WPF windows clients too.
Thanks.
...
I have a TabControl that can be rearranged by dragging/dropping the tabs. The current process removes an item from the list and adds it to a new location. I had some performance issues switching tabs because of how complex the tabs are, so found an alternative which stores the rendered tabs and reloads them when requested. My only proble...
The CompositionTarget.Rendering event is a plain old EventHandler, with a plain old EventArgs. However, in real life, it apparently always gets an instance of RenderingEventArgs. So your event handler has to start by casting the EventArgs in order to get the useful information out of them.
Why isn't the event of type EventHandler<Render...
ERROR: "Cannot modify the logical children for this node at this time because a tree walk is in progress." I call the Chart.Load() sub on the Load of my main form. I know that this has been asked before but I cannot for the life of me get this to work. I need the chart series to update if the underlying data changes, if there is anoth...
Hi,
suppose the following classes:
public class Model
{
public ObservableCollection<A> Items { get; set; }
}
public class A
{
ObservableCollection<B> Data { get; set; }
//... some more properties
}
public class B
{
//..properties
}
The model is bound to a RibbonMenu and should also be used in a context menu. The co...
Hi,
I have two TextBoxes and I want to bind between their Visibility property in run time,
The binding works when I add the TextBoxes by Xaml but doesn't work when I add them programmatically,
Any help !!
public partial class Window1 : Window
{
TextBox txt1 = new TextBox();
TextBox txt2 = new TextBox();
...
I wanted to do a quick user control for my app, but to keep things in a MVVM style I thought I'd set the DataContext of the XAML to the code behind in my UserControl.
i.e.
DataContext="{Binding RelativeSource={RelativeSource Self}}"
This allows me to bind the XAML to properties in my code behind.
Everything went well until I came to...
I have some trivial code that looks like this:
SortedDictionary<String, long> d = new SortedDictionary<String, long>();
// d is then populated with an expensive time-consuming process
ListBox lb = new ListBox();
lb.ItemsSource = d; // THIS WORKS GREAT
Now what I'd like to do is dynamically show a ...
Ok, I recently implemented a background worker to perform saves and loading of data.
However getting this to work on a save command has proved difficult.
Basically my Save command generates an event that notifies a collection view model that an Item has been added and that It should add it to its own observeablecollection. At this poi...
Using the WPF DataGrid I have the need to change various display and related properties of a DataGridCell - such as Foreground, FontStyle, IsEnabled and so on - based on the relevant value of the cell object property.
Now this is easy to do in code, for example (using an Observable Collection of ObservableDictionaries):
var b = new...
My scenario: I have a background thread that polls for changes and periodically updates a WPF DataGrid's ObservableCollection (MVVM-style). The user can click on a row in the DataGrid and bring up the "details" of that row in an adjacent UserControl on the same main view.
When the background thread has updates, it cycles through the ob...
How can the string literal - "ErrorLabel" be replaced with string variable style in the second line ? FYI ..The style names will be stored in a xml file.
string style = "ErrorLabel";
Style styItem = LayoutRoot.Resources["ErrorLabel"] as Style;
fld.Settings.CellValuePresenterStyle = styItem;
...
I'm writing a research app that will allow users to draw a function by hand and dump the coordinates to a file for use in another application. I've been playing around with this sample for drawing: http://blogs.msdn.com/b/expression/archive/2008/02/02/a-small-inkcanvas-sample.aspx
I've hit a wall trying to figure out how to restrict use...
I am working with Orbifold G2: http://www.orbifold.net/default/?page_id=2164 and I am having trouble with the DiagramControl because its scrolling is infinite. Does any body know how to avoid this and set the scroll not infinite?
...
I need WPF component (beter if it will be free) for easy drawing such process graphics like on the image. Can you give an advice what to use? Thanks.
http://img842.imageshack.us/img842/3444/40560107.png
...
I am working on WPF.
I am using visual studio 2010, .NET 4.0 and using a Radcombobox in my application.
It is getting populated correctly with 3 strings in it and now I am having trouble choosing a default value. I want to select the first index value as the default value when it starts up loading the 3 strings in the combo box drop dow...
Hi
As per the title really, how can you set a dependency property in XAML when the base class is generic? When trying to do this I get a NullReferenceException, setting the property from code behind works fine. It also works when the base class is not generic.
I'm using .NET4
Here is some sample code to demonstrate:
WindowBase.cs
usi...
I have a grid with two rows.
In the first row, I have a rectangle, fixed width and height, whose fill is a VisualBrush whose Visual binds to a tabcontrol's selecteditem.content, which resides in the grid's second row.
All works well - the rectangle displays a scaled down version of the SelectedItem's content in the TabControl. The pro...
Hi there,
the problem is as follows:
I have got a rendered bitmap in a byte array (together with the bitmap header). Now I want to manipulate the content of a bitmap. For that purpose I need to wrap this array with some high-level class, say BitmapImage . I want to avoid copying the array, or its data part etc. I want just to force .N...