binding

BitmapFrame in WPF ComboBox

血红的双手。 提交于 2019-12-12 01:15:33
问题 I have a dialog that lets the user pick a custom icon. Loaded icons are displayed in a combobox in which the user makes the selection. Here is the XAML code for the combobox: <ComboBox Style="{DynamicResource IconComboBox}" ItemTemplate="{StaticResource IconTemplate}" ItemsSource="{Binding Icons, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" SelectedItem="{Binding Icon}" /> Icons is a property that returns an array of BitmapFrame . Icon is a property for

How to visually update checkboxes in UI that are bounded to boolean isChecked variable in WPF c#?

↘锁芯ラ 提交于 2019-12-12 01:14:02
问题 So I have a TreeView that has heirarchical data templates that have CheckBoxes in the lowest layer. These CheckBoxes are bound to a "isChecked" boolean value in the ViewModel. What I have been attempting to do is load the various variables indicating to me which checkboxes to check, change the boolean isChecked in the model to true, therefore resulting in the specific CheckBoxes in the TreeView being update visually. Here is my code for reference: XAML: (of TreeView I am working with)

Bind to some embedded object properties

半世苍凉 提交于 2019-12-12 01:09:32
问题 I have a Cars IEnumerable : public IEnumerable<ICars> Cars { get; private set; } The object "Car" actually contains a reference to another object of type IBrand: public interface ICar { // Parent brand accessor IBrand Brand { get; set; } // Properties int CarId { get; set; } string CarName { get; set; } } The IBrand interface has some properties: public interface IBrand { // Properties string LogoName { get; set; } string Sector { get; set; } } I am binding this Cars IEnumerable to a DataGrid

two-way binding of a single object in observableArray

*爱你&永不变心* 提交于 2019-12-12 00:45:57
问题 My page is as follows: <button id="add">Add Data</button> <button id="show">show</button> <table> <tr style="vertical-align:top"> <td> <table border="1"> <thead> <tr> <th>Id</th> <th>Name</th> </tr> </thead> <tbody data-bind="foreach: students"> <tr> <td data-bind="text: id"></td> <td> <input type="text" data-bind="value: name" /> </td> <td> <a href="javascript:void(0)" data-bind="click: $root.showData">Select</a> </td> </tr> </tbody> </table> </td> <td> <table id="data"> <tbody data-bind=

Control bound to a model shows old value on certain keys despite get property() working in Angular

微笑、不失礼 提交于 2019-12-11 23:27:04
问题 First of all, sorry for the cryptic question. I'll update gladly if someone suggests something better. Perhaps it's my diagnostics that aren't well directed. I have a config class that has a field. There's a input box bound to that field and, since the requirment is a bit complex, I implemented get and set methods for it. The design looks like this. export class RowConfig { constructor(public amount = 0, ...) { } get rendition() { let output = ""; if (this.amount !== null && this.amount !==

What does exactly <Expander Header=“{Binding}”> do?

点点圈 提交于 2019-12-11 23:12:03
问题 While creating a simple custom expander, I encountered the problem where items inside IT wouldn't bind. I found the fix on this link: http://codeoverload.wordpress.com/2012/03/04/wpf-expander-headertemplates-dont-forget-the-binding/ Which happens to treat that exact same issue, however what I understand from it is "found this by luck, not really sure why it worked ;D" My question being now: why does adding Header={Binding} fixes the issue. Indeed from the fact binding wouldn't work, it seems

Binding static class to ListBox and TextBlock

╄→гoц情女王★ 提交于 2019-12-11 22:35:06
问题 User Class - Name - Picture Friend Class - Profile Of Type User - Age MyProfile STATIC Class - STATIC Profile Of Type User - STATIC Friends Collection Of Type Friend -- EDIT -- How to bind to the following : - MyProfile.Friends To List Box which Contains Text blocks to have Friends Names - MyProfile.Profile.Name To Textblock 回答1: Make sure you define a namespace in your xaml to your C# namespace. I've named it local. MyProfile.Friends To List Box which Contains Text blocks to have Friends

C# Datagridview Binding to a Class not updating

烈酒焚心 提交于 2019-12-11 20:42:06
问题 I have a datagridview that I am binding to a class. I add to the class but the datagridview is not updating. My bind: ScannedChecks = new ScannedChecks(); ScannedChecks.AddCheck(DateTime.Now, "22222", "checknumdd", "routingdd", _checkData, 4); dataGridView1.DataSource = ScannedChecks; I went ahead and did the AddCheck to see if it was reaching the datagridview and it isn't... The class is being updated though. My class: namespace SSS.Ckentry { public class ScannedChecks :

port binding error, on Python opening

二次信任 提交于 2019-12-11 20:40:06
问题 When I open Python's IDLE, sometimes and error name 'port binding error' is accrues, and IDLE is filed to run on the computer. one this error accrues, it will repeat every time I'll open IDLE, till the computer will be restarted. the error box saies: ' ILDE can't bind to a TCP/IP port, which is necessary to communicate with its Python execution server. This might be because no networking is installed on this computer. Run IDLE with the -n command line switch to start without a subprocess and

Trouble passing complex data between view and controller in ASP.NET MVC

。_饼干妹妹 提交于 2019-12-11 20:12:10
问题 Here's a simplification of my real models in ASP.NET MVC, that I think will help focus in on the problem: Let's say I have these two domain objects: public class ObjectA { public ObjectB ObjectB; } public class ObjectB { } I also have a view that will allow me to create a new ObjectA and that includes selecting one ObjectB from a list of possible ObjectBs. I have created a new class to decorate ObjectA with this list of possibilities, this is really my view model I guess. public class