binding

How can I bind a container to listview control in MVVM standard with Caliburn.Micro?

 ̄綄美尐妖づ 提交于 2019-12-13 13:52:39
问题 I'm writing a program with MVVM (C#) and XAML using Caliburn.Micro library. I was wondering how can I bind my Listview control with some containers such as List<Type> , IEnumerable<Type> or ObservableCollection< Type> ? Views\MainView.xaml <ListView Grid.Column="1" x:Name="FileListView" ItemsSource="{Binding ListOfFile}" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" Margin="10" Background="#FFE6EEF7"> <ListView.View> <GridView> <GridViewColumn Header="Status" Width="100" />

Bind Items to MenuItem -> use Command

余生颓废 提交于 2019-12-13 12:09:43
问题 I have a MenuItem, which has a collection of items in it. It looks like the File -> Open Menuitem. So: File Open Open from DataBase File 1 File 2 File 3 XAML Code: <Menu> <MenuItem Header="File"> <MenuItem Header="Open"> <MenuItem Header="From Database" ItemsSource="{Binding OCFragebogen}"/> </MenuItem> </MenuItem> </Menu> I want to call a Command, when a specific item has been clicked. Example: User clicks on File 1, a command should be called where the "File 1" is the Command Parameter.

jquery “this” binding issue on event handler (equivalent of bindAsEventListener in prototype)

狂风中的少年 提交于 2019-12-13 12:02:11
问题 In jquery an event hadler's binding is the event generating DOM element (this points to the dom element). In prototype to change the binding of an event handler one can use the bindAsEventListener function; How can I access both the instance and the DOM element from a event handler? Similar to How can I bind an event handler to an instance in JQuery? function Car(){ this.km = 0; $("#sprint").click(this.drive); //setup event handler } // event handler // in it I need to access both the clicked

binding combobox to another combobox in wpf

无人久伴 提交于 2019-12-13 11:46:59
问题 I have two combo boxes in wpf one of the combo boxes looks like so: <ComboBox Height="23" HorizontalAlignment="Left" Margin="244,10,0,0" Name="comboBox2" VerticalAlignment="Top" Width="120"> <ComboBoxItem Content="Peugeut" /> <ComboBoxItem Content="Ford" /> <ComboBoxItem Content="BMW" /> </ComboBox> I was wondering how you bind the second combobox2 to list specifc car makes to the selected item in combobox1. If Peurgeut is selected then in combobox two there should be a list: 106 206 306 or

Partial-unmarshalling with JAXB

你离开我真会死。 提交于 2019-12-13 11:44:15
问题 I want do partial unmarshaling of big XML. XML has following structure: <Records> <Contract> ... </Contract> <Contract> ... </Contract> ... <Contract> ... </Contract> <Contract> ... </Contract> </Records> And result class generated with XJC: - Records |- Contract If i follow these(sample from jaxb-ri), i get error: Exception in thread "main" javax.xml.bind.UnmarshalException: unexpected element (uri:"http://somedomain.com", local:"Contract"). Expected elements are <{http://somedomain.com

Observable collection bind to specific item (by property value)

a 夏天 提交于 2019-12-13 11:17:01
问题 I have a question about binding a specific observable (or list) item to a textblock in my wpf application. Normally, you can bind a specific item like this But when your collection grows to (for example) a huge collection. Binding properties like: Mycollection[14224].Name Wil just become a mess. So is there an alternative binding method, that still lets me bind to a specific item in my observable collection. But does not do so by the index of the item in the collection. If so, how is this

What is the meaning of :: in Angular? [duplicate]

扶醉桌前 提交于 2019-12-13 09:26:48
问题 This question already has answers here : What does :: mean in angularJS (3 answers) Closed 2 years ago . I saw this partial code in an ng-repeat directive <div ng-repeat="image in images"> <img ng-src="{{::image.src}}"/> </div> Not sure if it's related to the ng-repeat directive. The page looks the same with or without it but I'm curious what it is. 回答1: This synthax is use for one-time binding in AngularJS: An expression that starts with :: is considered a one-time expression. One-time

Is it guaranteed that on IValueConverter ConvertBack call other views would update?

血红的双手。 提交于 2019-12-13 07:45:41
问题 Is it guaranteed that on IValueConverter ConvertBack call other views would update and how to enforce it? I have 4 parameters in a List. Each pair of them can be calculated from another two in a manner like: A = f(a,b) B = f2(a,b) a = f3(A,B) b = f4(A,B) I have them all rendered in one in a ItemsControl. I created a IValueConverter that can Convert and ConvertBack on demand. During Conversion Back of one item values for other three are updated in the source List. I wonder if it is guaranteed

angular 4 binding images cannot read property of undefined

倖福魔咒の 提交于 2019-12-13 07:41:24
问题 I have an Angular 4.0 component, and its relative HTML with an NgFor cicle who creates a card element for each "book object" retrieved from my api (developed with django rest framework). BROWSER.HTML <div *ngFor="let book of books" class="col s12 m2"> <div class="card"> <div class="card-image"> <img src="{{book.img_url}}" > </div> <div class="card-content"> <span class="card-title">{{book.book_title}}</span> <p>ISBN: {{book.isbn}}</p> </div> <div class="card-action"> <a [routerLink]="['

Alternative to jQuery's .toggle() method that supports eventData?

自闭症网瘾萝莉.ら 提交于 2019-12-13 06:59:12
问题 The jQuery documentation for the .toggle() method states: The .toggle() method is provided for convenience. It is relatively straightforward to implement the same behavior by hand, and this can be necessary if the assumptions built into .toggle() prove limiting. The assumptions built into .toggle have proven limiting for my current task, but the documentation doesn't elaborate on how to implement the same behavior. I need to pass eventData to the handler functions provided to toggle() , but