Hi!
I have a problem when binding a command in a context menu on a usercontrol that is on a tab page.
The first time I use the menu (right-click on the tab) it works great, but if I switch tab the command will use the databound instance that was used the first time.
If I put a button that is bound to the command in the usercontrol it wo...
In the MSDN article Understanding Routed Events and Commands In WPF, it states
an event will bubble (propagate) up the visual tree from the source element until either it has been handled or it reaches the root element.
However, in this example, when you click the button, it doesn't "bubble up the visual tree" to get handled by the...
Hello
in my window I have buttons for load and save methods. I use CommandBinding and the save-button has a CanExecute property to keep the user from saving the data before it is loaded.
The CanExecute-Methode is connected to a simple bool value called "canSaveXML"
private void Save_CanExecute(object sender, CanExecuteRoutedEventArgs...
I am trying to measure an object immediately after changing the DataContext, but the binding for the object is not getting updated soon enough. Here's my code:
// In MeasureOverride(Size)
m_inputWidth = 0.0;
Size elemSize = new Size(double.PositiveInfinity, RowHeight);
MapElementView ruler = new MapElementView();
// Measure inputs
for...
I've got the following markup in a WPF UserControl:
<Border Name="_border" BorderThickness="4" BorderBrush="Blue">
<Canvas Name="_canvas" Background="Black" >
<DockPanel LastChildFill="True">
<ItemsControl Name="_itemsControl" Background="Bisque" AllowDrop="True" Height="100" Width="100"
Ho...
I've got an instance of an object bound in XAML. It's got a method that will return to me a list of other objects (based on the property value I pass this method, it will return all the objects with that property value).
<ObjectDataProvider ObjectInstance="_this.DataContext" MethodName="GetListByCategory" x:Key="List">
<ObjectDa...
I have a Border inside a Canvas. The Border's height/width are varying according to its contents. I want the Border to stretch out to fill up the entire Canvas. How can I do that?
I have tried this on the Border without success:
Height="{Binding ElementName=MainCanvas, Path=Height}"
Width="{Binding ElementName=MainCanvas, Path=Width}"...
Update
After a bit of investigating. What seems to be the issue is that the SelectedValue/SelectedItem is occurring before the Item source is finished loading. If I sit in a break point and weight a few seconds it works as expected. Don't know how I'm going to get around this one.
End Update
I have an application using in WPF using...
Assuming two projects, a WinForms project and a WPF project, in the WinForms project there is no problem with the following code being in Main() and removing the Application.Run:
while (true)
{
Thread.Sleep(1000);
Form1 window = new Form1();
window.Show();
Thread.Sleep(1000...
How can I avoid TextBox vertical streching in following example:
<StackPanel Orientation="Horizontal">
<Button Height="40">OK</Button>
<TextBox Width="200"></TextBox>
</StackPanel>
...
I'm new to WPF/XAML & I'm just doing a training exercise at the moment.
I've got a noddy application and I want to change the size of the text in a tag based on the position of a scroll bar.
The text is defined by this code:
<FlowDocumentScrollViewer Grid.Row="1">
<FlowDocument>
<Paragraph>
Text goes here
...
If I set TreeViewItem Background it highlights the header only. How can I highlight the whole line?
I have found a post almost solving a problem http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/b04f73e2-0b10-4d97-a6da-64df2e30c21d/
But there are some problems:
1. It does not highlight the whole line
2. The tree has XP style on...
How it can be done in C#?
...
Hi,
I am using two listbox controls in my wpf window that are identical (identical = itemsource of both the listbox is same and so they look same) and the selection mode on both the listboxes is set to Multiple.
Lets call the listboxes LB1 and LB2 for the time being, now when I click an item in LB1, I want the same item in LB2 to get se...
In short: I want to define what XML ButtonSettings element to use for a XAML-Button, and to use the childs of the selected ButtonSettings-element in a style applied to that Button.
Is this possible?
A sample of the XML:
<Buttons>
<ButtonSettings ID="Bye">
<Text lang="NL">Doei!</Text>
<Text lang="DE">Tsusch!</Text>
<Tex...
I have a collection of Visuals in a ListBox. I need to find the XPosition of an element inside it and then animate the HorizontalOffset of the ListBox's ScrollViewer. Essentially I want to created an animated ScrollIntoView method.
This gives me a couple of problems. Firstly, how can I get a reference to the ListBoxs scrollviewer? Se...
I have a XBAP application with the following user control:
<UserControl x:Class="XXX.UsersGrid"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="Auto" Width="Auto">
<UserControl.Resources>
<DataTemplate x:Key="U...
Silverlight 3.0 beta has just been announced at Microsofts Mix Conference in Las Vegas.
Two features of the new beta are 3D-graphics and the ability to run applications outside of the browser, which to me seemed to be two of the major features that WPF (Windows Presentation Foundation) previously offered over silverlight.
I am currentl...
What is the difference between a stackpanel and a virtualizingstackpanel in WPF?
...
I have two ListBoxes, both use Extended SelectionMode. The ItemsSource of the first is a List, and uses a datatemplate. I'm trying to use an aggregation of some property from the first as the itemssource for the second. For example:
public class MultiAppPropertyAggregator : IValueConverter {
public object Convert(object value, T...