FAQ Database Discussion Community


Path Tansition Binding

java,animation,binding,javafx
So I want to create a pendulum using path transition and binding. I tried to bind the end of the line to the center of the circle but when I do that the line doesn't move. I also tried another path transition for the line itself but then it would...

Bind Control to Two properties

wpf,binding
Using MVVM pattern and WPF, I would like to bind my controls to two properties. Let's say I have a label that is bind to property on VM1 and I would like to bind it as well to the property on VM2 to send received value from VM1 to VM2....

Binding parameters in mysql

php,mysql,binding,parameters
I'm trying to learn about binding parameters in MySQL. I tried this test but I'm getting the error "Call to a member function bind_param() on a non-object". Am I doing something wrong? Here is the updated code: $sql = "INSERT INTO users (field1, field2, field3) VALUES (?, ?, ?)"; connect();...

WPF Binding - Bind to A when X is checked, else bind to B

c#,wpf,binding
Basically I have a TextBlock which displays the Microphone Gain. <TextBlock FontFamily="Calibri Light" FontSize="20" Foreground="#FFF65B60" FontWeight="Bold" Height="35"><Run Text="{Binding AudioRecorder.Gain, StringFormat={}Microphone Gain: {0:#} %}"/></TextBlock> As you can see, this is bound to "AudioRecorder.Gain" however I only want to bind to that value if this checkbox is NOT checked. <CheckBox IsChecked="{Binding Recognizer.AutoGainControl}"...

ObservableCollection to 1 of 3 listviews depending on some property

c#,listview,visual-studio-2013,binding,windows-store-apps
I currently have an ObservableCollection named MyList that is binded to the itemsource of on listview. It also adds and removes items from MyList. What I want is to add items in each listview based on some criteria. More specific, If the property Status is "Yes" the item should go...

Change ImageBrush Imagesource programmaticaly with conditions (WPF)

c#,wpf,binding,imagesource,imagebrush
maybe that question was asked 100 times but can you help please I searched everywhere but can't find a normal answer. I got such xaml <Window x:Class="Imagebind.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" Background="#FF3F3B51"> <Window.Resources> <Style x:Key="ButtonStyle1" TargetType="{x:Type Button}"> <Setter Property="FocusVisualStyle"> <Setter.Value> <Style>...

Set background color depending on data-bound value

xaml,binding,xamarin,xamarin.forms
I've seen some answers before but nothing really helped me out. I also have a class DecideModel (This will be a dataset retrieved from DB, but for purpose of this question, I have added an ObservableCollection) which contains static DecideModel() { All = new ObservableCollection<DecideModel> { new DecideModel { DatePerformed...

Create/Improve a pseudo-terminal using bindings

java,string,binding,javafx
My goal is to create a Pseudo-Terminal that will show data that I receive. To create my pseudo-terminal, I use a TextArea that I bind to a StringProperty. When my StringProperty attribute change, my TextArea must update its content. I implement a first version that works, it displays every message...

Editable ComboBox binding and update source trigger

c#,wpf,binding,combobox
Requirement I want to have ComboBox where user may enter some text or choose text from drop-down list. Binding source should be updated when user press Enter after typing or when item is simply selected from drop-down list (best View behavior in my case). Problem when UpdateSourceTrigger=PropertyChange (default) is set,...

Add text to bound values in Xamarin.forms

binding,xamarin.forms
My modelView: public string Status { get { return _status; } set { if (value == _status) { return; } _status = value; OnPropertyChanged ("Status"); } My View: Label labelStatus = new Label { TextColor = Color.Green, FontSize = 20d }; labelStatus.SetBinding (Label.TextProperty, "Status"); Then I want to present the...

Using controller inside another controller in AngularJS

angularjs,binding,controller
Why I can't bind to controller's variable inside second controller? <div ng-app="ManagerApp"> <div ng-controller="MainCtrl"> Main: <div ng-repeat="state in states"> {{state}} </div> <div ng-controller="InsideCtrl as inside"> Inside: <div ng-repeat="state in inside.states2"> {{state}} </div> </div> </div> </div> var angularApp = angular.module('ManagerApp', []); angularApp.controller('MainCtrl', ['$scope', function ($scope) { $scope.states = ["NY", "CA", "WA"];...

Lock data binding MVVM

c#,wpf,mvvm,binding
I've got a form with an Image component. I would like load image at runtime. In my ViewModel, I've a property which represents the Path of the image source : public string ImagePath { get; set; } This property is binding to Source of my ImageComponent. The problem is, when...

Why to use Service if it runs in the same thread in android

android,service,binding
I was going through Bound Service in android developer website. I thought I understood the service enough but I just found the another way of connecting service through Using a Messenger class especially for local service. There I got confused. Maybe I got the concept wrong. Here is my understanding...

Polymer 1.0 data binding not working

data,binding,polymer
I have the following polymer element: The value of navigator.currentStep is not updating after someMethod is called. <dom-module id="m"> <template> Navigator step = <span>{{navigator.currentStep}}</span> </template> </dom-module> Polymer({ is: 'm', ready: function() { this.navigator = new Navigator(1); console.log(this.navigator.currentStep); // 1 }, someMethod: function() { this.navigator.next(); console.log(this.navigator.currentStep); // 2 } }); Output...

How to bind selectedItem from different listboxes to one textbox?

c#,wpf,xaml,binding,listbox
I am very new to WPF and I got stuck with a binding problem. I have 3 listboxes that I want to bind to one textbox. In listbox1 I have the name "John Doe", in listbox2 "Brian Warner" and in listbox3 "Anne Brown". When I click on "John Doe" it...

Data binding in a dynamically inserted polymer element

binding,polymer,web-component,observers,polymer-1.0
There're some times when we could need adding a custom element dynamically into a context. Then: The inserted polymer could receive some properties bound to another property inside the context, so it can change accordingly. At polymer 0.5 we could use PathObserver to binding a property to a context property...

WPF: Bind to property of a parent element

c#,wpf,xaml,binding,styles
I'm using a DataGrid and would like to introduce a style trigger for cells that sets the background color of the cell depending on the column's IsReadOnly property. I think there is some way to get from the cell level to the column level using RelativeSource (navigating all the way...

How can I express the type of 'takeWhile for vectors'?

haskell,types,binding,dependent-type
Haskell beginner here. I've defined the following types: data Nat = Z | S Nat data Vector a n where Nil :: Vector a Z (:-) :: a -> Vector a n -> Vector a (S n) infixl 5 :- I'm trying to write the function, takeWhileVector which behaves the...

DataGrid row datatrigger/template

c#,wpf,binding,datagrid
I have the following DataGrid: <DataGrid ItemsSource="{Binding Coll.View}" SelectedItem="{Binding SelectedTransaction}" ScrollViewer.CanContentScroll="True" ScrollViewer.VerticalScrollBarVisibility="Visible" AutoGenerateColumns="False"> <DataGrid.Columns> <DataGridTextColumn Header="Date" Binding="{Binding Date}" Width="100" /> <DataGridTextColumn Header="Category" Binding="{Binding Path=SelectedCategory.CategoryName}" Width="100" /> <DataGridTextColumn Header="Payee" Binding="{Binding...

BooleanToVisibilityConverter works on Textblock and not on UserControl

wpf,xaml,binding,windows-phone-8.1
I'm working on a windows phone project. There is something i don't really understand about my xaml. Here it is: <Page x:Class="CitiBox.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:converters="using:CitiBox.Converters" xmlns:views="using:CitiBox.Views" mc:Ignorable="d" Background="{ThemeResource...

Binding using ValueConverter - ConvertBack Parameter always null

c#,xaml,binding,windows-phone-8.1
I have a control that is bound to a question, that question has many possible options. Each option can have a response. Example: Question: Will it fit in a shoe box? Options: Yes, No, Maybe Response: options[0].Response = new Response() Meaning that the first option has a response, therefore it...

Track down UI binding error

.net,wpf,visual-studio-2013,binding,error-handling
Please get me started on tracking down this error Problem is that I bind to a lot of FieldValue and clearly not all are failing or I would be getting a lot more of these errors How do I n find the XAML binding that is throwing these warnings? Does...

Binding ComboBox SelectedValue to string disables the default SelectedValue wpf

c#,wpf,binding,combobox,selectedvalue
I'm trying to bind a ComboBox SelectedValue to a string. The Binding works flawlessly. However, one of my ComboBoxItem's IsSelected is set to True, but for some reason when I launch the application, none of the items is selected, the SelectedValue is blank and I need to re-select the item...

Listbox SelectedItem binding to UserControl

c#,wpf,xaml,binding,listbox
I want to bind a ListBox SelectedItem to This is my code for Listbox in my UserControl.xaml Style x:Key="listbox" TargetType="ListBox"> <!-- Region Setter Properties --> <Setter Property="SelectionMode" Value="Single" /> <Setter Property="ItemsSource" Value="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type program:UserControl}}, Path=Source}" /> `<ListBox Name="ListBox" Grid.Row="1" SelectedIndex="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type...

Polymer bounded property not updating (sometimes)

javascript,binding,polymer,value
This problem is with 1.0 I have the following html in a polymer element <iron-selector attr-for-selected="step-number" selected="{{stepNumber}}"> <section step-number="1"> <page-1 id="page1"></page-1> </section> <section step-number="2"> <page-2 id="page2"></page-2> </section> <section step-number="3"> <page-3 id="page3"></page-3> </section>` page 1 fires an event - event1, page-2 fires event2. Here's my javascript for the polymer element function...

How would you bind a DataTrigger to a Child property from a resource-defined Style?

wpf,binding,styles,datatrigger
How can I style an element based on changes in child properties? I would accept a different approach, but the desired result is simply that the parent property is set a certain way as long as a a child property (IsPressed) is true. If we are styling one named item...

Getting response but view is not updating - AngularJS

angularjs,rest,view,binding
I am trying to get the response from a url and populate in the view, but I am do not see the view getting updated. Help me to resolve this issue. Thanks Source <!DOCTYPE html> <html ng-app="myModule"> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script> </head> <body ng-init="priceList='promo03'"> <div ng-controller="PricingController" > <div ng-repeat="item in finalList...

C# ListBox not showing added items when added from DispatcherTimer.Tick

c#,wpf,binding,timer,listbox
This looks like a weird behaviour to me and since I do not like to blame anyone else than myself I spent hours by trying to fix this - but I do not understand this at all: I just noticed that the problem occures in a method called by a...

Xaml - Binding in FallBackValue

c#,xaml,silverlight,binding,telerik
How can i make two bindings on a column in grid, in the way that if first binding is empty or null, second binding will be used. I have tried to do that with FallbackValue property but you can't make binding inside it only static values. Here some code, which...

How do I reuse an intermediate value in chain of Haskell Either binds?

haskell,binding,bind,chain
I'm sure this has been answered but apparently I don't know what to search for. I am working on my first non-trivial Haskell program -- a simulation of a card game I enjoy. I have the program working but there is a situation that I am certain can be handled...

Binding ObservableCollection in viewmodel to listbox

c#,wpf,mvvm,binding,viewmodel
I'm very new to MVVM and bindings and I'm trying to learn to work with it. I run into the problem of binding my viewmodel to the view in particular binding an observable collection to a listbox. this is what my viewmodel looks like: namespace MyProject { using Model; public...

DataTrigger on an Image that should change the Image.Source property does not work

c#,wpf,image,binding,datatrigger
I reproduced this question/answer as given below: <Button Command="Play" ToolTip="Execute Macro"> <Image DataContext="{Binding ElementName=UserControlMacroEdit}" Source="/ParametricStudySharedGui;component/Image/arrowRight32x32.png" Height="24" Width="24"> <Image.Style> <Style TargetType="{x:Type Image}"> <Style.Triggers> <DataTrigger Binding="{Binding IsMacroRunning, Converter={StaticResource FakeTransparentConverter}, Mode=OneWay}" Value="True"> <DataTrigger.Setters> <Setter...

How to not update a model until form submission in Angular?

javascript,angularjs,forms,binding
I'm looking for Angular to not update the model until the user submits the form. Or, in another way, to update the model only when the user has submitted the form. <form ng-submit="process()"> Value is : {{ model.property }} <input type="text" ng-model="model.property"> <button type="submit">Submit</button> </form> I was thinking of something...

WPF nested itemscontrol EventToCommand binding path error

wpf,mvvm,binding,nested,itemscontrol
I have a problem with my WPF bindings inside an itemscontrol. The following error occurs System.Windows.Data Error: 40 : BindingExpression path error: 'MovieImageClick' property not found on 'object' ''RelativeSource' (HashCode=56697999)'. BindingExpression:Path=MovieImageClick; DataItem='RelativeSource' (HashCode=56697999); target element is 'EventToCommand' (HashCode=42916613); target property is 'Command' (type 'ICommand') A simple example of the XAML:...

ComboBox binding works only one way with Color property

wpf,binding,combobox
I'm implementing an ObservableCollection <-> DataGrid binding. My class consists of a System.Windows.Media.Color field (named 'Color') and several strings. My implementation in WPF of the Color column: <DataGridTemplateColumn Header="Color" Width="100"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <ComboBox ItemsSource="{Binding Source={StaticResource ColorProperties}}" SelectedItem="{Binding Path=Color, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" Style="{StaticResource ComboBoxFlatStyle}">...

binding on p:dataTable which is included multiple times causes ID unqiueness exceptions

jsf-2,primefaces,binding,datatable,facelets
I'm attempting to use a special PrimeFaces data exporter implementation as being used in this answer: http://stackoverflow.com/a/14413932/396732 Our use case however is a little more complex, e.g. using Facelets to show the respective datatable for export, which has row expansions with sub tables in them. insiderListManagerDialogs.xhtml: <ui:include src="insiderListManagerListDialog.xhtml"> <ui:param name="idPrefix"...

angularjs reuse template and bind to different properties within the same scope

angularjs,templates,express,binding
I'd like to reuse an express included template multiple times and selectively bind it to different properties of the scope as follows: <div ng-show="isCoApplicant" bind-to="applicant in data.coApplicant"> <% include ../row-templates/applicant-row %> </div> Similar to the behavior of ng-repeat which creates a child scope for the row and sets a property...

Get local url for MvxStandardTableViewSource ImageUrl

binding,xamarin,mvvmcross
I am trying to bind my viewmodel to the MvxStandardTableViewSource. My binding text: "DetailText MyDetail; TitleText MyTitle; ImageUrl MyImage" My ViewModel public class MyViewModel : MvxViewModel { public string MyDetail { get; } public string MyTitle { get; } public string MyImage { get; } } I got the DetailsText...

How load binary images in Xamarin

image,forms,xaml,binding,xamarin
I'm working with Xamarin Forms and I want to load a listview with imagecells, also I'm binding the data with XAML. My webservice provider returns me the binary code of the images, ¿someone knows how I can convert this to show the image? This is my XAML listview template: <ListView...

How to use VisualStateManager instead of DataTrigger to implement dynamic binding?

c#,mvvm,binding,visualstatemanager,windows-universal
I've tried to implement DataTrigger, to perform dynamic binding based on which toggle button is toggled in a View. But after searching on the issue, DataTrigger in WinRT? it seems this is not available in Windows Universal apps, and VisualStateManager should be used instead. My question is, how can I...

ItemContainer style with nested ItemControls won't bind correctly

c#,wpf,binding
A summary of what I'm trying to do: I have a list of shapes All shapes have a list of blocks I want to draw all blocks in a canvas and bind their position. But the problem right now is that even if it draw my blocks it don't bind...

Binding inside binding WPF

c#,wpf,mvvm,binding
I have a dictionary of items and I would like to show an aspect of items in a combobox - all in a MVVM pattern. In this regard, I define my Model as: public class Model { public Dictionary<UInt32, string> samples { set; get; } } and my ViewModel as:...

Append extra text to a bound textblock in winrt universal application

c#,binding,windows-phone-8.1,winrt-xaml
<TextBlock Text="{Binding Amount}" /> I have this text block, it simply shows a number what ever I bind. What I want is that it could append 'AED' before the bindings. Mean if 4.00 is bound, it would show this: AED 4.00 If I don't want to create another textblock and...

GridViewColumn.Width binding and double-click to autosize column

c#,wpf,xaml,binding
Binding column width like this <ListView ...> <ListView.View> <GridView> <GridViewColumn Width="{Binding Width, Mode=TwoWay}" ... /> ... more columns </GridView> </ListView.View> </ListView> The problem: when double clicking column header line (to autosize column) no Width setter is triggered, which means binding source is not updated after such column width changing. Normal...

MvvmCross RaisePropertyChanged and dot (.) binding

c#,binding,xamarin,mvvmcross
I have a custom binding that accepts entire view model: public class TextViewGroupInfoBinding : BaseBinding<TextView, GroupViewModel> { private IMvxAndroidCurrentTopActivity CurrentTopActivity { get { return ServiceLocator.Current.GetInstance<IMvxAndroidCurrentTopActivity>(); } } public TextViewGroupInfoBinding(TextView androidControl) : base(androidControl) { } public override MvxBindingMode DefaultMode { get { return MvxBindingMode.OneWay; } } protected override void SetValueToView(TextView control,...

Linq query to return country as column and cities as rows and count in cells

c#,sql,linq,binding,datagrid
I have this table in db : | Buyer Country| City |... |:-------------|-------:|... | Uk | Lisbon |... | Portugal | London |... | France | Madrid |... | France | Lisbon |... | France | Madrid |... | France | Madrid |... And i would like to get a...

Binding radio buttons in an ng-repeat with angular

html,angularjs,binding,radio-button,ng-repeat
I'm relatively new to angular and i'm trying to bind my form radio buttons so I can post the data to the back end. My problem is when I try to submit the form, the variable formData doesn't contain any of the information entered in the form. I tried binding...

Knockout 'with' binding and select2 in jQuery dialog

jquery,knockout.js,binding,jquery-select2,jquery-dialog
Problem: The select2 jQuery plugin does not work when used on a jQuery dialog nested under an element that uses the knockout with databinding. Remove the with binding and the select2 works fine. If with is bound to a nested property then it stops working. Background: So I must have...

Why does binding image path to Image.Source does not work this way

wpf,image,xaml,binding,properties
I have an image path declared as following: public static string _edit_vector32 = "pack://application:,,,/Resources/Images/Icons/32/edit-vector2-32.png"; I try to add a simple property that returns an ImageSource to my ViewModel as following: public ImageSource ClockImage { get { return new BitmapImage(new Uri(RuntimeSettings._clock24)) as ImageSource; } } Then bind in XAML: <Image Source="{Binding...

Projecting an entity to an anonymous object while some of its navigation properties might be null

c#,linq,entity-framework,binding
I hope the question isn't confusing, what I'm trying to do is binding a list of anonymous object to a grid, I have a class Client, I am project a client into a list of anonymous object so that I can show its details in the grid, like this: this.gridControl1.DataSource...

Convert DoubleBinding value to IntegerBinding

binding,javafx,double,javafx-8
I have the following Problem. I want to concat a String with an DoubleBinding to an String property. Slider slider = new Slider(1, 5000, 500); Label sliderValue = new Label(); sliderValue.textProperty().bind(Bindings.concat("Sleep: ", slider.valueProperty())); This is working fine. But I don't want to display the Double Binding as an Double, I...

How to bind command into ContextMenu in DataTemplate

c#,wpf,binding
I'm a little bit lost with bindings. I tried so many things in the last hour, I cannot enumerate all of them. I have an issue with a contextMenu inside a DataTemplate. To explain: I have a UserControl. Its dataContext is itself. Inside this UserControl, I have an ItemsControl to...

How to bind multiple properties in a UserControl

c#,wpf,xaml,binding,user-controls
Let's say we have a UserControl like this: <UserControl x:Class="...> <StackPanel> <TextBlock Name="TextBlock1" /> <TextBlock Name="TextBlock2" /> <TextBlock Name="TextBlock3" /> ... <TextBlock Name="TextBlock10" /> </StackPanel> </UserControl> And we have properties defined like this: public string Text1 { get; set; } public string Text2 { get; set; } public string Text3...

WPF: Binding the items in a “sub-list” of a list

c#,wpf,xaml,binding,datagrid
I have a Datagrid in WPF that I bind to my ObservableCollection List, then I create the Columns for properties that I want, like the following ones: public int Name { get; set; } public DateTime Date { get; set; } public long Cod { get; set; } public long...

tkinter: bind Return key to the OK button — but not to the Text widget

python,binding,tkinter
With tkinter/ttk (8.5+), in a custom dialog, I want to bind the Return key to the OK button. So I use the standard instruction: self.window.bind("<Return>", self.on_ok) The problem is, in this custom dialog there is also a (multiline) Text widget. And once the Return key is bound to the OK...

TextBox binding is not working

c#,wpf,binding,textbox,command
I have two UserControls: 1) ContactDetailsView. 2) SearchBarView. In theSearchBarView, I have a Search button, which raises a command when clicked: Command="{Binding SearchCommand}" In the SearchBarView code behind, I have the following code: DataContext = new SearchBarViewModel(); In the ContactDetailsView I have the following code: xmlns:ViewModel="clr-namespace:Accounts_Manager.UserControls.SearchBar" in the definition of...

Xamarin Unified API: Native library binding: NSUInteger vs. enum

ios,binding,enums,xamarin,native
I am binding to a native Objective-C library with the help of a Binding Project in Xamarin. Everything works fine. Now I migrated my solution to the Xamarin Unified API and to 32 AND 64 bit and after a lot of work, it works OK again. Although everything is working,...

How to bind data from code behind to a WPF Label, from XAML?

c#,wpf,xaml,binding
I have seen a few similar questions, but none of them dumb it down enough for me. I've been coding in C# for about two weeks and using WPF for about two days. I have a class namespace STUFF { public static class Globals { public static string[] Things= new...

Null pointer exception on passing a value between 2 controllers

java,binding,javafx,controller,fxml
Introduction I am learning Java and JavaFX and in order to do that I am working on a little project which objective is to behave as password generator. Basically, I have 2 windows, the first one allows the user to chose what kind of password he wants. Once he is...

Angular JS 1.3+ One time binding for ng-bind with a ternary condition

angularjs,binding,angularjs-1.3
Would this be correct if I need to use one time binding for a ternary condition inside data-ng-bind directive? <span data-ng-bind="::model.boolean ? 'json.item.value1' : 'json.item.value2'"></span> or <span data-ng-bind="::(model.boolean ? 'json.item.value1' : 'json.item.value2')"></span> ...

Update bindings from other bindings using MVVM in WPF

c#,wpf,xaml,mvvm,binding
Does anyone have any suggestions of how to fix my problem?? I have a datagrid binded to a collection of ModelCheckoutRecord objects (ListModelCheckoutRecords). I am binding the selected item to a ModelCheckoutRecord (SelectedItemModelCheckoutRecord). In the binding for the selected item I want to update the visibility binding for another datagrid...

Bind enum to AspxListBox

c#,asp.net,binding,devexpress
I have following enum called BillTypes: public enum BillTypes { [EnumProperties("Natural Gas")] NaturalGas= 1, [EnumProperties("Electric")] Electric = 2, [EnumProperties("Water")] Water = 3 } How can I bind this enum to an AspxListBox?...

How do I provide a collection of elements to a custom attached property?

c#,wpf,binding
I found a few examples online, and a few questions and answers here, but I just can't get it to work. I need a custom attached property that can take one or more target elements. For example... <ListView> <dd:MyDragDrop.DropBorders> <Binding ElementName="brdOne"/> <Binding ElementName="brdTwo"/> <Binding ElementName="brdThree"/> </dd:MyDragDrop.DropBorders> </ListView> I've also had...

Binding data between $ionicPlatform.ready() & a controller in AngularJS Cordova

javascript,angularjs,cordova,binding,push-notification
I used the Push Plugin in the app.ready() like this https://github.com/phonegap-build/PushPlugin window.onNotification = function(e) { switch( e.event ) { case 'registered': if ( e.regid.length > 0 ) { // Your GCM push server needs to know the regID before it can push to this device // here is where you...

How can i make this CommandParameter work?

c#,wpf,xaml,binding,commandparameter
I've been learning WPF in college this semester but there are still some things I do not fully understand. I have the following code: <UserControl x:Class="Reversi.SquareControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="48" d:DesignWidth="48"> <Button Command="{Binding Place}"...

Binding a button to both a function and close event wpf

c#,wpf,button,binding,command
I have a UserControl which is binded to a ViewModel class. I also have a class which contains a Command for closing a window. In my UserControl I have two buttons: Save and Cancel. My Cancel button is binded to the CloseWindow Command and when I click it, the UserControl...

Preventing double event binding in jQuery

javascript,jquery,events,binding
I have this code $(".generate").click(function() { $.getJSON("jsonfile.json").done(function(data) { if (parseInt(data)>0) { $(".mybutton").click(function() { alert(data); }); } }); }); When the "generate" button is clicked, the getJSON function is called and if data says "ok" then I can press the "mybutton" to alert the data; Only problem is if I press...

Binding property of usercontrol to data

c#,xaml,mvvm,binding,winrt-xaml
I'm not sure of the correct terminology to use. I created a Windows Store app about a year ago and the main page was created by Visual Studio and I never changed it much. It uses a view model that works fine but I don't know enough to fix problems....

ObservableCollection does not raise property changed with Fody

c#,binding,windows-phone-8.1,observablecollection
I have defined this class [ImplementPropertyChanged] public class ChatInfo : IMessageData { public ObservableCollection<Message> messages { get; set; } [JsonIgnore] public Message LastMessage { get { return messages.Last(); } } } The class is deserialized via JSON.NET(James King) and then after I manually pushing new items to messages. The LastMessage...

How to bind a TextArea to a String to create a Terminal

string,binding,javafx
My goal is to create a terminal. To do so I use a TextArea, I receive data that I put in a StringProperty, and then I want to bind this StringProperty to my TextArea. Here's what I do : In the class that receives the data : StringProperty sendData =...

WPF Cascading Binding

c#,wpf,binding
Topic: How to prevent that the binding on a UserControl overrides the binding given by the upper (Main)Window using this UserControl. I already read posts, and some books on that subject but I am still puzzled with binding mechanisms. Even in some specialized books the terms of DependencyProperty or AttachedProperty...

Need help resolving a BindingExpression issue

c#,wpf,data-binding,binding,binding-expressions
I have this style: <DataTemplate> <Button Width="44" Height="24" VerticalAlignment="Top" VerticalContentAlignment="Center" HorizontalAlignment="Left" HorizontalContentAlignment="Center" Command="{Binding UninspectedPrintSelectedCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}"> But the command does not work correctly. Looking at the output window yields this issue: System.Windows.Data Error: 40 : BindingExpression path error: 'UninspectedPrintSelectedCommand' property not found on...

Accessing a control within a control template in C#

c#,wpf,binding,controltemplate
WPF newbie here. I am trying to build a table that I would like to reuse for each day of the week. So I moved it to a control template. Here is the XAML: <ControlTemplate x:Key="defaultGridDesign" > <Grid HorizontalAlignment="Center" Margin="0,5"> <Grid.ColumnDefinitions> <ColumnDefinition Width="80"/> <ColumnDefinition Width="80"/> <ColumnDefinition Width="200"/> <ColumnDefinition Width="60"/> <ColumnDefinition...

WPF use one ViewModel for multiple UserControls

wpf,binding,user-controls,viewmodel,datacontext
I've searched a lot for an answer for this question, but couldn't quite find an answer. I have my main Window and 4 different UserControls. The Window is constructed from all 4 UserControls. I have a class which is the Window's ViewModel. I wish to set the DataContext of the...

Scala: binding time

scala,binding,runtime
In the Strategy pattern, implemented like this: object StrategyPattern { def add(a: Int, b: Int) = a + b def subtract(a: Int, b: Int) = a - b def multiply(a: Int, b: Int) = a * b def execute(callback:(Int, Int) => Int, x: Int, y: Int) = callback(x, y) def...

Bind a WPF datagrid column header to property in code behind

c#,wpf,xaml,binding,datagrid
Can someone tell me if this is possible. I have a WPF datagrid and I'd like to bind the column headers of the datagrid to properties/fields in the code behind. So heres what I've tried. This is my column code. <DataGridTextColumn Header="{Binding ElementName=frmAssetPPM, Path=HeaderProperty}" And this is what I've added...

Notify update of Tooltip Value (wpf)

wpf,xaml,binding,datagrid,notify
I have a Datagrid structure in xaml and several columns inside it: <DataGridTextColumn x:Name="QualityValueColumn" Binding="{Binding QualityValue}"> <DataGridTextColumn.CellStyle> <Style TargetType="DataGridCell"> <Setter Property="ToolTip" Value="{Binding MySelf, Converter={StaticResource ItemToTooltipConverter}}"/> <Setter Property="ToolTipService.ShowDuration" Value="48000"></Setter> <Setter Property="BorderThickness" Value="0"></Setter> </Style>...

How to bind a datagrid row with text boxes in wpf mvvm

wpf,mvvm,binding,datagrid
I have a DataGrid which contains some Product details , i need to load the product details into some textboxes when i double click on a particular product in the datagrid. Thanks in advance....

Kivy Python very basic Binding of Label Text

python,binding,label,kivy
I know this might be a very basic question, but after spending hours wrapping my head around it I still can't figure it out. I basically just want to bind the text of a label to a variable in the python code. lets call it value. however it should get...

How to bind width of child element to width of parent element in WinRT

.net,xaml,binding,windows-runtime
I have a ProgressBar in StackPanel. I want my ProgressBar to have the size of my StackPanel or a bit smaller. I tried Width="{Binding ActualWidth, ElementName=parentElementName}" but this doesn't actually work in WinRT Sample Code <StackPanel Grid.Row="1" Margin="120,15,0,0"> <ProgressBar x:Name="progressBar1" Value="{Binding ProgressPercent}" HorizontalAlignment="Left" IsIndeterminate="False" Maximum="100" Height="10"/> </StackPanel> ...

WPF + EF: binding an entity and track changes from different contexts

c#,wpf,entity-framework,binding
I have a WPF application using Entity Framework and two views: ProductsListView ProductEditView Considering the following scenario: The ProductListView is opened: a DbContext is instantiated, the product list is filled and the DbContext is closed. The user selects a product and click in the edit button. The ProductEditView is opened:...

ListView SelectedItem multitrigger for conditions

c#,wpf,listview,templates,binding
Depend on my value I need to get oldTemplate or newTemplate for selected item on listview. Code doesn't work, I know that, just want to show what I'd like to achieve <Style TargetType="ListViewItem"> <Style.Triggers> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsSelected" Value="true" /> <Condition Property="Selector.IsSelectionActive" Value="true" /> <Condition Binding="{Binding Source={x:Static s:Environment.OSVersion.Version.Major}}" Value="5"/> </MultiTrigger.Conditions>...

MVVMCross, WPF, XAML “Unable to resolve the binding creator - have you initialized Windows Binding”

wpf,xaml,mvvm,binding,mvvmcross
I am trying to make a simple WPF application using MVVMCross that has two views and two view models. All I want to happen is for a button on the initial view to open the second view, using the MvvmCross.BindingEx.Wpf nuget package. Here is the first tag in my XAML...

Binding imperatively

binding,polymer
Is there a way to set up bindings imperatively. An example use case: var el2 = new MyElement(); el2.myProp = this.$.anotherElement.anotherProp That won't setup a binding, it just assigns the value or object. I'd like to find a way to do something like: el2.myProp.bindTo(this.$.anotherElement.anotherProp) Possible?...

NSButton binding to NSCollectionViewItem: representedObject?

objective-c,swift,binding,nsbutton,nscollectionviewitem
When I pre-added a button to the NSCollectionViewItem's view, I can bind its action in the inspector: Which works without problem. Now I'd like to create that button programmatically within the view's mouseDown:, what should I assign to the bind: option for the same result as the "Bind to: Collection...

Kendo UI grid dropdown and angular

angularjs,binding,kendo-ui,telerik,kendo-grid
I try to setup custom dropdown in Kendo UI. I have a reference to my issue. http://dojo.telerik.com/aFIZa/13 My issue is that I do not know how I can setup the selected text in the template attribute? I want to show the text field but save the id as a value....

Bind a collection of a model to only a part of another collection

c#,wpf,binding
I have the requirement to select/map only a few of datasources for each of my applications, by first selecting the application on the left then the mapped/selected (few) datasources on the right (see screenshot). I often have such a scenario as a business requirement, however I wasn't able to come...

How to make ListView update at background and not freez UI when ItemsSource updated?

c#,wpf,listview,mvvm,binding
I have a ListView: <ListView ItemsSource="{Binding Students, IsAsync=True}"> <ListView.View> <GridView> <!--Some view things --> </GridView> </ListView.View> </ListView> and this is Students in my ViewModel: public ICollection<Student> Students { get { return _students; } set { _students = value; OnPropertyChanged(() => this.Students); } } I'm updating Students in some tasks like...

Can't access datacontext of parent

c#,windows-phone-8,binding,windows-phone-8.1,datacontext
Basically what i have is a ListBox with ContextMenu <ListBox Margin="2,0,0,0" Grid.Row="1" ItemsSource="{Binding MyCollection}"> <ListBox.ItemTemplate> <DataTemplate> <Button Style="{StaticResource NoVisualButton }" Tag="{Binding ID}" Width="430" toolkit:TiltEffect.IsTiltEnabled="True" Margin="0,0,0,12" Click="OnSelectWorkOutItemClick"> <StackPanel> <toolkit:ContextMenuService.ContextMenu> <toolkit:ContextMenu> <toolkit:MenuItem Header="delete" Tag="{Binding ID}"...

Angular : displaying elements in navbar after logged in

javascript,angularjs,binding,navbar,ng-show
I am fairly new to AngularJS and I am facing issues while trying to show the userInfo in my navbar and the Logout button but only once I'm logged in. 1) I am using ng-show to display the Logout button only when I'm logged in but this button appears in...

x:Bind syntax for event binding giving error CS0122: inaccessible due to protection level

c#,xaml,binding,windows-10
I've got a basic page in a Windows 10 Universal App that I'm using the new binding pattern with. I'm loading a ViewModel into a public property on the MainPage.xaml.cs code-behind. This ViewModel contains a bunch of properties that I am binding to properties on my controls and they work...

WPF: binding based on column index

c#,wpf,xaml,binding
In WPF, how can I create a data trigger based on a DataGrid cell's column index? I can get at the column, but the column only has the DisplayIndex available, not the real index. I need to style the cell in a way that includes the colum as one of...

Yes or No instead of True or False in Knockout

javascript,knockout.js,binding,boolean
In Knockout is there a clean way to display a boolean property from my view model to show 'Yes' or 'No' instead of True / False. Sometimes the property is undefined so this should also show No. Currently using : <td data-bind="text: isAvailable ? 'Yes' : 'No'"></td> Must be a...

wpf checbox and image binding

wpf,checkbox,binding
I have one image that changes depending on the status of 4 checboxes. I made the code work but it seems too long and complicated, I am new to wpf and can't make binding to work with these 4 checkboxes. Any source for help or example you can give will...

WPF: static INotifyPropertyChanged event

wpf,binding
This is my model: class Person : INotifyPropertyChanged { public static int Counter; public string _firstName; public string _lastName; public event PropertyChangedEventHandler PropertyChanged; public string FirstName { get {return _firstname; } set { _fileName = value; NotifyPropertyChange("FirstName"); } } public AddPerson(Person person) { Counter++; } } I have this NotifyPropertyChange...

MVVMCross Android: value with binding not updated

c#,android,binding,xamarin,mvvmcross
I created simple app with Xamarin(Android)+Mvvmcross. I have property Data( type MyData) in my ViewModel. This is my VievModel public class MyViewModel:MvxViewModel { private MyData _data; public MyData Data { get { return _data; } set { _data = value; RaisePropertyChanged(() => Data); } } .... } public class MyData:...

Ext JS 5 Data Binding Combobox

extjs,mvvm,binding,extjs5
I have an Ext JS 5.0.1 application that I am working on. I have a simple window with a grid and a form. I have the grid bound to my store and when a row is selected, all the textfields in the form bind, but I also have a combobox...

chart not updating when changing the value of displaymember

c#,wpf,binding,charts,modern-ui
I have an Modernui Piechart binded to an ObservableCollection. If I change the name of an item it is not updating, but if I change the value of on item then it will be updated properly(add/remove works fine). Chart XAML : <chart:PieChart Grid.RowSpan="2" Style="{StaticResource MinimalChartStyle}" ChartTitle="Minimal Pie Chart" ChartSubTitle="Chart with...

Use XAML UserControl with dataobject as property , as DataTemplate in Gridview - Binding

xaml,listview,binding,user-controls,data-objects
I have a collection of Objects with dependencyproperties, and Observer patern as I feed realtime data in "AssetIHM" Object. public class assetVM: DependencyObject ,IObserver { public assetVM(AssetIHM aihm) { ObserverCollectionSingleton.ObserverCollectionInstance.Add(this); _aihm = aihm; } private string _assetname; public string assetname { get { return _assetname; } set { _assetname =...

Binding warning when scrolling horizontally in datagrid

.net,wpf,visual-studio,binding,wpfdatagrid
In my WPF application, when I scroll horizontally a DataGrid, Visual Studio 2010 Output print this warning: System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='-0.29487179487171' BindingExpression:Path=CellsPanelHorizontalOffset; DataItem='DataGrid' (Name=''); target element is 'Button' (Name=''); target property is 'Width' (type 'Double') I'm looking for datagrid...