binding

SelectedValue explicit binding updates when ItemsSource change..why?

萝らか妹 提交于 2019-12-24 02:49:07
问题 I have a ListBox with an Explicit binding set to SelectedValue. SelectedValue="{Binding Path=Property, UpdateSourceTrigger=Explicit}" the ItemSource of ListBox is an ObservableCollection. When I select an item of ListBox and press 'Enter' I update the property value in this way: BindingExpression be = listBox.GetBindingExpression(ListBox.SelectedValueProperty); be.UpdateSource(); Now, I have this problem: I have to reset the ItemsSource of ListBox by specific action on my window and when call

Making a DataGridView column editable after binding it to a BindingList<T>

廉价感情. 提交于 2019-12-24 02:38:12
问题 I have a DataGridView and I'm binding it to a BindingList<KeyValuePair<string, float>> . Here's the relevant part of the code: dgv.AutoGenerateColumns = false; DataGridViewTextBoxColumn firstColumn = new DataGridViewTextBoxColumn(); firstColumn.DataPropertyName = "Key"; firstColumn.HeaderText = "First Column"; DataGridViewTextBoxColumn secondColumn = new DataGridViewTextBoxColumn(); secondColumn.DataPropertyName = "Value"; secondColumn.HeaderText = "Second Column"; secondColumn.ReadOnly =

WPF: Binding an Element in a DataGridTemplateColumn to an Element in another DataGridTemplateColumn

試著忘記壹切 提交于 2019-12-24 02:12:06
问题 :) I have one DataGrid. In Column2 there is "ComboBox1", in Column3 there is "ComboBox2". I would like to set IsEnabled to false on "ComboBox2" as long as "ComboBox1" has SelectedIndex=0. For each row seperately. This works perfectly outside the Datagrid with two ComboBoxes (with the help of Style and DataTrigger). However, inside the Datagrid, within Column3 I cannot "see" "ComboBox1" ("Cannot find source for binding..."). It's basically a namescope issue. However, referring to a Combobox

EmberJS - Manually bind controller to view

久未见 提交于 2019-12-24 01:59:13
问题 Lately EmberJS changed a lot (Router, ...) and the code I have started to write less than a month ago is now broken. One of the issue I have right now is I am not able to manually bind the controller to the view. I am using requireJS by the way... So I used to the able to do something like this (here to define the view for my menu and the menu items), to actually get the Controller content and selected properties. define ( 'app/common/views/menu', [ 'text!app/common/templates/menu.hbs',

How to bind a single object instance in WPF?

冷暖自知 提交于 2019-12-24 01:44:20
问题 I am a WPF newcomer, and I've been searching for two days with no luck. I have a WPF window that has several text box controls, and a single object with some properties. This object is passed to the codebehind of my WPF window in it's constructor: public partial class SettingsDialog : Window { public SettingsObject AppSettings { get; set; } public SettingsDialog(SettingsObject settings) { this.AppSettings = settings; InitializeComponent(); } } The SettingsObject looks something like this

My c# ComboBox does not call the getter after selecting an item. Why?

懵懂的女人 提交于 2019-12-24 01:39:59
问题 I have an Combobox with SelectedItem. If I select an item my setter does some calculation and perhaps I want to reset the value to the old one. Unfortunatly my view does no refresh. I have the following ComboBox : <ComboBox BorderThickness="0" VerticalAlignment="Center" Margin="2,0" DisplayMemberPath="Name" ItemsSource="{Binding ItemsVS.View}" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" > </ComboBox> Here are the properties of my ViewModel: private CollectionViewSource _itemsVS; public

Binding from resources inside a DataTemplate

假装没事ソ 提交于 2019-12-24 01:04:53
问题 Is there some way to get the DataContext of a DataTemplate to use in bindings within its resources? <DataTemplate x:Key="History"> <ItemsControl ItemsSource="{Binding History}"> <ItemsControl.Resources> <app:BitmapProvider x:Key="Converter" ShowDetails="True" Type="{Binding Model.Type}" /> </ItemsControl.Resources> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal" IsItemsHost="True"/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate

Binding Color Value for coloranimation

会有一股神秘感。 提交于 2019-12-24 00:57:09
问题 I have a Border, and i'm trying to to make it's BorderBrush Flashes "Fade in and out". But my problem, is that the Flasing color depends on the code behind. so the color will change, but i have to keep the fade in/out forever, with changing the "From" color of this Border. I tried in two ways: 1: binding the color directly, but then i know that there's a freezing thing the is needed to be applied on the color: <Border Grid.Column="1" Grid.Row="2" Name="ActiveBorder" VerticalAlignment="Stretch

How can i Bind the Length of a Textbox to a Textblock?

独自空忆成欢 提交于 2019-12-24 00:46:47
问题 I need an help to bind some things on wpf. I have this column of textboxes, whitch show the value of a property in the Datagrid. <DataGridTemplateColumn Header="Value" Width="150"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBox Width="150" Name="PropertyTextBox" Text="{Binding Path=Property.Value.Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding Path=Property, Converter={StaticResource isSimpleJPropertyConverter}, Mode=OneWay}" /> </DataTemplate> <

MvvmCross Android - Alternative to RelativeSource binding for button command

♀尐吖头ヾ 提交于 2019-12-24 00:37:40
问题 I have a list of items bound to a MvxBindableListView with a MvxItemTemplate. I usually have 4 items in my list bound to my view. Data gets updated and the view displays the new data just fine . Now, I want to add two buttons to this item template. However, relative source binding is not available with MvvmCross. (see image) But I'm having difficulties working out a solution to this. I have tried the ItemClick binding of the list item, but that only gives me 1 possibility of click and I need