So, lets say I have two nearly identical classes in C# and Ruby:
C#
public class Test
{
public Test()
{
ImageLocation = "http://www.ironruby.net/@api/deki/site/logo.png";
}
public string ImageLocation { get; set; }
}
Ruby
class Test
attr_accessor :ImageLocation
def initialize
@ImageLocation = ...
I am using a datagrid with a combox that should change the grouping field. I am using the following xaml to define the general grouping template :
<DataGrid.GroupStyle>
<GroupStyle>
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Template">
...
Afternoon all,
I am attempting to filter a WPF Listbox control which is bound to a collection of Entity Framework objects.
I am running into a problem which I cannot find much help on:
Firstly I am creating a BindingListCollectionView and then set its DefaultView to my collection of entity objects db.Users.
BindingListCollectionView...
We have a very large project. The Visual Studio debug output log contains several repeating WPF binding errors.
For example:
System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='NaN' BindingExpression:Path=Width; DataItem='ContentPresenter' (Name=''); target element is 'ContentP...
I have some problem to access the Window's DataContext from within a DataGrid.
The DataGrid is bound to a IBindingList:
public IBindingList Items{ get; set; }
private void initItems()
{
//ItemFactory is a Linq2SQL Context, Items is the view of availabe Items
this.Items = this.ItemFactory.Items.GetNewBindingList...
I have to generate a contextMenu. it is diferent depending of which column is selected.
the number of columns is diferent any time.
I have this code
<Grid x:Name="LayoutRoot" Background="White">
<ListView Name="myListview" ItemContainerStyle="{StaticResource style1}" DockPanel.Dock="Left" ItemsSource="{Binding lsts}" >
</ListV...
Today I faced a problem which reminded me of bindings being detached automatically in some cases. I am not sure but here is the scenario -
I attach a menu item bound to a property(implementing INotifyPropertyChanged), like this -
IsChecked="{Binding Path=DisplayLongUnit, Mode=TwoWay}"
Now in its checked event hander I update its IsC...
I want a 1-time databind between a checkbox (IsChecked propety) in a childWindow and a nested member variable in it's DataContext object, such that only the initial IsChecked property is set by the member variable. The member variable (binding source) is not INotifyPropertyChanged or marked as a DependencyProperty- but I think that is ok...
My ViewModel has a property called Commands which is of type IDictionary.
For my data grid I have created a ControlTemplate for one of the fields using a button as follows:
<ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
<Button Style="{DynamicResource btnRemove}" Width="14" Height="14"
...
Hi,
I want to begin a storyboard, every time my Image source changes.
I have implemented INotifyPropertyChanged.
Can anyone help me achieve this?
Thanks,
<Image Name="pic" HorizontalAlignment="Center" VerticalAlignment="Center" Source="{Binding ElementName=uc, Path=Image}">
<Image.Resources>
<Storyboard x:Key="pic...
I've got a data template for a list box item similar to the one on this page...
link
I would like to take it a step further and do something to highlight the items when they change. For example, using the code in the link above, I would like to put a trigger to do something when Widget.Quantity changes. Maybe make the quiantity item (no...
I'm binding a ListView to a list of objects, like so;
<ListView
ItemsSource="{ Binding Path=. }"
ItemTemplate="{DynamicResource EventTemplate}">
I'm binding to an object which declares two properties;
string DisplayName { get; }
System.Drawing.Image Image { get; set; }
I want to populate a DataTemplate but I can't figur...
I'm attempting to databind a gradient brush as a Rectangle fill. What do I need to do to get the commented-out binding to work? StartColor and EndColor are declared as System.Drawing.Color.
<Rectangle Width="100" Height="20">
<Rectangle.Fill>
<LinearGradientBrush>
<GradientStop Offset="0" Color="Pink"/>
<GradientStop ...
I have a couple of TextBlocks, bound to different things. Both TextBlocks have the same style applied. In the style there is an eventtrigger which flashes the text when the bound value updates. All works great however when the value for one textblock updates, both textblocks flash. I was expecting just one TextBlock to flash. Any ideas?
...
I have very simple scenario ,
I have WPF Combo , i am using MVVM , i am assigning a datatable as a datasource to this WPF combo, i am able to assign , able to view data but not sure how to get the selecteditem in my viewmodel layer, i dont want to pollute my UI codebehind .
Thanks in advance for your help
...
Hello everyone - I've got a simple problem in my WPF application which has me banging my head on the table. I have a TabControl, where every TabItem is a View generated for a ViewModel using a DataTemplate similar to this:
<DataTemplate DataType="{x:Type vm:FooViewModel}">
<vw:FooView/>
</DataTemplate>
FooView contains a ComboBox:...
Hi, I'm trying to set the selected value of my Font Family combobox, which has been populated with the following XAML:
<ComboBox ItemsSource="{x:Static Fonts.SystemFontFamilies}" Name="cboFont">
<ComboBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel MinWidth="256" />
</ItemsPanelTemplate>
...
EDIT: I rephrased the entire question.
Hello everybody,
I have a custom control with dependency properties. In the Generic.xaml file I have a resource dictionary. It's a resource dictionary within the outer dictionary, defined like so:
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http...
The summary of my problem: I had created a UserControl where I bound my dependency property "Scheme" to the Color property of a GradientStop, and it worked perfectly. Now, after converting my UserControl to a custom control, this binding no longer works, and I don't know why.
EDIT:
Replication of Custom Control Problem: http://www.mega...
I thought a simple problem like this should be no-brainer but after hours of searching I'm still not able to fix this one.
I'm probably not thinking the WPF way because it looks I'm the only one on internet with this problem :)
Here's the problem.
I'm having a fairly simple listview with a datatemplate (leaving some none-relevant code o...