binding

Error when trying to bind the value of a setter

我只是一个虾纸丫 提交于 2019-12-24 14:28:31
问题 I have the following XAML: <ListBox.ItemsPanel> <ItemsPanelTemplate> <Grid> <Grid.RowDefinitions> ... </Grid.RowDefinitions> <Grid.ColumnDefinitions> ... </Grid.ColumnDefinitions> </Grid> </ItemsPanelTemplate> </ListBox.ItemsPanel> ... <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <Setter Property="Grid.Row" Value="{Binding Row, Mode=OneWay}" /> <Setter Property="Grid.Column" Value="{Binding Column, Mode=OneWay}" /> </Style> </ListBox.ItemContainerStyle> ... When the page

How do I write this ItemsControl so WPF will use bindings to generate columns for the output grid

☆樱花仙子☆ 提交于 2019-12-24 14:28:31
问题 The code below is a mostly working control that can be used to display an object in a table with two rows. The first row is the header row and the second row displays the data. Properties of the object being displayed can be defined as the Items for the control. Each item is displayed as a column in the generated table. I do not want to use reflection to implement this control. This question is not about reflection. The control has two problems: 1.) It is not written in "WPF form" (for lack

Substring a bound String

旧时模样 提交于 2019-12-24 14:23:50
问题 What I want is to bind a string to a textblock or datatrigger (basically some WPF object) and take a part of the string. This string will be delimited. So, for example, I have this string: String values = "value1|value2"; And I have two controls - txtBlock1 and txtBlock2 . In txtBlock1 I would like to set the Text property like Text={Binding values} . In txtBlock2 I would like to set the Text property like Text={Binding values} . Obviously this will display the same string so I need some sort

Validation.error event in event command

别说谁变了你拦得住时间么 提交于 2019-12-24 13:25:15
问题 I have a text box: <TextBox Height="20" Width="150" Text="{Binding MyProperty,NotifyOnValidationError=True,ValidatesOnDataErrors=True}" > <i:Interaction.Triggers> <i:EventTrigger EventName="Validation.Error"> <mvvm:EventToCommand Command="{Binding MyCmd}" PassEventArgsToCommand="True" ></mvvm:EventToCommand> </i:EventTrigger> </i:Interaction.Triggers> </TextBox> My ViewModel looks like this: public class MyViewModel : ValidationViewModelBase, INotifyPropertyChanged { private int myVar; [Range

wxPython: How to bind the button?

房东的猫 提交于 2019-12-24 12:33:37
问题 I just started with wxPython and have problems with the binding. Usually the examples I find to bind a button event are done with self.Bind(wx.EVT_BUTTON, self.OnWhatEverFunction, button) . I have a frame with a panel inside and a button and what ever I tried, the outcome is always a flashing frame that appears in a split second and that's it. Since the code isn't that much I attach it here and hope one of you can show me the way out of my little problem. Thanks in advance, Thomas #!/usr/bin

In code-behind how can I override tabitem colors set by an application-wide theme?

假装没事ソ 提交于 2019-12-24 12:29:35
问题 I change the background color of my TabItem conditionally in code behind. This works fine as long as no theme is set in the App.xaml. How can I change colors of a TabItem (in code) while keeping an application-wide theme? Background: I'm using a free WPF theme from Nukeation Reuxables. The theme is set in the Application.Resources section of my App.xaml: <ResourceDictionary Source="/ReuxablesLegacy;component/Edge.xaml" /> . I'm trying to conditionally set the background color of a TabItem in

vb.net Bind a combobox to a datasource

允我心安 提交于 2019-12-24 12:19:52
问题 Over the past few days, I've read about a thousand forum posts, and looked at many code samples, but I still can't figure this out. My goal is to populate a combobox with values from an Access 2007 query. I can do this by using the DataSource, DisplayMember and ValueMember properties, but regardless of the data in the query, the comboboxes all just default to the to first item in the items collection and don't change when the main BindingSource is moved. I am binding the controls with this

Bing map silverlight binding for moving target

你离开我真会死。 提交于 2019-12-24 11:49:22
问题 I want to animate a "car" dot on a Bing map. I can easily draw multiple dots as the item travels around, but I want to have a single dot move around per car. XAML <m:Map Name="myMap" Grid.Row="2" MouseClick="myMap_MouseClick" UseInertia="True"> <m:MapLayer x:Name="carLayer" /> </m:Map> Some code: private void AddCarDot(double latitude, double longitude) { Ellipse point = new Ellipse(); point.Width = 15; point.Height = 15; point.Fill = new SolidColorBrush(Colors.Blue); point.Opacity = 0.65;

How to properly set up a WPF UserControl for Binding

会有一股神秘感。 提交于 2019-12-24 11:43:30
问题 I want to create a UserControl, that essentially is a Label with a TextBox. Now I want to be able to Bind TextBox.Text to different values. For this I created a DependencyProperty in my UserControl and am now trying to bind something to that newly created DependencyProperty, but the Text seems not to get updated. My UserControl1.xaml looks like this: <UserControl x:Class="WpfApplication1.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas

How to bind the text of a textarea in fxml to a custom property in the controller?

我只是一个虾纸丫 提交于 2019-12-24 11:27:53
问题 I have a fxml file: <?xml version="1.0" encoding="UTF-8"?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <HBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="my.AppController"> <children> <TextArea prefHeight="200.0" prefWidth="200.0" text="${ddd}"/> </children> </HBox> You can see I want to use ${ddd} to bind