binding

Combobox SelectedItem doesn't update when source changes

倾然丶 夕夏残阳落幕 提交于 2019-12-18 04:49:09
问题 I have a viewmodel which implement INotifyPropertyChanged . On this viewModel is a property called SubGroupingView . This property is bound to the selected item of a combo box. When i change the combo box, the source property is being updated fine, but when I change the source property or when the control is initialized, the combobox.selectedItem is NOT reflecting what exists in the property. Here is some code to get you started: <ComboBox Grid.Column="3" Grid.Row="1" Margin="0,1,4,1"

WPF ToolTip does not update

有些话、适合烂在心里 提交于 2019-12-18 04:47:12
问题 Assuming I have a simple class that represents a staff member class Staff { public string FirstName { get; set; } public string FamilyName { get; set; } public int SecondsAlive { get; set; } } and I have a DataTemplate for staff <DataTemplate DataType={x:Type Staff}> <StackPanel Orientation="Horizontal"> <TextBlock Text={Binding FirstName}/> <TextBlock Text=" "> <TextBlock Text={Binding FamilyName}/> <StackPanel.ToolTip> <TextBlock Text={Binding SecondsAlive}/> </StackPanel.ToolTip> <

Bind an input with type datetime-local to a Date property in Angular 2

被刻印的时光 ゝ 提交于 2019-12-18 04:33:26
问题 It is possible to bind a component property of Date type to a HTML5 input with type set to datetime-local ? In my component I have a poperty: public filterDateFrom: Date; and in my template I have an input defined as: <input type="datetime-local" [(ngModel)]="filterDateFrom" /> but binding doesn't work. 回答1: Demo Plnkr You can bind to a date using the following format: yyyy-MM-ddTHH:mm , which you can also get from date.toISOString().slice(0,16) (the slice removes the time portion after the

How to connect a Qt Quick button click to a c++ method

霸气de小男生 提交于 2019-12-18 04:18:11
问题 I've just started to learn about Qt Mobile programming with Qt Quick 2.0 and I've been on google the whole day and its driving me crazy so here goes. I have got just your standard qt quick mobile app that qt makes for you. Here is all the files. (I'm brand new to this so these might be noob qu's, sorry) Ok so here is my list of I Don't Knows: how on earth do I connect this class method to the button click in the qml file. Would it be possible to connect the same click and pass params through

WPF CommandParameter binding not updating

佐手、 提交于 2019-12-18 04:18:05
问题 I am trying to use Command and CommandParameter binding with Buttons in a WPF application. I have this exact same code working just fine in Silverlight so I am wondering what I have done wrong! I have a combo box and a button, where the command parameter is bound to the combobox SelectedItem: <Window x:Class="WPFCommandBindingProblem.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height=

Silverlight 4: how to switch control visibility

浪尽此生 提交于 2019-12-18 04:14:48
问题 I am using MVVM in my Silverlight app. When control visibility is need to be managed by data, I am connecting its 'Visibility' property to object's corresponding property: XAML: <TextBlock Text="Price" Visibility="{Binding PriceVisibility, Mode=OneWay}"/> <TextBox Text="{Binding TicketPrice, Mode=TwoWay}" Visibility="{Binding PriceVisibility, Mode=OneWay}"/> CodeBehind (C#): public string PriceVisibility { get { return PriceVisible ? "Visible" : "Collapsed"; } } But from my perspective,

wpf combobox binding

隐身守侯 提交于 2019-12-18 04:09:37
问题 Hi I´m trying to bind a List<> to a combobox. <ComboBox Margin="131,242,275,33" x:Name="customer" Width="194" Height="25"/> public OfferEditPage() { InitializeComponent(); cusmo = new CustomerViewModel(); DataContext = this; Cusco = cusmo.Customer.ToList<Customer>(); customer.ItemsSource = Cusco; customer.DisplayMemberPath = "name"; customer.SelectedValuePath = "customerID"; customer.SelectedValue = "1"; } I become no Error but the Combobox is always empty. Cusco is the Property of my List. I

Failed to bind to: spark-master, using a remote cluster with two workers

自作多情 提交于 2019-12-17 23:27:45
问题 I am managing to get everything working with the local master and two remote workers. Now, I want to connect to a remote master that has the same remote workers. I have tried different combinations of settings withing the /etc/hosts and other reccomendations on the Internet, but NOTHING worked. The Main class is: public static void main(String[] args) { ScalaInterface sInterface = new ScalaInterface(CHUNK_SIZE, "awsAccessKeyId", "awsSecretAccessKey"); SparkConf conf = new SparkConf()

Check if key is pressed using python (a daemon in the background)

こ雲淡風輕ζ 提交于 2019-12-17 23:22:42
问题 I've created a python script in which an event needs to be executed each time I press the Super (or WinKey) on my keyboard. How can one achieve this without the python process being "focused" - as it is running in the background waiting for the key to be pressed to execute the event? I've seen a lot of posts around the web showing me how to read input - but they have all required one to have the process "focused" and none have showed me how to capture the Super (or WinKey) using a python

Set ListBoxItem.IsSelected when child TextBox is Focused

为君一笑 提交于 2019-12-17 22:54:38
问题 I have a typical MVVM scenario: I have a ListBox that is binded to a List of StepsViewModels. I define a DataTemplate so that StepViewModels are rendered as StepViews. The StepView UserControl have a set of labels and TextBoxs. What I want to do is to select the ListBoxItem that is wrapping the StepView when a textBox is focused. I've tried to create a style for my TextBoxs with the following trigger: <Trigger Property="IsFocused" Value="true"> <Setter TargetName="{Binding RelativeSource=