binding

Binding DependencyProperty in nested user controls

二次信任 提交于 2019-12-11 20:10:00
问题 I've this problem: I've made 2 user controls: NestedControl1 and NestedControl2. NestedControl2 contains NestedControl1, and NestedControl1 contains just a TextBlock. I've set each NestedControl* DataContext to Self, and created a dependency property for each one. NestedControl1.MyText1 and NestedControl2.MyText2. Then I've bound the NestedControl2.MyText1 to MyText2, and the TextBlock.Text to MyText1 . If I use the NestedControl2 on a Window and set MyText2 to whatever, it does not work.

DataGrid reverts the values back to original when leaving row

限于喜欢 提交于 2019-12-11 19:54:45
问题 For some reason, when I updated values in a DataGrid, they are not persisted in the in-memory object? In fact, during editing of cells the new values are displayed, but as soon as I tab onto the next row, the values revert back. Here's my DataGrid definition: <DataGrid ItemsSource="{Binding Items, Mode=TwoWay}" IsSynchronizedWithCurrentItem="True" AutoGenerateColumns="False"> <DataGrid.Columns> <DataGridTextColumn Header="Position X" Binding="{Binding Position.X, Mode=TwoWay}"/>

WordprocessingMLPackage.save not saving bindings - Docx4j

元气小坏坏 提交于 2019-12-11 19:49:43
问题 I am trying to set text/images to content controls in a docx. BindingHandler.applyBindings seems to apply the bindings to the main doc part. I can see the value being changed on debug. But when I save it using WordprocessingMLPackage.save or Docx4J.save, I dont see the newly bound text/image in the output document. What could possibly be the reason? 来源: https://stackoverflow.com/questions/22869070/wordprocessingmlpackage-save-not-saving-bindings-docx4j

Why isn't my selected item's data binding updating?

我是研究僧i 提交于 2019-12-11 19:47:08
问题 The code below creates two list boxes. When an item in the first list box is selected, I am trying to select the corresponding item in the second list box when there is a match between NameOne and NameTwo. However, it does not select my item in the second list box. Why is that? XAML: <Window x:Class="ListBoxTesting.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525">

Modal unbind on fade

荒凉一梦 提交于 2019-12-11 19:24:32
问题 This is version of a previously asked question (Modal windows and binding/unbinding). I have a form and when "Add New" is selected a modal window appears in which text can be typed in a field to add to the dropdown. This can happen for 8 or 9 fields. The bug is that if the user dismisses the modal by clicking either on the "X" or on the dark space around the box and then selected "Add New" again and clicks the "Add" button, the modal is still bound to the event (I guess) and so there is a

WPF ColorPicker from wpf/xaml/toolkit binding to property error

自闭症网瘾萝莉.ら 提交于 2019-12-11 19:10:16
问题 I've got some code with colorpicker: <xctk:ColorPicker Grid.Row ="10" Grid.ColumnSpan="2" Margin="5, 5, 5, 5" Height="30" DisplayColorAndName="True" SelectedColor="{Binding SelectedItem.TransparentColor, ElementName=ItemsListBox, Converter={StaticResource BrushColorConverter}, Mode=TwoWay}"/> This stuff works when is Binded to ElementName=Window and Path=Background, but when I'm creating object with property System.Windows.Media.Color, it shows Value produced by BindingExpression is not valid

SwiftUI Bindings with a Singleton?

痞子三分冷 提交于 2019-12-11 19:10:03
问题 I have a singleton that stores all my form values. I then have a service that combines all the set values to make a query on a database. I want to create reusable RangeSlider views. It's bindings are: @Binding var operatorValueString:String @Binding var initialValue:Double @Binding var lowerBound:Double @Binding var upperBound:Double @Binding var returnValue:Double I have a Singleton. S.i.value1OperatorValueString S.i.value2OperatorValueString How can I bind the singleton to the binding above

Binding value as ConverterParameter

て烟熏妆下的殇ゞ 提交于 2019-12-11 18:59:51
问题 In my resourceDictionary I have a following style: <Style TargetType="{x:Type propgrid:PropertyGridDataAccessorItem}" x:Key="{x:Type propgrid:PropertyGridDataAccessorItem}"> <Style.Triggers> <Trigger Property="DataAccessorType" Value="Category"> <Setter Property="IsExpanded" Value="{Binding DisplayName, Converter={local:ExpandedCategoryConverter}}"/> </Trigger> </Style.Triggers> </Style> I need to bind a value from my viewModel to ConverterParameter, something like ConverterParameter =

WPF Ribbon Contextual Tab Visibility binding

亡梦爱人 提交于 2019-12-11 18:56:56
问题 I am finding it surprisingly hard to find examples of binding the visibility of a RibbonContextualTabGroup. I have a property in my code-behind that should decide when to display a ribbon tab, but everything I've tried so far has no effect. My code-behind is essentially: public partial class MainWindow : RibbonWindow { public string Port { get; set; } } A summary of my WPF code is below. I'm looking for a solution that binds the Visibility property to whether or not MainWindow.Port is null .

WPF DataBinding Issues - Possible Noob Problems

旧巷老猫 提交于 2019-12-11 18:45:38
问题 I am trying to bind a ViewModel property of type Visibility to the visibility property on a Dock Panel: Updated ViewModel Code : public class SelectWaferButtonViewModel : INotifyPropertyChanged { private bool isClicked; public SelectWaferButtonViewModel() { isClicked = false; } public bool IsControlVisible { get { return isClicked; } set { isClicked = value; OnPropertyChanged("IsControlVisible"); } } public event PropertyChangedEventHandler PropertyChanged; public void OnButtonClick() { if